Skip to content

Commit c65daf0

Browse files
committed
make compatible parser in sync with main one
1 parent 0090671 commit c65daf0

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

sql/sql_yacc_ora.yy

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
15381538
set_assign
15391539
sf_tail_standalone
15401540
sp_tail_standalone
1541+
opt_constraint_no_id
15411542
END_OF_INPUT
15421543

15431544
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@@ -6564,6 +6565,11 @@ check_constraint:
65646565
}
65656566
;
65666567

6568+
opt_constraint_no_id:
6569+
/* Empty */ {}
6570+
| CONSTRAINT {}
6571+
;
6572+
65676573
opt_constraint:
65686574
/* empty */ { $$= null_clex_str; }
65696575
| constraint { $$= $1; }
@@ -8314,7 +8320,7 @@ alter_list_item:
83148320
lex->alter_info.drop_list.push_back(ad, thd->mem_root);
83158321
lex->alter_info.flags|= ALTER_DROP_FOREIGN_KEY;
83168322
}
8317-
| DROP PRIMARY_SYM KEY_SYM
8323+
| DROP opt_constraint_no_id PRIMARY_SYM KEY_SYM
83188324
{
83198325
LEX *lex=Lex;
83208326
Alter_drop *ad= (new (thd->mem_root)
@@ -8824,8 +8830,17 @@ binlog_base64_event:
88248830
{
88258831
Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
88268832
Lex->comment= $2;
8833+
Lex->ident.str= NULL;
8834+
Lex->ident.length= 0;
88278835
}
8828-
;
8836+
|
8837+
BINLOG_SYM '@' ident_or_text ',' '@' ident_or_text
8838+
{
8839+
Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
8840+
Lex->comment= $3;
8841+
Lex->ident= $6;
8842+
}
8843+
;
88298844

88308845
check_view_or_table:
88318846
table_or_tables table_list opt_mi_check_type
@@ -17641,19 +17656,21 @@ subselect_end:
1764117656
lex->current_select = lex->current_select->return_after_parsing();
1764217657
lex->nest_level--;
1764317658
lex->current_select->n_child_sum_items += child->n_sum_items;
17644-
/*
17645-
A subselect can add fields to an outer select. Reserve space for
17646-
them.
17647-
*/
17648-
lex->current_select->select_n_where_fields+=
17649-
child->select_n_where_fields;
1765017659

1765117660
/*
17652-
Aggregate functions in having clause may add fields to an outer
17653-
select. Count them also.
17661+
A subquery (and all the subsequent query blocks in a UNION) can
17662+
add columns to an outer query block. Reserve space for them.
17663+
Aggregate functions in having clause can also add fields to an
17664+
outer select.
1765417665
*/
17655-
lex->current_select->select_n_having_items+=
17656-
child->select_n_having_items;
17666+
for (SELECT_LEX *temp= child->master_unit()->first_select();
17667+
temp != NULL; temp= temp->next_select())
17668+
{
17669+
lex->current_select->select_n_where_fields+=
17670+
temp->select_n_where_fields;
17671+
lex->current_select->select_n_having_items+=
17672+
temp->select_n_having_items;
17673+
}
1765717674
}
1765817675
;
1765917676

0 commit comments

Comments
 (0)