diff options
author | Alexander Barkov <bar@mariadb.com> | 2022-10-04 11:44:14 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2022-10-26 09:34:28 +0400 |
commit | f90d9c347fdac35720f874070797559ede066598 (patch) | |
tree | 711b85fc4982d81f588d005663f89dfb47e7d76f /mysql-test | |
parent | 42802ad66c49b6de11b37c7ea4e4658ccc5a94aa (diff) | |
download | mariadb-git-f90d9c347fdac35720f874070797559ede066598.tar.gz |
MDEV-28822 Table from older version requires table rebuild when adding 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.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/std_data/mysql_upgrade/mdev28822_100427_innodb.frm | bin | 0 -> 1443 bytes | |||
-rw-r--r-- | mysql-test/suite/innodb/r/instant_alter.result | 11 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/instant_alter.test | 18 |
3 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/std_data/mysql_upgrade/mdev28822_100427_innodb.frm b/mysql-test/std_data/mysql_upgrade/mdev28822_100427_innodb.frm Binary files differnew file mode 100644 index 00000000000..d9cc5e6cc69 --- /dev/null +++ b/mysql-test/std_data/mysql_upgrade/mdev28822_100427_innodb.frm diff --git a/mysql-test/suite/innodb/r/instant_alter.result b/mysql-test/suite/innodb/r/instant_alter.result index 6744f0fe061..4a67e04205b 100644 --- a/mysql-test/suite/innodb/r/instant_alter.result +++ b/mysql-test/suite/innodb/r/instant_alter.result @@ -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; diff --git a/mysql-test/suite/innodb/t/instant_alter.test b/mysql-test/suite/innodb/t/instant_alter.test index 22815798f69..8e333e3bb72 100644 --- a/mysql-test/suite/innodb/t/instant_alter.test +++ b/mysql-test/suite/innodb/t/instant_alter.test @@ -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; |