Commit b01993fd authored by unknown's avatar unknown

Fixed the reduce/reduce conflicts introduced by subselects.


sql/sql_yacc.yy:
  Fixed the reduce/reduce conflicts introduced by subselects by
  breaking select_init apart.
parent 3284c39a
...@@ -1635,17 +1635,9 @@ table_to_table: ...@@ -1635,17 +1635,9 @@ table_to_table:
select: select:
select_init { Lex->sql_command=SQLCOM_SELECT; }; select_init { Lex->sql_command=SQLCOM_SELECT; };
/* Need select_init2 for subselects. */
select_init: select_init:
SELECT_SYM select_part2 SELECT_SYM select_init2
{
LEX *lex= Lex;
if (lex->current_select->set_braces(false))
{
send_error(lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
}
union
| |
'(' SELECT_SYM select_part2 ')' '(' SELECT_SYM select_part2 ')'
{ {
...@@ -1661,6 +1653,19 @@ select_init: ...@@ -1661,6 +1653,19 @@ select_init:
sel->master_unit(); sel->master_unit();
} union_opt; } union_opt;
select_init2:
select_part2
{
LEX *lex= Lex;
if (lex->current_select->set_braces(false))
{
send_error(lex->thd, ER_SYNTAX_ERROR);
YYABORT;
}
}
union
;
select_part2: select_part2:
{ {
LEX *lex=Lex; LEX *lex=Lex;
...@@ -4388,7 +4393,7 @@ singleval_subselect: ...@@ -4388,7 +4393,7 @@ singleval_subselect:
}; };
singleval_subselect_init: singleval_subselect_init:
select_init select_init2
{ {
$$= new Item_singleval_subselect(YYTHD, $$= new Item_singleval_subselect(YYTHD,
Lex->current_select->master_unit()-> Lex->current_select->master_unit()->
...@@ -4403,7 +4408,7 @@ exists_subselect: ...@@ -4403,7 +4408,7 @@ exists_subselect:
}; };
exists_subselect_init: exists_subselect_init:
select_init select_init2
{ {
$$= new Item_exists_subselect(YYTHD, $$= new Item_exists_subselect(YYTHD,
Lex->current_select->master_unit()-> Lex->current_select->master_unit()->
...@@ -4418,13 +4423,13 @@ in_subselect: ...@@ -4418,13 +4423,13 @@ in_subselect:
}; };
in_subselect_init: in_subselect_init:
select_init select_init2
{ {
$$= Lex->current_select->master_unit()->first_select(); $$= Lex->current_select->master_unit()->first_select();
}; };
subselect_start: subselect_start:
'(' '(' SELECT_SYM
{ {
if (mysql_new_select(Lex, 1)) if (mysql_new_select(Lex, 1))
YYABORT; YYABORT;
......
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