summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 6d3f9e540a7..efbbe28bcad 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -391,6 +391,7 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
DBUG_RETURN(TRUE);
if (thd->lex->handle_list_of_derived(table_list, DT_PREPARE))
DBUG_RETURN(TRUE);
+
if (setup_tables_and_check_access(thd,
&thd->lex->first_select_lex()->context,
&thd->lex->first_select_lex()->
@@ -647,10 +648,12 @@ int mysql_load(THD *thd, const sql_exchange *ex, TABLE_LIST *table_list,
thd->abort_on_warning= !ignore && thd->is_strict_mode();
- if ((table_list->table->file->ha_table_flags() & HA_DUPLICATE_POS) &&
- (error= table_list->table->file->ha_rnd_init_with_error(0)))
- goto err;
-
+ if ((table_list->table->file->ha_table_flags() & HA_DUPLICATE_POS))
+ {
+ if ((error= table_list->table->file->ha_rnd_init_with_error(0)))
+ goto err;
+ table->file->prepare_for_insert();
+ }
thd_progress_init(thd, 2);
if (table_list->table->validate_default_values_of_unset_fields(thd))
{