diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 18:07:14 +0000 |
commit | a175314c3e5827eb193872241446f2f8f5c9d33c (patch) | |
tree | cd3d60ca99ae00829c52a6ca79150a5b6e62528b /mysql-test/suite/innodb/t/innodb-index-online-norebuild.test | |
parent | Initial commit. (diff) | |
download | mariadb-10.5-upstream.tar.xz mariadb-10.5-upstream.zip |
Adding upstream version 1:10.5.12.upstream/1%10.5.12upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'mysql-test/suite/innodb/t/innodb-index-online-norebuild.test')
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-index-online-norebuild.test | 71 |
1 files changed, 71 insertions, 0 deletions
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 00000000..518b4efe --- /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; |