Skip to content

Commit

Permalink
make compatible parser in sync with main one
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed Feb 19, 2019
1 parent 0090671 commit c65daf0
Showing 1 changed file with 29 additions and 12 deletions.
41 changes: 29 additions & 12 deletions sql/sql_yacc_ora.yy
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize);
set_assign
sf_tail_standalone
sp_tail_standalone
opt_constraint_no_id
END_OF_INPUT

%type <NONE> call sp_proc_stmts sp_proc_stmts1 sp_proc_stmt
Expand Down Expand Up @@ -6564,6 +6565,11 @@ check_constraint:
}
;

opt_constraint_no_id:
/* Empty */ {}
| CONSTRAINT {}
;

opt_constraint:
/* empty */ { $$= null_clex_str; }
| constraint { $$= $1; }
Expand Down Expand Up @@ -8314,7 +8320,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)
Expand Down Expand Up @@ -8824,8 +8830,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
Expand Down Expand Up @@ -17641,19 +17656,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;
}
}
;

Expand Down

0 comments on commit c65daf0

Please sign in to comment.