Skip to content

Commit f339ef3

Browse files
committed
MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2) during ADD COLUMN
prepare_inplace_alter_table_dict(): If the table will not be rebuilt, preserve all of the original ROW_FORMAT, including the compressed page size flags related to ROW_FORMAT=COMPRESSED.
1 parent a75ad73 commit f339ef3

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#
2+
# MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
3+
# during ADD COLUMN
4+
#
5+
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
6+
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB;
7+
FLUSH TABLES;
8+
ALTER TABLE t2 ADD COLUMN b INT;
9+
DROP TABLE t1,t2;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
--source include/have_innodb.inc
2+
--source include/innodb_row_format.inc
3+
4+
--echo #
5+
--echo # MDEV-26577 InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
6+
--echo # during ADD COLUMN
7+
--echo #
8+
9+
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
10+
CREATE TABLE t2(a INT PRIMARY KEY) ENGINE=InnoDB;
11+
FLUSH TABLES;
12+
--let $datadir=`select @@datadir`
13+
--remove_file $datadir/test/t2.frm
14+
--copy_file $datadir/test/t1.frm $datadir/test/t2.frm
15+
ALTER TABLE t2 ADD COLUMN b INT;
16+
DROP TABLE t1,t2;

storage/innobase/handler/handler0alter.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5012,8 +5012,10 @@ prepare_inplace_alter_table_dict(
50125012
/* If we promised ALGORITHM=NOCOPY or ALGORITHM=INSTANT,
50135013
we must retain the original ROW_FORMAT of the table. */
50145014
flags = (user_table->flags & (DICT_TF_MASK_COMPACT
5015+
| DICT_TF_MASK_ZIP_SSIZE
50155016
| DICT_TF_MASK_ATOMIC_BLOBS))
50165017
| (flags & ~(DICT_TF_MASK_COMPACT
5018+
| DICT_TF_MASK_ZIP_SSIZE
50175019
| DICT_TF_MASK_ATOMIC_BLOBS));
50185020
}
50195021

0 commit comments

Comments
 (0)