Skip to content
  • Roy Lyseng's avatar
    5f99fa35
    Bug#22239474: Unexpected error 1093 on nested subquery for update · 5f99fa35
    Roy Lyseng authored
    Problem:
    After it was made possible to merge derived tables into the outer
    query block, it was no longer possible to use a documented workaround
    for how to avoid error ER_UPDATE_TABLE_USED when referencing the same
    table in a subquery as was used as target for an UPDATE or DELETE
    statement.
    
    The solution is to put tighter control over which derived tables that
    can be merged. A boolean property is introduced in class SELECT_LEX,
    controlling which derived tables underneath it that can be merged:
    The important derived tables to control are those immediately
    underlying some subqueries of an UPDATE or DELETE statement.
    
    Notice that this property affects unnamed derived tables only;
    view references are not affected.
    5f99fa35
    Bug#22239474: Unexpected error 1093 on nested subquery for update
    Roy Lyseng authored
    Problem:
    After it was made possible to merge derived tables into the outer
    query block, it was no longer possible to use a documented workaround
    for how to avoid error ER_UPDATE_TABLE_USED when referencing the same
    table in a subquery as was used as target for an UPDATE or DELETE
    statement.
    
    The solution is to put tighter control over which derived tables that
    can be merged. A boolean property is introduced in class SELECT_LEX,
    controlling which derived tables underneath it that can be merged:
    The important derived tables to control are those immediately
    underlying some subqueries of an UPDATE or DELETE statement.
    
    Notice that this property affects unnamed derived tables only;
    view references are not affected.
Loading