Commit 251c6e17 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-21073 Collect different grammar rules into a single chunk

On order to unify the two *.yy files easier,
this patch collects all different rules to the end of *.yy files,
so the rule section looks like this:

%%
common rules
different rules
parent a9846f32
......@@ -9741,6 +9741,17 @@ LEX::add_primary_to_query_expression_body(SELECT_LEX_UNIT *unit,
}
SELECT_LEX_UNIT *
LEX::add_primary_to_query_expression_body(SELECT_LEX_UNIT *unit,
SELECT_LEX *sel,
enum sub_select_type unit_type,
bool distinct)
{
return
add_primary_to_query_expression_body(unit, sel, unit_type, distinct,
thd->variables.sql_mode & MODE_ORACLE);
}
/**
Add query primary to a parenthesized query primary
pruducing a new query expression body
......@@ -11130,3 +11141,30 @@ bool LEX::sp_if_after_statements(THD *thd)
sphead->push_backpatch(thd, i, spcont->push_label(thd, &empty_clex_str, 0));
return false;
}
sp_condition_value *LEX::stmt_signal_value(const Lex_ident_sys_st &ident)
{
sp_condition_value *cond;
/* SIGNAL foo cannot be used outside of stored programs */
if (unlikely(spcont == NULL))
{
my_error(ER_SP_COND_MISMATCH, MYF(0), ident.str);
return NULL;
}
cond= spcont->find_declared_or_predefined_condition(thd, &ident);
if (unlikely(cond == NULL))
{
my_error(ER_SP_COND_MISMATCH, MYF(0), ident.str);
return NULL;
}
bool bad= thd->variables.sql_mode & MODE_ORACLE ?
!cond->has_sql_state() :
cond->type != sp_condition_value::SQLSTATE;
if (unlikely(bad))
{
my_error(ER_SIGNAL_BAD_CONDITION_TYPE, MYF(0));
return NULL;
}
return cond;
}
......@@ -4509,6 +4509,11 @@ struct LEX: public Query_tables_list
bool distinct,
bool oracle);
SELECT_LEX_UNIT *
add_primary_to_query_expression_body(SELECT_LEX_UNIT *unit,
SELECT_LEX *sel,
enum sub_select_type unit_type,
bool distinct);
SELECT_LEX_UNIT *
add_primary_to_query_expression_body_ext_parens(
SELECT_LEX_UNIT *unit,
SELECT_LEX *sel,
......@@ -4597,6 +4602,8 @@ struct LEX: public Query_tables_list
bool stmt_alter_function_start(sp_name *name);
bool stmt_alter_procedure_start(sp_name *name);
sp_condition_value *stmt_signal_value(const Lex_ident_sys_st &ident);
Spvar_definition *row_field_name(THD *thd, const Lex_ident_sys_st &name);
bool set_field_type_udt(Lex_field_type_st *type,
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment