diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 13:16:44 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-25 14:12:45 +0300 |
commit | ac97ad4eabc8da788b1239f4cc6ad2ff5cf11da0 (patch) | |
tree | 0533a9cf54d388b2895fdf416a559e3426d9eea1 | |
parent | 3ae219848322dea1e42b9ba25e3066bbc9aa217d (diff) | |
download | mariadb-git-ac97ad4eabc8da788b1239f4cc6ad2ff5cf11da0.tar.gz |
Bug#19811005: Add a simple test case
-rw-r--r-- | mysql-test/suite/innodb/r/innodb-index.result | 27 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/innodb-index.test | 20 |
2 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result index 52344e1e471..64c5586173e 100644 --- a/mysql-test/suite/innodb/r/innodb-index.result +++ b/mysql-test/suite/innodb/r/innodb-index.result @@ -1213,3 +1213,30 @@ test.t1 check status OK DROP TABLE t1; SET GLOBAL innodb_file_format=@save_format; SET GLOBAL innodb_large_prefix=@save_prefix; +# +# Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH +# IN I_S TABLES +# +CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1; +SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; +D I +1 0 +ALTER TABLE t1 ADD INDEX (a); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; +D I +1 1 +ALTER TABLE t1 ADD INDEX (b); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; +D I +1 2 +DROP TABLE t1; diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test index d28930de815..86ac1a8123e 100644 --- a/mysql-test/suite/innodb/t/innodb-index.test +++ b/mysql-test/suite/innodb/t/innodb-index.test @@ -593,3 +593,23 @@ CHECK TABLE t1; DROP TABLE t1; SET GLOBAL innodb_file_format=@save_format; SET GLOBAL innodb_large_prefix=@save_prefix; + +--echo # +--echo # Bug#19811005 ALTER TABLE ADD INDEX DOES NOT UPDATE INDEX_LENGTH +--echo # IN I_S TABLES +--echo # +let $i_s_query=SELECT cast(DATA_LENGTH/@@innodb_page_size as int) D, +cast(INDEX_LENGTH/@@innodb_page_size as int) I +FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='test'; + +CREATE TABLE t1(a INT, b INT) ENGINE=INNODB, STATS_PERSISTENT=1; +eval $i_s_query; +--enable_info +ALTER TABLE t1 ADD INDEX (a); +--disable_info +eval $i_s_query; +--enable_info +ALTER TABLE t1 ADD INDEX (b); +--disable_info +eval $i_s_query; +DROP TABLE t1; |