summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 5064fbcf70c..666c6fb325a 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -10075,16 +10075,6 @@ end_temporary:
err_new_table_cleanup:
my_free(const_cast<uchar*>(frm.str));
- if (new_table)
- {
- thd->drop_temporary_table(new_table, NULL, true);
- }
- else
- (void) quick_rm_table(thd, new_db_type,
- &alter_ctx.new_db, &alter_ctx.tmp_name,
- (FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)),
- alter_ctx.get_tmp_path());
-
/*
No default value was provided for a DATE/DATETIME field, the
current sql_mode doesn't allow the '0000-00-00' value and
@@ -10114,11 +10104,22 @@ err_new_table_cleanup:
thd->abort_on_warning= true;
thd->push_warning_truncated_value_for_field(Sql_condition::WARN_LEVEL_WARN,
f_type, f_val,
+ new_table->s,
alter_ctx.datetime_field->
field_name.str);
thd->abort_on_warning= save_abort_on_warning;
}
+ if (new_table)
+ {
+ thd->drop_temporary_table(new_table, NULL, true);
+ }
+ else
+ (void) quick_rm_table(thd, new_db_type,
+ &alter_ctx.new_db, &alter_ctx.tmp_name,
+ (FN_IS_TMP | (no_ha_table ? NO_HA_TABLE : 0)),
+ alter_ctx.get_tmp_path());
+
DBUG_RETURN(true);
err_with_mdl_after_alter: