diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c2739d1d2fac6..52a877c28ecee 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -3256,7 +3256,7 @@ row_field_definition_list: ; row_type_body: - '(' row_field_definition_list ')' { $$= $2; } + '(' row_field_definition_list ')' { $$= $2; } ; sp_decl_idents_init_vars: diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 0ae8c4e11d92f..90d7e686c43d9 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -1095,7 +1095,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); case_stmt_body opt_bin_mod opt_if_exists_table_element opt_if_not_exists_table_element opt_recursive - type_or_rowtype %type create_or_replace @@ -1353,7 +1352,8 @@ END_OF_INPUT %type view_algorithm view_check_option %type view_suid opt_view_suid -%type sp_decl_idents sp_handler_type sp_hcond_list +%type sp_decl_idents sp_decl_idents_init_vars +%type sp_handler_type sp_hcond_list %type sp_cond sp_hcond sqlstate signal_value opt_signal_value %type sp_decl_body_list opt_sp_decl_body_list %type sp_decl_non_handler sp_decl_non_handler_list @@ -1388,7 +1388,7 @@ END_OF_INPUT %type condition_information; %type row_field_name row_field_definition -%type row_field_definition_list field_type_row +%type row_field_definition_list row_type_body %type opt_window_clause window_def_list window_def window_spec %type window_name @@ -2548,13 +2548,13 @@ sp_param_name_and_type: { Lex->sphead->fill_spvar_using_type_reference($$= $1, $2); } - | sp_param_name field_type_row + | sp_param_name ROW_SYM row_type_body { $$= $1; $$->field_def.field_name= $$->name; Lex->sphead->fill_spvar_definition(thd, &$$->field_def); - Lex->sphead->row_fill_field_definitions(thd, $2); - $$->field_def.set_row_field_definitions($2); + Lex->sphead->row_fill_field_definitions(thd, $3); + $$->field_def.set_row_field_definitions($3); } ; @@ -2580,13 +2580,13 @@ sp_pdparam: { Lex->sphead->fill_spvar_using_type_reference($1, $3); } - | sp_param_name sp_opt_inout field_type_row + | sp_param_name sp_opt_inout ROW_SYM row_type_body { $1->mode= $2; $1->field_def.field_name= $1->name; Lex->sphead->fill_spvar_definition(thd, &$1->field_def); - Lex->sphead->row_fill_field_definitions(thd, $3); - $1->field_def.set_row_field_definitions($3); + Lex->sphead->row_fill_field_definitions(thd, $4); + $1->field_def.set_row_field_definitions($4); } ; @@ -2769,46 +2769,45 @@ row_field_definition_list: } ; -field_type_row: - ROW_SYM '(' row_field_definition_list ')' { $$= $3; } - ; - -type_or_rowtype: - TYPE_SYM { $$= 0; } - | ROWTYPE_SYM { $$= 1; } +row_type_body: + '(' row_field_definition_list ')' { $$= $2; } ; -sp_decl_non_handler: +sp_decl_idents_init_vars: sp_decl_idents { Lex->sp_variable_declarations_init(thd, $1); } + ; + +sp_decl_non_handler: + sp_decl_idents_init_vars type_with_opt_collate sp_opt_default { if (Lex->sp_variable_declarations_finalize(thd, $1, - &Lex->last_field[0], $4)) + &Lex->last_field[0], $3)) MYSQL_YYABORT; $$.init_using_vars($1); } - | sp_decl_idents - { - Lex->sp_variable_declarations_init(thd, $1); - } - optionally_qualified_column_ident '%' type_or_rowtype + | sp_decl_idents_init_vars + optionally_qualified_column_ident '%' TYPE_SYM sp_opt_default { - if ($5 ? - Lex->sp_variable_declarations_rowtype_finalize(thd, $1, $3, $6) : - Lex->sp_variable_declarations_with_ref_finalize(thd, $1, $3, $6)) + if (Lex->sp_variable_declarations_with_ref_finalize(thd, $1, $2, $5)) MYSQL_YYABORT; $$.init_using_vars($1); } - | sp_decl_idents + | sp_decl_idents_init_vars + optionally_qualified_column_ident '%' ROWTYPE_SYM + sp_opt_default { - Lex->sp_variable_declarations_init(thd, $1); + if (Lex->sp_variable_declarations_rowtype_finalize(thd, $1, $2, $5)) + MYSQL_YYABORT; + $$.init_using_vars($1); } - field_type_row + | sp_decl_idents_init_vars + ROW_SYM row_type_body sp_opt_default { if (Lex->sp_variable_declarations_row_finalize(thd, $1, $3, $4)) @@ -4651,9 +4650,11 @@ size_number: case 'g': case 'G': text_shift_number+=10; + /* fall through */ case 'm': case 'M': text_shift_number+=10; + /* fall through */ case 'k': case 'K': text_shift_number+=10;