Skip to content
Permalink
Browse files
MDEV-28822 Table from older version requires table rebuild when addin…
…g column to table with multi-column index

This problem was earlier fixed in 10.4 by the patch for MDEV-29481.

Adding MTR tests only.
  • Loading branch information
abarkov committed Oct 26, 2022
1 parent 42802ad commit f90d9c3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Binary file not shown.
@@ -2929,3 +2929,14 @@ t1 CREATE TABLE `t1` (
KEY `f2` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
DROP TABLE t1, t2;
#
# MDEV-28822 Table from older version requires table rebuild when adding column to table with multi-column index
#
CREATE TABLE mdev28822_100427_innodb (
id int not null primary key,
msg varchar(10),
index(id, msg)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
FLUSH TABLES;
ALTER TABLE mdev28822_100427_innodb ADD i1 INTEGER, ALGORITHM=INSTANT;
DROP TABLE mdev28822_100427_innodb;
@@ -1,6 +1,8 @@
--source include/innodb_page_size.inc
--source include/have_sequence.inc

let $datadir=`select @@datadir`;

--echo #
--echo # MDEV-11369: Instant ADD COLUMN for InnoDB
--echo #
@@ -949,3 +951,19 @@ ALTER TABLE t1 DROP COLUMN f3, ADD FOREIGN KEY fk (f1)
ALTER TABLE t1 DROP COLUMN f5;
SHOW CREATE TABLE t1;
DROP TABLE t1, t2;


--echo #
--echo # MDEV-28822 Table from older version requires table rebuild when adding column to table with multi-column index
--echo #

CREATE TABLE mdev28822_100427_innodb (
id int not null primary key,
msg varchar(10),
index(id, msg)
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
FLUSH TABLES;
remove_file $datadir/test/mdev28822_100427_innodb.frm;
copy_file std_data/mysql_upgrade/mdev28822_100427_innodb.frm $datadir/test/mdev28822_100427_innodb.frm;
ALTER TABLE mdev28822_100427_innodb ADD i1 INTEGER, ALGORITHM=INSTANT;
DROP TABLE mdev28822_100427_innodb;

0 comments on commit f90d9c3

Please sign in to comment.