-
Guilhem Bichot authored
When trying to open the table to delete from, single-table DELETE ignores CTEs, which thus violates SQL's name visibility rules. That's because it calls add_table_to_list() with parse_context==nullptr, which has the effect that adding the table-to-delete doesn't search in the WITH clause to see if it is a CTE, as the WITH clause is accessible from parse_context. Fix: set the parse_context argument. I have gone through all calls to add_table_to_list(pc=nullptr) in all types of SQL statements, and I think only this call needs fixing. Reviewed-by:
Gleb Shchepa <gleb.shchepa@oracle.com> Change-Id: Iea3167adf861618bd6b351fa164057cf102c78e9
Guilhem Bichot authoredWhen trying to open the table to delete from, single-table DELETE ignores CTEs, which thus violates SQL's name visibility rules. That's because it calls add_table_to_list() with parse_context==nullptr, which has the effect that adding the table-to-delete doesn't search in the WITH clause to see if it is a CTE, as the WITH clause is accessible from parse_context. Fix: set the parse_context argument. I have gone through all calls to add_table_to_list(pc=nullptr) in all types of SQL statements, and I think only this call needs fixing. Reviewed-by:
Gleb Shchepa <gleb.shchepa@oracle.com> Change-Id: Iea3167adf861618bd6b351fa164057cf102c78e9
Loading