diff options
author | timour@mysql.com <> | 2005-08-12 17:57:19 +0300 |
---|---|---|
committer | timour@mysql.com <> | 2005-08-12 17:57:19 +0300 |
commit | a247282aa6270e809f4ad3f5205dc79ca7be8ec0 (patch) | |
tree | 98cc5c366d6eaba9f415323933356e53cf8d3a92 /sql/sql_update.cc | |
parent | 2889025accafd9f7a5c7b2788b9e34f31dc257e4 (diff) | |
download | mariadb-git-a247282aa6270e809f4ad3f5205dc79ca7be8ec0.tar.gz |
Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".
* Some of the main problems fixed by the patch:
- in "select *" queries the * expanded correctly according to
ANSI for arbitrary natural/using joins
- natural/using joins are correctly transformed into JOIN ... ON
for any number/nesting of the joins.
- column references are correctly resolved against natural joins
of any nesting and combined with arbitrary other joins.
* This patch also contains a fix for name resolution of items
inside the ON condition of JOIN ... ON - in this case items must
be resolved only against the JOIN operands. To support such
'local' name resolution, the patch introduces a stack of
name resolution contexts used at parse time.
NOTICE:
- This patch is not complete in the sense that
- there are 2 test cases that still do not pass -
one in join.test, one in select.test. Both are marked
with a comment "TODO: WL#2486".
- it does not include a new test specific for the task
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 8a5b4ad8eae..ce8a3855b11 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -555,7 +555,7 @@ bool mysql_prepare_update(THD *thd, TABLE_LIST *table_list, tables.table= table; tables.alias= table_list->alias; - if (setup_tables(thd, &select_lex->context, + if (setup_tables(thd, &select_lex->context, &select_lex->top_join_list, table_list, conds, &select_lex->leaf_tables, FALSE) || setup_conds(thd, table_list, select_lex->leaf_tables, conds) || @@ -642,6 +642,7 @@ bool mysql_multi_update_prepare(THD *thd) */ if (setup_tables(thd, &lex->select_lex.context, + &lex->select_lex.top_join_list, table_list, &lex->select_lex.where, &lex->select_lex.leaf_tables, FALSE)) DBUG_RETURN(TRUE); @@ -760,6 +761,7 @@ bool mysql_multi_update_prepare(THD *thd) tbl->cleanup_items(); if (setup_tables(thd, &lex->select_lex.context, + &lex->select_lex.top_join_list, table_list, &lex->select_lex.where, &lex->select_lex.leaf_tables, FALSE) || setup_fields_with_no_wrap(thd, 0, *fields, 1, 0, 0)) |