Commit 9a156e1a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-23345 Assertion not_redundant() == old.not_redundant()

In commit fd9ca2a7 (MDEV-23295)
we added a debug assertion, which caught a similar bug.

prepare_inplace_alter_table_dict(): If we had promised that
ALGORITHM=INPLACE or ALGORITHM=NOCOPY is supported, we must
preserve the ROW_FORMAT.
parent 57325e47
--- default_row_format_alter.result
+++ default_row_format_alter,compact.reject
@@ -91,6 +91,6 @@
@@ -91,7 +91,7 @@
ALTER TABLE t1 ADD b INT;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
-Dynamic
+Compact
DROP TABLE t1;
#
# MDEV-23345 Assertion not_redundant() == old.not_redundant() failed
@@ -102,6 +102,6 @@
ALTER TABLE t1 DROP b;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
-Dynamic
+Compact
DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
--- default_row_format_alter.result
+++ default_row_format_alter,compact.reject
@@ -91,6 +91,6 @@
+++ default_row_format_alter,redundant.reject
@@ -91,7 +91,7 @@
ALTER TABLE t1 ADD b INT;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
-Dynamic
+Redundant
DROP TABLE t1;
#
# MDEV-23345 Assertion not_redundant() == old.not_redundant() failed
@@ -102,6 +102,6 @@
ALTER TABLE t1 DROP b;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
-Dynamic
+Redundant
DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
......@@ -93,4 +93,15 @@ SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
Dynamic
DROP TABLE t1;
#
# MDEV-23345 Assertion not_redundant() == old.not_redundant() failed
#
SET GLOBAL innodb_default_row_format = @row_format;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, KEY(b)) ENGINE=InnoDB;
SET GLOBAL innodb_default_row_format= COMPACT;
ALTER TABLE t1 DROP b;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
ROW_FORMAT
Dynamic
DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
......@@ -106,4 +106,14 @@ ALTER TABLE t1 ADD b INT;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
DROP TABLE t1;
--echo #
--echo # MDEV-23345 Assertion not_redundant() == old.not_redundant() failed
--echo #
SET GLOBAL innodb_default_row_format = @row_format;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, KEY(b)) ENGINE=InnoDB;
SET GLOBAL innodb_default_row_format= COMPACT;
ALTER TABLE t1 DROP b;
SELECT ROW_FORMAT FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
DROP TABLE t1;
SET GLOBAL innodb_default_row_format = @row_format;
......@@ -6209,9 +6209,13 @@ prepare_inplace_alter_table_dict(
user_table = ctx->new_table;
if (ha_alter_info->inplace_supported == HA_ALTER_INPLACE_INSTANT) {
/* If we promised ALGORITHM=INSTANT capability, we must
retain the original ROW_FORMAT of the table. */
switch (ha_alter_info->inplace_supported) {
default: break;
case HA_ALTER_INPLACE_INSTANT:
case HA_ALTER_INPLACE_NOCOPY_LOCK:
case HA_ALTER_INPLACE_NOCOPY_NO_LOCK:
/* If we promised ALGORITHM=NOCOPY or ALGORITHM=INSTANT,
we must retain the original ROW_FORMAT of the table. */
flags = (user_table->flags & (DICT_TF_MASK_COMPACT
| DICT_TF_MASK_ATOMIC_BLOBS))
| (flags & ~(DICT_TF_MASK_COMPACT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment