summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-04 15:16:27 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-04 15:16:27 +0200
commit91e4f00389483d22fa81517bbcdcd21499fd283a (patch)
treeb47c94d375c844dbbc3e47ad2d9f9de59f953479 /storage
parent19df45a705a48f5c8c21af0814cb5be7d816977b (diff)
downloadmariadb-git-91e4f00389483d22fa81517bbcdcd21499fd283a.tar.gz
MDEV-18732 InnoDB: ALTER IGNORE returns error for NULL
Only starting with MariaDB 10.3.8 (MDEV-16365), InnoDB can actually handle ALTER IGNORE TABLE correctly when introducing a NOT NULL attribute to a column that contains a NULL value. Between MariaDB Server 10.0 and 10.2, we would incorrectly return an error for ALTER IGNORE TABLE when the column contains a NULL value.
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/handler0alter.cc2
-rw-r--r--storage/xtradb/handler/handler0alter.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index b3d9faf0680..2bcec2ce51f 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -328,7 +328,7 @@ ha_innobase::check_if_supported_inplace_alter(
NULL to a NOT NULL value. */
if ((ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE)
- && !thd_is_strict_mode(user_thd)) {
+ && (ha_alter_info->ignore || !thd_is_strict_mode(user_thd))) {
ha_alter_info->unsupported_reason = innobase_get_err_msg(
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 43df8b04201..fa41c963464 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -332,7 +332,7 @@ ha_innobase::check_if_supported_inplace_alter(
NULL to a NOT NULL value. */
if ((ha_alter_info->handler_flags
& Alter_inplace_info::ALTER_COLUMN_NOT_NULLABLE)
- && !thd_is_strict_mode(user_thd)) {
+ && (ha_alter_info->ignore || !thd_is_strict_mode(user_thd))) {
ha_alter_info->unsupported_reason = innobase_get_err_msg(
ER_ALTER_OPERATION_NOT_SUPPORTED_REASON_NOT_NULL);
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);