summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-04-25 13:49:40 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2020-04-28 11:59:32 +0530
commitc755974775a7a7f4fc24abeacd2fc9ea7bf0c247 (patch)
treead6a94dce3fc396abca5f4a7dc50200b10aee34b /sql/handler.h
parent3568fad5c935426a275900e8130657b18ba14e9f (diff)
downloadmariadb-git-c755974775a7a7f4fc24abeacd2fc9ea7bf0c247.tar.gz
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
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 94c652359d2..656b376da8a 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -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()