diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-04-24 13:40:36 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-04-24 13:40:36 +0300 |
commit | 864548c4ecf904aeccce32cf6f569520a923e95d (patch) | |
tree | 33774eca9e771bdd45d7b6fd4bded715f52d0666 | |
parent | fac2a7a85dab10ef6cc7628f635fe5a3736514a6 (diff) | |
download | mariadb-git-864548c4ecf904aeccce32cf6f569520a923e95d.tar.gz |
Add and adjust a test from MySQL:
commit 12343617922cfd9c48ee84ad6ecf53068d822010
Author: Thirunarayanan Balathandayuthapani <thirunarayanan.balathandayuth@oracle.com>
Date: Fri Jul 15 14:39:37 2016 +0530
Bug #23475211 COMBINING ALTER OPERATIONS TRIGGERS TABLE REBUILD
The code fix is already present.
3 files changed, 98 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-index-online-norebuild.result b/mysql-test/suite/innodb/r/innodb-index-online-norebuild.result new file mode 100644 index 00000000000..b9077643870 --- /dev/null +++ b/mysql-test/suite/innodb/r/innodb-index-online-norebuild.result @@ -0,0 +1,26 @@ +# INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION +# CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE) +# AND TABLE CHARSET(CHANGE CREATE) +CREATE TABLE t1( +id INT PRIMARY KEY, +f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB; +INSERT INTO t1 VALUES(1, 2); +SET SQL_MODE='STRICT_ALL_TABLES'; +ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0, +DEFAULT CHARSET=latin1, ALGORITHM=INPLACE; +DROP TABLE t1; +# CHANGE THE COMMENT OF COLUMN(INPLACE IGNORE) +# AND TABLE CHARSET(CHANGE CREATE) +CREATE TABLE t1(id INT COMMENT 'independence day')ENGINE=INNODB; +INSERT INTO t1 values(1); +ALTER TABLE t1 MODIFY COLUMN id INT COMMENT 'identifier', +DEFAULT CHARSET=latin1, ALGORITHM=INPLACE; +DROP TABLE t1; +# RENAME THE TABLE(INPLACE IGNORE) +# AND CHANGE TABLE CHARSET(CHANGE CREATE) +CREATE TABLE t1( +f1 INT NOT NULL, +f2 INT NOT NULL)ENGINE=INNODB; +INSERT INTO t1 VALUES(1, 2); +ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE; +DROP TABLE t2; diff --git a/mysql-test/suite/innodb/t/innodb-index-online-norebuild.opt b/mysql-test/suite/innodb/t/innodb-index-online-norebuild.opt new file mode 100644 index 00000000000..39b93371503 --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-index-online-norebuild.opt @@ -0,0 +1 @@ +--loose-innodb-sys-tables diff --git a/mysql-test/suite/innodb/t/innodb-index-online-norebuild.test b/mysql-test/suite/innodb/t/innodb-index-online-norebuild.test new file mode 100644 index 00000000000..518b4efe1df --- /dev/null +++ b/mysql-test/suite/innodb/t/innodb-index-online-norebuild.test @@ -0,0 +1,71 @@ +--source include/have_innodb.inc + +--echo # INPLACE ALTER WITH INPLACE_IGNORE FLAG AND CHANGE CREATE OPTION + +--echo # CHANGE THE COLUMN DEFAULT (INPLACE_IGNORE) +--echo # AND TABLE CHARSET(CHANGE CREATE) + +CREATE TABLE t1( + id INT PRIMARY KEY, + f1 INT NOT NULL DEFAULT 0)ENGINE=INNODB; + +INSERT INTO t1 VALUES(1, 2); + +let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`; + +# Allow the following operation to report errors. +SET SQL_MODE='STRICT_ALL_TABLES'; +ALTER TABLE t1 MODIFY COLUMN f1 INT NOT NULL DEFAULT 0, + DEFAULT CHARSET=latin1, ALGORITHM=INPLACE; + +let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`; + +if ($id_before_alter != $id_after_alter) +{ + --echo "Table rebuild happened"; +} + +DROP TABLE t1; + +--echo # CHANGE THE COMMENT OF COLUMN(INPLACE IGNORE) +--echo # AND TABLE CHARSET(CHANGE CREATE) + +CREATE TABLE t1(id INT COMMENT 'independence day')ENGINE=INNODB; + +INSERT INTO t1 values(1); + +let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`; + +ALTER TABLE t1 MODIFY COLUMN id INT COMMENT 'identifier', + DEFAULT CHARSET=latin1, ALGORITHM=INPLACE; + +let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`; + +if ($id_before_alter != $id_after_alter) +{ + --echo "Table rebuild happened"; +} + +DROP TABLE t1; + +--echo # RENAME THE TABLE(INPLACE IGNORE) +--echo # AND CHANGE TABLE CHARSET(CHANGE CREATE) + +CREATE TABLE t1( + f1 INT NOT NULL, + f2 INT NOT NULL)ENGINE=INNODB; + +INSERT INTO t1 VALUES(1, 2); + +let id_before_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t1"`; + +ALTER TABLE t1 RENAME t2, DEFAULT CHARSET=latin1, ALGORITHM=INPLACE; + +let id_after_alter =`SELECT table_id FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES WHERE name="test/t2"`; + +if ($id_before_alter != $id_after_alter) +{ + --echo "Table rebuild happened"; +} + +DROP TABLE t2; |