summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc2
-rw-r--r--sql/sql_insert.cc2
-rw-r--r--sql/sql_table.cc2
3 files changed, 6 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 470f59fe15f..291d8f92cb8 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -9146,6 +9146,8 @@ int ha_partition::extra(enum ha_extra_function operation)
case HA_EXTRA_END_ALTER_COPY:
case HA_EXTRA_FAKE_START_STMT:
DBUG_RETURN(loop_partitions(extra_cb, &operation));
+ case HA_EXTRA_IGNORE_INSERT:
+ DBUG_RETURN(loop_partitions(extra_cb, &operation));
default:
{
/* Temporary crash to discover what is wrong */
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index f26ee27df42..697ac87bd53 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -2114,6 +2114,8 @@ int write_record(THD *thd, TABLE *table, COPY_INFO *info, select_result *sink)
goto after_trg_or_ignored_err;
}
+ if (info->handle_duplicates == DUP_ERROR && info->ignore)
+ table->file->extra(HA_EXTRA_IGNORE_INSERT);
after_trg_n_copied_inc:
info->copied++;
thd->record_first_successful_insert_id_in_cur_stmt(table->file->insert_id_for_cur_row);
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 318c01bb1dc..f1f57471253 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -11499,6 +11499,8 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
}
else
{
+ if (ignore)
+ to->file->extra(HA_EXTRA_IGNORE_INSERT);
DEBUG_SYNC(thd, "copy_data_between_tables_before");
found_count++;
mysql_stage_set_work_completed(thd->m_stage_progress_psi, found_count);