summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-02-07 13:59:31 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-02-07 13:59:31 +0100
commit65c5ef9b495bac078ad2a502a75801c7cfe5b95a (patch)
tree266859fc4e22dcd18112a25e8a3e4f9d93a043a0 /sql/sql_yacc.yy
parent7293ce0ee81f05b1ec3ac9ddcc88bfbee4030e55 (diff)
parent625994b7cc4ebd0bc2652ae80b93386aa4b766ac (diff)
downloadmariadb-git-65c5ef9b495bac078ad2a502a75801c7cfe5b95a.tar.gz
dirty merge
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy41
1 files changed, 29 insertions, 12 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 46eac699c04..98ead67011c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -2132,6 +2132,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
opt_lock_wait_timeout
opt_delete_gtid_domain
asrow_attribute
+ opt_constraint_no_id
END_OF_INPUT
%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
@@ -6718,6 +6719,11 @@ check_constraint:
}
;
+opt_constraint_no_id:
+ /* Empty */ {}
+ | CONSTRAINT {}
+ ;
+
opt_constraint:
/* empty */ { $$= null_clex_str; }
| constraint { $$= $1; }
@@ -8377,7 +8383,7 @@ alter_list_item:
lex->alter_info.drop_list.push_back(ad, thd->mem_root);
lex->alter_info.flags|= ALTER_DROP_FOREIGN_KEY;
}
- | DROP PRIMARY_SYM KEY_SYM
+ | DROP opt_constraint_no_id PRIMARY_SYM KEY_SYM
{
LEX *lex=Lex;
Alter_drop *ad= (new (thd->mem_root)
@@ -8887,8 +8893,17 @@ binlog_base64_event:
{
Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
Lex->comment= $2;
+ Lex->ident.str= NULL;
+ Lex->ident.length= 0;
}
- ;
+ |
+ BINLOG_SYM '@' ident_or_text ',' '@' ident_or_text
+ {
+ Lex->sql_command = SQLCOM_BINLOG_BASE64_EVENT;
+ Lex->comment= $3;
+ Lex->ident= $6;
+ }
+ ;
check_view_or_table:
table_or_tables table_list opt_mi_check_type
@@ -17587,19 +17602,21 @@ subselect_end:
lex->current_select = lex->current_select->return_after_parsing();
lex->nest_level--;
lex->current_select->n_child_sum_items += child->n_sum_items;
- /*
- A subselect can add fields to an outer select. Reserve space for
- them.
- */
- lex->current_select->select_n_where_fields+=
- child->select_n_where_fields;
/*
- Aggregate functions in having clause may add fields to an outer
- select. Count them also.
+ A subquery (and all the subsequent query blocks in a UNION) can
+ add columns to an outer query block. Reserve space for them.
+ Aggregate functions in having clause can also add fields to an
+ outer select.
*/
- lex->current_select->select_n_having_items+=
- child->select_n_having_items;
+ for (SELECT_LEX *temp= child->master_unit()->first_select();
+ temp != NULL; temp= temp->next_select())
+ {
+ lex->current_select->select_n_where_fields+=
+ temp->select_n_where_fields;
+ lex->current_select->select_n_having_items+=
+ temp->select_n_having_items;
+ }
}
;