diff options
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index dfda896be69..5064fbcf70c 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7390,11 +7390,6 @@ static bool mysql_inplace_alter_table(THD *thd, bool reopen_tables= false; bool res; - /* - Set the truncated column values of thd as warning - for alter table. - */ - thd->count_cuted_fields = CHECK_FIELD_WARN; DBUG_ENTER("mysql_inplace_alter_table"); /* Downgrade DDL lock while we are waiting for exclusive lock below */ @@ -9684,9 +9679,16 @@ bool mysql_alter_table(THD *thd, const LEX_CSTRING *new_db, if (use_inplace) { table->s->frm_image= &frm; + enum_check_fields save_count_cuted_fields= thd->count_cuted_fields; + /* + Set the truncated column values of thd as warning + for alter table. + */ + thd->count_cuted_fields = CHECK_FIELD_WARN; int res= mysql_inplace_alter_table(thd, table_list, table, altered_table, &ha_alter_info, inplace_supported, &target_mdl_request, &alter_ctx); + thd->count_cuted_fields= save_count_cuted_fields; my_free(const_cast<uchar*>(frm.str)); if (res) |