summaryrefslogtreecommitdiff
path: root/sql/sql_yacc.yy
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2021-07-31 22:59:58 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2021-07-31 22:59:58 +0200
commit7841a7eb09208f52fcbab7e80e38c7ca29b1339e (patch)
tree7f9c4d80d3b86a33c54ff0090865ada4d4ed577d /sql/sql_yacc.yy
parent77992bc710bbc16798c12da7081769817f87791a (diff)
parent1423cf5e3dcb3c50047f086a5933fe77006cf242 (diff)
downloadmariadb-git-7841a7eb09208f52fcbab7e80e38c7ca29b1339e.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r--sql/sql_yacc.yy48
1 files changed, 29 insertions, 19 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index dfe239c41bd..af7b29b3c3b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1885,7 +1885,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
@@ -2388,12 +2388,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;
@@ -10586,7 +10586,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;
@@ -13715,7 +13715,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)) ||
@@ -13785,12 +13785,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;
@@ -13798,7 +13798,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;
@@ -13806,7 +13806,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;
@@ -13816,17 +13816,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;
}
@@ -13911,10 +13915,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;
}
;
@@ -13925,7 +13935,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)) ||
@@ -15263,7 +15273,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)) ||