diff options
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 1765e352b88..9e72278db8d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -10065,14 +10065,7 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, error= 1; break; } - if (to->next_number_field) - { - if (auto_increment_field_copied) - to->auto_increment_field_not_null= TRUE; - else - to->next_number_field->reset(); - } - + for (Copy_field *copy_ptr=copy ; copy_ptr != copy_end ; copy_ptr++) { copy_ptr->do_copy(copy_ptr); @@ -10091,6 +10084,13 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to, error= 1; break; } + if (to->next_number_field) + { + if (auto_increment_field_copied) + to->auto_increment_field_not_null= TRUE; + else + to->next_number_field->reset(); + } error=to->file->ha_write_row(to->record[0]); to->auto_increment_field_not_null= FALSE; if (error) |