1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-19611 INPLACE ALTER does not fail on bad implicit default value

- Inplace alter shouldn't set default date column as '0000-00-00' when
table is not empty. So mysql_inplace_alter_table() copied
alter_ctx.error_if_not_empty to a new field of Alter_inplace_info.
In ha_innobase::check_if_supported_inplace_alter() should check the
error_if_not_empty flag and return INPLACE_NOT_SUPPORTED if the table
is not empty
This commit is contained in:
Thirunarayanan Balathandayuthapani
2020-04-25 13:49:40 +05:30
parent 3568fad5c9
commit c755974775
5 changed files with 108 additions and 4 deletions

View File

@ -9814,7 +9814,7 @@ do_continue:;
Alter_inplace_info ha_alter_info(create_info, alter_info,
key_info, key_count,
IF_PARTITIONING(thd->work_part_info, NULL),
ignore);
ignore, alter_ctx.error_if_not_empty);
TABLE *altered_table= NULL;
bool use_inplace= true;
@ -10261,7 +10261,7 @@ err_new_table_cleanup:
thd->abort_on_warning= true;
make_truncated_value_warning(thd, Sql_condition::WARN_LEVEL_WARN,
f_val, strlength(f_val), t_type,
new_table->s,
new_table ? new_table->s : table->s,
alter_ctx.datetime_field->field_name.str);
thd->abort_on_warning= save_abort_on_warning;
}