-
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.
Roy Lyseng authoredProblem: 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