summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2022-08-09 09:57:13 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2022-08-09 09:57:13 +0200
commit22d455612b0abbb4b9f527e61348d4c6336b59d5 (patch)
treed39436232e232c5a5beb996e86e2b34b05ab5115 /sql/sql_insert.cc
parentbfdc4ff22ecf626eb46479e1a0dc1049d61a8d78 (diff)
parent75d631f333544de4487a6dd251d6f361e1d55d6b (diff)
downloadmariadb-git-22d455612b0abbb4b9f527e61348d4c6336b59d5.tar.gz
Merge branch '10.8' into 10.9
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 283dd463fa8..56c52cc4ed0 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -768,7 +768,7 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
value_count= values->elements;
if ((res= mysql_prepare_insert(thd, table_list, fields, values,
- update_fields, update_values, duplic,
+ update_fields, update_values, duplic, ignore,
&unused_conds, FALSE)))
{
retval= thd->is_error();
@@ -839,7 +839,8 @@ bool mysql_insert(THD *thd, TABLE_LIST *table_list,
behaviour for non-transactional tables.
*/
if (values->elements &&
- table_list->table->check_assignability_opt_fields(fields, *values))
+ table_list->table->check_assignability_opt_fields(fields, *values,
+ ignore))
goto abort;
while ((values= its++))
@@ -1639,7 +1640,8 @@ static void prepare_for_positional_update(TABLE *table, TABLE_LIST *tables)
int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
List<Item> &fields, List_item *values,
List<Item> &update_fields, List<Item> &update_values,
- enum_duplicates duplic, COND **where,
+ enum_duplicates duplic, bool ignore,
+ COND **where,
bool select_insert)
{
SELECT_LEX *select_lex= thd->lex->first_select_lex();
@@ -1714,7 +1716,8 @@ int mysql_prepare_insert(THD *thd, TABLE_LIST *table_list,
ON DUPLICATE KEY UPDATE col=expr [, col=expr];
*/
TABLE::check_assignability_explicit_fields(update_fields,
- update_values);
+ update_values,
+ ignore);
select_lex->no_wrap_view_item= FALSE;
}
@@ -3815,7 +3818,7 @@ int mysql_insert_select_prepare(THD *thd, select_result *sel_res)
if ((res= mysql_prepare_insert(thd, lex->query_tables, lex->field_list, 0,
lex->update_list, lex->value_list,
- lex->duplicates,
+ lex->duplicates, lex->ignore,
&select_lex->where, TRUE)))
DBUG_RETURN(res);
@@ -3916,7 +3919,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
INSERT INTO t1 (col1, col2) VALUES (expr1, expr2);
INSERT INTO t1 SET col1=expr1, col2=expr2;
*/
- res= table_list->table->check_assignability_opt_fields(*fields, values);
+ res= table_list->table->check_assignability_opt_fields(*fields, values,
+ lex->ignore);
}
if (!res && fields->elements)
@@ -3979,7 +3983,8 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
ON DUPLICATE KEY UPDATE col=expr [, col=expr]
*/
TABLE::check_assignability_explicit_fields(*info.update_fields,
- *info.update_values);
+ *info.update_values,
+ lex->ignore);
if (!res)
{
/*
@@ -4499,7 +4504,7 @@ TABLE *select_create::create_table_from_items(THD *thd, List<Item> *items,
tmp_table.maybe_null= 0;
tmp_table.in_use= thd;
- if (!opt_explicit_defaults_for_timestamp)
+ if (!(thd->variables.option_bits & OPTION_EXPLICIT_DEF_TIMESTAMP))
promote_first_timestamp_column(&alter_info->create_list);
if (create_info->fix_create_fields(thd, alter_info, *create_table))