diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2021-07-31 22:59:58 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2021-07-31 22:59:58 +0200 |
commit | 7841a7eb09208f52fcbab7e80e38c7ca29b1339e (patch) | |
tree | 7f9c4d80d3b86a33c54ff0090865ada4d4ed577d /sql/sql_yacc_ora.yy | |
parent | 77992bc710bbc16798c12da7081769817f87791a (diff) | |
parent | 1423cf5e3dcb3c50047f086a5933fe77006cf242 (diff) | |
download | mariadb-git-7841a7eb09208f52fcbab7e80e38c7ca29b1339e.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_yacc_ora.yy')
-rw-r--r-- | sql/sql_yacc_ora.yy | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index 76eb21a88e8..ae8e5116cff 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -1368,7 +1368,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, size_t *yystacksize); table_wild simple_expr column_default_non_parenthesized_expr udf_expr primary_expr string_factor_expr mysql_concatenation_expr select_sublist_qualified_asterisk - expr_or_default set_expr_or_default + expr_or_ignore expr_or_ignore_or_default set_expr_or_default geometry_function signed_literal expr_or_literal sp_opt_default simple_ident_nospvar @@ -1890,12 +1890,12 @@ execute_using: ; execute_params: - expr_or_default + expr_or_ignore_or_default { if (unlikely(!($$= List<Item>::make(thd->mem_root, $1)))) MYSQL_YYABORT; } - | execute_params ',' expr_or_default + | execute_params ',' expr_or_ignore_or_default { if (($$= $1)->push_back($3, thd->mem_root)) MYSQL_YYABORT; @@ -10684,7 +10684,7 @@ column_default_non_parenthesized_expr: if (unlikely(il)) my_yyabort_error((ER_WRONG_COLUMN_NAME, MYF(0), il->my_name()->str)); $$= new (thd->mem_root) Item_default_value(thd, Lex->current_context(), - $3); + $3, 0); if (unlikely($$ == NULL)) MYSQL_YYABORT; Lex->default_used= TRUE; @@ -13830,7 +13830,7 @@ ident_eq_list: ; ident_eq_value: - simple_ident_nospvar equal expr_or_default + simple_ident_nospvar equal expr_or_ignore_or_default { LEX *lex=Lex; if (unlikely(lex->field_list.push_back($1, thd->mem_root)) || @@ -13900,12 +13900,12 @@ opt_values_with_names: ; values: - values ',' expr_or_default + values ',' expr_or_ignore_or_default { if (unlikely(Lex->insert_list->push_back($3, thd->mem_root))) MYSQL_YYABORT; } - | expr_or_default + | expr_or_ignore_or_default { if (unlikely(Lex->insert_list->push_back($1, thd->mem_root))) MYSQL_YYABORT; @@ -13913,7 +13913,7 @@ values: ; values_with_names: - values_with_names ',' remember_name expr_or_default remember_end + values_with_names ',' remember_name expr_or_ignore_or_default remember_end { if (unlikely(Lex->insert_list->push_back($4, thd->mem_root))) MYSQL_YYABORT; @@ -13921,7 +13921,7 @@ values_with_names: if (!$4->name.str || $4->name.str == item_empty_name) $4->set_name(thd, $3, (uint) ($5 - $3), thd->charset()); } - | remember_name expr_or_default remember_end + | remember_name expr_or_ignore_or_default remember_end { if (unlikely(Lex->insert_list->push_back($2, thd->mem_root))) MYSQL_YYABORT; @@ -13931,17 +13931,21 @@ values_with_names: } ; -expr_or_default: +expr_or_ignore: expr { $$= $1;} - | DEFAULT + | IGNORE_SYM { - $$= new (thd->mem_root) Item_default_specification(thd); + $$= new (thd->mem_root) Item_ignore_specification(thd); if (unlikely($$ == NULL)) MYSQL_YYABORT; } - | IGNORE_SYM + ; + +expr_or_ignore_or_default: + expr_or_ignore { $$= $1;} + | DEFAULT { - $$= new (thd->mem_root) Item_ignore_specification(thd); + $$= new (thd->mem_root) Item_default_specification(thd); if (unlikely($$ == NULL)) MYSQL_YYABORT; } @@ -14026,10 +14030,16 @@ update_list: ; update_elem: - simple_ident_nospvar equal expr_or_default + simple_ident_nospvar equal DEFAULT + { + Item *def= new (thd->mem_root) Item_default_value(thd, + Lex->current_context(), $1, 1); + if (!def || add_item_to_list(thd, $1) || add_value_to_list(thd, def)) + MYSQL_YYABORT; + } + | simple_ident_nospvar equal expr_or_ignore { - if (unlikely(add_item_to_list(thd, $1)) || - unlikely(add_value_to_list(thd, $3))) + if (add_item_to_list(thd, $1) || add_value_to_list(thd, $3)) MYSQL_YYABORT; } ; @@ -14040,7 +14050,7 @@ insert_update_list: ; insert_update_elem: - simple_ident_nospvar equal expr_or_default + simple_ident_nospvar equal expr_or_ignore_or_default { LEX *lex= Lex; if (unlikely(lex->update_list.push_back($1, thd->mem_root)) || @@ -15380,7 +15390,7 @@ load_data_set_list: ; load_data_set_elem: - simple_ident_nospvar equal remember_name expr_or_default remember_end + simple_ident_nospvar equal remember_name expr_or_ignore_or_default remember_end { LEX *lex= Lex; if (unlikely(lex->update_list.push_back($1, thd->mem_root)) || |