1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +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

@ -2352,11 +2352,14 @@ public:
*/
const char *unsupported_reason;
/** true when InnoDB should abort the alter when table is not empty */
bool error_if_not_empty;
Alter_inplace_info(HA_CREATE_INFO *create_info_arg,
Alter_info *alter_info_arg,
KEY *key_info_arg, uint key_count_arg,
partition_info *modified_part_info_arg,
bool ignore_arg)
bool ignore_arg, bool error_non_empty)
: create_info(create_info_arg),
alter_info(alter_info_arg),
key_info_buffer(key_info_arg),
@ -2371,7 +2374,8 @@ public:
modified_part_info(modified_part_info_arg),
ignore(ignore_arg),
online(false),
unsupported_reason(NULL)
unsupported_reason(NULL),
error_if_not_empty(error_non_empty)
{}
~Alter_inplace_info()