Commit ac97ad4e authored by Marko Mäkelä's avatar Marko Mäkelä

Bug#19811005: Add a simple test case

parent 3ae21984
......@@ -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;
......@@ -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;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment