@@ -1538,6 +1538,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
1538
1538
set_assign
1539
1539
sf_tail_standalone
1540
1540
sp_tail_standalone
1541
+ opt_constraint_no_id
1541
1542
END_OF_INPUT
1542
1543
1543
1544
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@@ -6564,6 +6565,11 @@ check_constraint:
6564
6565
}
6565
6566
;
6566
6567
6568
+ opt_constraint_no_id:
6569
+ /* Empty */ {}
6570
+ | CONSTRAINT {}
6571
+ ;
6572
+
6567
6573
opt_constraint:
6568
6574
/* empty */ { $$= null_clex_str; }
6569
6575
| constraint { $$= $1; }
@@ -8314,7 +8320,7 @@ alter_list_item:
8314
8320
lex->alter_info.drop_list.push_back(ad, thd->mem_root);
8315
8321
lex->alter_info.flags|= ALTER_DROP_FOREIGN_KEY;
8316
8322
}
8317
- | DROP PRIMARY_SYM KEY_SYM
8323
+ | DROP opt_constraint_no_id PRIMARY_SYM KEY_SYM
8318
8324
{
8319
8325
LEX *lex=Lex;
8320
8326
Alter_drop *ad= (new (thd->mem_root)
@@ -8824,8 +8830,17 @@ binlog_base64_event:
8824
8830
{
8825
8831
Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
8826
8832
Lex->comment= $2;
8833
+ Lex->ident.str= NULL;
8834
+ Lex->ident.length= 0;
8827
8835
}
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
+ ;
8829
8844
8830
8845
check_view_or_table:
8831
8846
table_or_tables table_list opt_mi_check_type
@@ -17641,19 +17656,21 @@ subselect_end:
17641
17656
lex->current_select = lex->current_select->return_after_parsing();
17642
17657
lex->nest_level--;
17643
17658
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;
17650
17659
17651
17660
/*
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.
17654
17665
*/
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
+ }
17657
17674
}
17658
17675
;
17659
17676
0 commit comments