mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
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.
This commit is contained in:
parent
3284c39a1f
commit
b01993fd4e
1 changed files with 19 additions and 14 deletions
|
@ -1635,17 +1635,9 @@ table_to_table:
|
|||
select:
|
||||
select_init { Lex->sql_command=SQLCOM_SELECT; };
|
||||
|
||||
/* Need select_init2 for subselects. */
|
||||
select_init:
|
||||
SELECT_SYM select_part2
|
||||
{
|
||||
LEX *lex= Lex;
|
||||
if (lex->current_select->set_braces(false))
|
||||
{
|
||||
send_error(lex->thd, ER_SYNTAX_ERROR);
|
||||
YYABORT;
|
||||
}
|
||||
}
|
||||
union
|
||||
SELECT_SYM select_init2
|
||||
|
|
||||
'(' SELECT_SYM select_part2 ')'
|
||||
{
|
||||
|
@ -1661,6 +1653,19 @@ select_init:
|
|||
sel->master_unit();
|
||||
} 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:
|
||||
{
|
||||
LEX *lex=Lex;
|
||||
|
@ -4388,7 +4393,7 @@ singleval_subselect:
|
|||
};
|
||||
|
||||
singleval_subselect_init:
|
||||
select_init
|
||||
select_init2
|
||||
{
|
||||
$$= new Item_singleval_subselect(YYTHD,
|
||||
Lex->current_select->master_unit()->
|
||||
|
@ -4403,7 +4408,7 @@ exists_subselect:
|
|||
};
|
||||
|
||||
exists_subselect_init:
|
||||
select_init
|
||||
select_init2
|
||||
{
|
||||
$$= new Item_exists_subselect(YYTHD,
|
||||
Lex->current_select->master_unit()->
|
||||
|
@ -4418,13 +4423,13 @@ in_subselect:
|
|||
};
|
||||
|
||||
in_subselect_init:
|
||||
select_init
|
||||
select_init2
|
||||
{
|
||||
$$= Lex->current_select->master_unit()->first_select();
|
||||
};
|
||||
|
||||
subselect_start:
|
||||
'('
|
||||
'(' SELECT_SYM
|
||||
{
|
||||
if (mysql_new_select(Lex, 1))
|
||||
YYABORT;
|
||||
|
|
Loading…
Reference in a new issue