From e34877ab63d127f6f8e536c82f5d65505e406a5e Mon Sep 17 00:00:00 2001 From: Thirunarayanan Balathandayuthapani Date: Thu, 1 Jul 2021 16:14:09 +0530 Subject: MDEV-25971 Instant ADD COLUMN fails to issue truncation warnings A table rebuild that would truncate the default value of a DATE column is expected to issue data truncation warnings. But, these warnings are not being issued if the ADD COLUMN is being executed with ALGORITHM=INSTANT. InnoDB sets the warning of the field while assigning the default value of the field during check_if_supported_inplace_alter(). --- sql/sql_table.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index c70639d71db..9aae74a613d 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -10015,9 +10015,12 @@ do_continue:; if (alter_info->requested_lock == Alter_info::ALTER_TABLE_LOCK_NONE) ha_alter_info.online= true; // Ask storage engine whether to use copy or in-place - ha_alter_info.inplace_supported= - table->file->check_if_supported_inplace_alter(altered_table, - &ha_alter_info); + { + Check_level_instant_set check_level_save(thd, CHECK_FIELD_WARN); + ha_alter_info.inplace_supported= + table->file->check_if_supported_inplace_alter(altered_table, + &ha_alter_info); + } if (alter_info->supports_algorithm(thd, &ha_alter_info) || alter_info->supports_lock(thd, &ha_alter_info)) -- cgit v1.2.1