1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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().
This commit is contained in:
Thirunarayanan Balathandayuthapani
2021-07-01 16:14:09 +05:30
parent 7ce5984d6d
commit e34877ab63
4 changed files with 35 additions and 22 deletions

View File

@ -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))