Commit 84e55cfc authored by igor@rurik.mysql.com's avatar igor@rurik.mysql.com

sql_yacc.yy:

  Correction for nested joins.
parent 356cbe4f
...@@ -4223,9 +4223,9 @@ join_table: ...@@ -4223,9 +4223,9 @@ join_table:
'(' using_list ')' '(' using_list ')'
{ add_join_on($3,$7); $$=$3; } { add_join_on($3,$7); $$=$3; }
| table_ref LEFT opt_outer JOIN_SYM table_ref ON expr | table_ref LEFT opt_outer JOIN_SYM table_factor ON expr
{ add_join_on($5,$7); $5->outer_join|=JOIN_TYPE_LEFT; $$=$5; } { add_join_on($5,$7); $5->outer_join|=JOIN_TYPE_LEFT; $$=$5; }
| table_ref LEFT opt_outer JOIN_SYM table_ref | table_ref LEFT opt_outer JOIN_SYM table_factor
{ {
SELECT_LEX *sel= Select; SELECT_LEX *sel= Select;
sel->save_names_for_using_list($1, $5); sel->save_names_for_using_list($1, $5);
...@@ -4238,14 +4238,14 @@ join_table: ...@@ -4238,14 +4238,14 @@ join_table:
$6->outer_join|=JOIN_TYPE_LEFT; $6->outer_join|=JOIN_TYPE_LEFT;
$$=$6; $$=$6;
} }
| table_ref RIGHT opt_outer JOIN_SYM table_ref ON expr | table_ref RIGHT opt_outer JOIN_SYM table_factor ON expr
{ {
LEX *lex= Lex; LEX *lex= Lex;
if (!($$= lex->current_select->convert_right_join())) if (!($$= lex->current_select->convert_right_join()))
YYABORT; YYABORT;
add_join_on($$, $7); add_join_on($$, $7);
} }
| table_ref RIGHT opt_outer JOIN_SYM table_ref | table_ref RIGHT opt_outer JOIN_SYM table_factor
{ {
SELECT_LEX *sel= Select; SELECT_LEX *sel= Select;
sel->save_names_for_using_list($1, $5); sel->save_names_for_using_list($1, $5);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment