diff options
Diffstat (limited to 'mysql-test/suite/innodb_zip/r')
30 files changed, 15905 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb_zip/r/16k,full_crc32.rdiff b/mysql-test/suite/innodb_zip/r/16k,full_crc32.rdiff new file mode 100644 index 00000000..5bb15da9 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/16k,full_crc32.rdiff @@ -0,0 +1,16 @@ +--- 16k.result ++++ 16k.reject +@@ -41,10 +41,10 @@ + test/t4 5 33 PRIMARY 3 3 1 50 + === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === + Space_Name Page_Size Zip_Size Formats_Permitted Path +-test/t1 DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd +-test/t2 DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd ++test/t1 DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t1.ibd ++test/t2 DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t2.ibd + test/t3 DEFAULT 8192 Compressed MYSQLD_DATADIR/test/t3.ibd +-test/t4 DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd ++test/t4 DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t4.ibd + DROP TABLE t1, t2, t3, t4; + # Test 4) The maximum row size is dependent upon the page size. + # Redundant: 8123, Compact: 8126. diff --git a/mysql-test/suite/innodb_zip/r/16k,strict_full_crc32.rdiff b/mysql-test/suite/innodb_zip/r/16k,strict_full_crc32.rdiff new file mode 100644 index 00000000..5bb15da9 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/16k,strict_full_crc32.rdiff @@ -0,0 +1,16 @@ +--- 16k.result ++++ 16k.reject +@@ -41,10 +41,10 @@ + test/t4 5 33 PRIMARY 3 3 1 50 + === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === + Space_Name Page_Size Zip_Size Formats_Permitted Path +-test/t1 DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd +-test/t2 DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd ++test/t1 DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t1.ibd ++test/t2 DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t2.ibd + test/t3 DEFAULT 8192 Compressed MYSQLD_DATADIR/test/t3.ibd +-test/t4 DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd ++test/t4 DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t4.ibd + DROP TABLE t1, t2, t3, t4; + # Test 4) The maximum row size is dependent upon the page size. + # Redundant: 8123, Compact: 8126. diff --git a/mysql-test/suite/innodb_zip/r/8k,full_crc32.rdiff b/mysql-test/suite/innodb_zip/r/8k,full_crc32.rdiff new file mode 100644 index 00000000..f0f414b3 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/8k,full_crc32.rdiff @@ -0,0 +1,16 @@ +--- 8k.result ++++ 8k.result +@@ -45,10 +45,10 @@ + test/t4 5 33 PRIMARY 3 3 1 50 + === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === + Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path +-test/t1 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd +-test/t2 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd ++test/t1 Single DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t1.ibd ++test/t2 Single DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t2.ibd + test/t3 Single DEFAULT 4096 Compressed MYSQLD_DATADIR/test/t3.ibd +-test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd ++test/t4 Single DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t4.ibd + DROP TABLE t1, t2, t3, t4; + # Test 4) The maximum row size is dependent upon the page size. + # Redundant: 4027, Compact: 4030. diff --git a/mysql-test/suite/innodb_zip/r/8k,strict_full_crc32.rdiff b/mysql-test/suite/innodb_zip/r/8k,strict_full_crc32.rdiff new file mode 100644 index 00000000..f0f414b3 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/8k,strict_full_crc32.rdiff @@ -0,0 +1,16 @@ +--- 8k.result ++++ 8k.result +@@ -45,10 +45,10 @@ + test/t4 5 33 PRIMARY 3 3 1 50 + === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === + Space_Name Space_Type Page_Size Zip_Size Formats_Permitted Path +-test/t1 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t1.ibd +-test/t2 Single DEFAULT DEFAULT Compact or Redundant MYSQLD_DATADIR/test/t2.ibd ++test/t1 Single DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t1.ibd ++test/t2 Single DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t2.ibd + test/t3 Single DEFAULT 4096 Compressed MYSQLD_DATADIR/test/t3.ibd +-test/t4 Single DEFAULT DEFAULT Dynamic MYSQLD_DATADIR/test/t4.ibd ++test/t4 Single DEFAULT DEFAULT NULL MYSQLD_DATADIR/test/t4.ibd + DROP TABLE t1, t2, t3, t4; + # Test 4) The maximum row size is dependent upon the page size. + # Redundant: 4027, Compact: 4030. diff --git a/mysql-test/suite/innodb_zip/r/blob.result b/mysql-test/suite/innodb_zip/r/blob.result new file mode 100644 index 00000000..df3a49ed --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/blob.result @@ -0,0 +1,18 @@ +# +# MDEV-21259 Assertion 'w != NORMAL || mach_read_from_4(ptr) != val' +# failed in mtr_t::write(), btr_free_externally_stored_field() +# +CREATE TABLE t1 (c TEXT, f2 INT PRIMARY KEY, f3 INT UNIQUE) +ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +SET @level= @@GLOBAL.innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +connect prevent_purge,localhost,root; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection default; +INSERT INTO t1 VALUES('a',1,0); +UPDATE t1 SET c= REPEAT('a b ',4096); +REPLACE INTO t1 SELECT * FROM t1; +disconnect prevent_purge; +InnoDB 0 transactions not purged +DROP TABLE t1; +SET GLOBAL innodb_compression_level = @level; diff --git a/mysql-test/suite/innodb_zip/r/bug36169.result b/mysql-test/suite/innodb_zip/r/bug36169.result new file mode 100644 index 00000000..7e165e0f --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/bug36169.result @@ -0,0 +1 @@ +SET GLOBAL innodb_file_per_table=ON; diff --git a/mysql-test/suite/innodb_zip/r/bug52745.result b/mysql-test/suite/innodb_zip/r/bug52745.result new file mode 100644 index 00000000..7fb48b8f --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/bug52745.result @@ -0,0 +1,85 @@ +CREATE TABLE bug52745 ( +a2 int(10) unsigned DEFAULT NULL, +col37 time DEFAULT NULL, +col38 char(229) CHARACTER SET utf8 DEFAULT NULL, +col39 text, +col40 timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, +col41 int(10) unsigned DEFAULT NULL, +col42 varchar(248) CHARACTER SET utf8 DEFAULT NULL, +col43 smallint(5) unsigned zerofill DEFAULT NULL, +col44 varchar(150) CHARACTER SET utf8 DEFAULT NULL, +col45 float unsigned zerofill DEFAULT NULL, +col46 binary(1) DEFAULT NULL, +col47 tinyint(4) DEFAULT NULL, +col48 tinyint(1) DEFAULT NULL, +col49 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +col50 binary(1) DEFAULT NULL, +col51 double unsigned zerofill DEFAULT NULL, +col52 int(10) unsigned DEFAULT NULL, +col53 time DEFAULT NULL, +col54 double unsigned DEFAULT NULL, +col55 time DEFAULT NULL, +col56 mediumtext CHARACTER SET latin2, +col57 blob, +col58 decimal(52,16) unsigned zerofill NOT NULL DEFAULT '000000000000000000000000000000000000.0000000000000000', +col59 binary(1) DEFAULT NULL, +col60 longblob, +col61 time DEFAULT NULL, +col62 longtext CHARACTER SET utf8 COLLATE utf8_persian_ci, +col63 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +col64 int(10) unsigned DEFAULT NULL, +col65 date DEFAULT NULL, +col66 timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', +col67 binary(1) DEFAULT NULL, +col68 tinyblob, +col69 date DEFAULT NULL, +col70 tinyint(3) unsigned zerofill DEFAULT NULL, +col71 varchar(44) CHARACTER SET utf8 DEFAULT NULL, +col72 datetime DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +SET sql_mode = default; +INSERT IGNORE INTO bug52745 SET +col40='0000-00-00 00:00:00', +col51=16547, +col53='7711484', +col54=-28604, +col55='7112612', +col56='wakefulness\'', +col57=repeat('absorbefacient\'',106), +col58=11027, +col59='AM09gW7', +col60=repeat('Noelani\'',16), +col61='2520576', +col62='substitutiv', +col63='19950106155112', +col64=-12038, +col65='86238806', +col66='19600719080256', +col68=repeat('Sagittarius\'',54), +col69='38943902', +col70=1232, +col71='Elora\''; +Warnings: +Warning 1265 Data truncated for column 'col53' at row 1 +Warning 1264 Out of range value for column 'col54' at row 1 +Warning 1265 Data truncated for column 'col59' at row 1 +Warning 1265 Data truncated for column 'col61' at row 1 +Warning 1264 Out of range value for column 'col64' at row 1 +Warning 1265 Data truncated for column 'col65' at row 1 +Warning 1264 Out of range value for column 'col66' at row 1 +Warning 1265 Data truncated for column 'col68' at row 1 +Warning 1265 Data truncated for column 'col69' at row 1 +Warning 1264 Out of range value for column 'col70' at row 1 +SHOW WARNINGS; +Level Code Message +Warning 1265 Data truncated for column 'col53' at row 1 +Warning 1264 Out of range value for column 'col54' at row 1 +Warning 1265 Data truncated for column 'col59' at row 1 +Warning 1265 Data truncated for column 'col61' at row 1 +Warning 1264 Out of range value for column 'col64' at row 1 +Warning 1265 Data truncated for column 'col65' at row 1 +Warning 1264 Out of range value for column 'col66' at row 1 +Warning 1265 Data truncated for column 'col68' at row 1 +Warning 1265 Data truncated for column 'col69' at row 1 +Warning 1264 Out of range value for column 'col70' at row 1 +DROP TABLE bug52745; diff --git a/mysql-test/suite/innodb_zip/r/bug53591.result b/mysql-test/suite/innodb_zip/r/bug53591.result new file mode 100644 index 00000000..779064d0 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/bug53591.result @@ -0,0 +1,16 @@ +call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is'); +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_strict_mode=on; +set old_alter_table=0; +Warnings: +Warning 1287 '@@old_alter_table' is deprecated and will be removed in a future release. Please use '@@alter_algorithm' instead +CREATE TABLE bug53591(a text charset utf8 not null) +ENGINE=InnoDB KEY_BLOCK_SIZE=1; +ALTER TABLE bug53591 ADD PRIMARY KEY(a(220)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +SHOW WARNINGS; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is {checked_valid}. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +DROP TABLE bug53591; +SET GLOBAL innodb_file_per_table=1; +SET GLOBAL innodb_strict_mode=DEFAULT; diff --git a/mysql-test/suite/innodb_zip/r/bug56680.result b/mysql-test/suite/innodb_zip/r/bug56680.result new file mode 100644 index 00000000..1a1a5b40 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/bug56680.result @@ -0,0 +1,124 @@ +SET GLOBAL tx_isolation='REPEATABLE-READ'; +SET GLOBAL innodb_file_per_table=on; +CREATE TABLE bug56680( +a INT AUTO_INCREMENT PRIMARY KEY, +b CHAR(1), +c INT, +INDEX(b)) +ENGINE=InnoDB STATS_PERSISTENT=0; +INSERT INTO bug56680 VALUES(0,'x',1); +BEGIN; +SELECT b FROM bug56680; +b +x +connect con1,localhost,root,,; +connection con1; +BEGIN; +UPDATE bug56680 SET b='X'; +connection default; +SELECT b FROM bug56680; +b +x +SELECT * FROM bug56680; +a b c +1 x 1 +connection con1; +ROLLBACK; +disconnect con1; +connection default; +SELECT b FROM bug56680; +b +x +SET GLOBAL tx_isolation='READ-UNCOMMITTED'; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +INSERT INTO bug56680 SELECT 0,b,c FROM bug56680; +BEGIN; +SELECT b FROM bug56680 LIMIT 2; +b +x +x +connect con1,localhost,root,,; +connection con1; +BEGIN; +DELETE FROM bug56680 WHERE a=1; +INSERT INTO bug56680 VALUES(1,'X',1); +SELECT b FROM bug56680 LIMIT 3; +b +X +x +x +connection default; +SELECT b FROM bug56680 LIMIT 2; +b +x +x +CHECK TABLE bug56680; +Table Op Msg_type Msg_text +test.bug56680 check status OK +connection con1; +ROLLBACK; +SELECT b FROM bug56680 LIMIT 2; +b +x +x +CHECK TABLE bug56680; +Table Op Msg_type Msg_text +test.bug56680 check status OK +connection default; +disconnect con1; +SELECT b FROM bug56680 LIMIT 2; +b +x +x +CREATE TABLE bug56680_2( +a INT AUTO_INCREMENT PRIMARY KEY, +b VARCHAR(2) CHARSET latin1 COLLATE latin1_german2_ci, +c INT, +INDEX(b)) +ENGINE=InnoDB STATS_PERSISTENT=0; +INSERT INTO bug56680_2 SELECT 0,_latin1 0xdf,c FROM bug56680; +BEGIN; +SELECT HEX(b) FROM bug56680_2 LIMIT 2; +HEX(b) +DF +DF +DELETE FROM bug56680_2 WHERE a=1; +INSERT INTO bug56680_2 VALUES(1,'SS',1); +SELECT HEX(b) FROM bug56680_2 LIMIT 3; +HEX(b) +5353 +DF +DF +CHECK TABLE bug56680_2; +Table Op Msg_type Msg_text +test.bug56680_2 check status OK +ALTER TABLE bug56680_2 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +SELECT HEX(b) FROM bug56680_2 LIMIT 2; +HEX(b) +5353 +DF +DELETE FROM bug56680_2 WHERE a=1; +INSERT INTO bug56680_2 VALUES(1,_latin1 0xdf,1); +SELECT HEX(b) FROM bug56680_2 LIMIT 3; +HEX(b) +DF +DF +DF +CHECK TABLE bug56680_2; +Table Op Msg_type Msg_text +test.bug56680_2 check status OK +# restart +CHECK TABLE bug56680_2; +Table Op Msg_type Msg_text +test.bug56680_2 check status OK +DROP TABLE bug56680_2; +DROP TABLE bug56680; diff --git a/mysql-test/suite/innodb_zip/r/cmp_drop_table.result b/mysql-test/suite/innodb_zip/r/cmp_drop_table.result new file mode 100644 index 00000000..e1f63268 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/cmp_drop_table.result @@ -0,0 +1,13 @@ +set global innodb_file_per_table=on; +create table t1(a text) engine=innodb key_block_size=4; +SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; +page_size +4096 +drop table t1; +SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; +page_size +4096 +create table t2(a text) engine=innodb; +SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0; +page_size +drop table t2; diff --git a/mysql-test/suite/innodb_zip/r/cmp_per_index.result b/mysql-test/suite/innodb_zip/r/cmp_per_index.result new file mode 100644 index 00000000..f26cc952 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/cmp_per_index.result @@ -0,0 +1,73 @@ +SET @save_enabled= @@GLOBAL.innodb_cmp_per_index_enabled; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SELECT * FROM information_schema.innodb_cmp_per_index; +CREATE TABLE t ( +a INT, +b VARCHAR(512), +c VARCHAR(16), +PRIMARY KEY (a), +INDEX (b(512)), +INDEX (c(16)) +) ENGINE=INNODB KEY_BLOCK_SIZE=2; +SELECT +database_name, +table_name, +index_name, +compress_ops, +compress_ops_ok, +uncompress_ops +FROM information_schema.innodb_cmp_per_index +ORDER BY 1, 2, 3; +database_name test +table_name t +index_name b +compress_ops 1 +compress_ops_ok 1 +uncompress_ops 0 +database_name test +table_name t +index_name c +compress_ops 1 +compress_ops_ok 1 +uncompress_ops 0 +database_name test +table_name t +index_name PRIMARY +compress_ops 1 +compress_ops_ok 1 +uncompress_ops 0 +BEGIN; +COMMIT; +ALTER TABLE t DROP INDEX c; +GRANT USAGE ON *.* TO 'tuser01'@'localhost' IDENTIFIED BY 'cDJvI9s_Uq'; +FLUSH PRIVILEGES; +connect con1,localhost,tuser01,cDJvI9s_Uq,; +connection con1; +SELECT * FROM information_schema.innodb_cmp_per_index; +ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation +connection default; +disconnect con1; +DROP USER 'tuser01'@'localhost'; +SELECT +database_name, +table_name, +index_name, +compress_ops, +compress_ops_ok, +uncompress_ops +FROM information_schema.innodb_cmp_per_index +ORDER BY 1, 2, 3; +database_name test +table_name t +index_name b +compress_ops 52 +compress_ops_ok 52 +uncompress_ops 0 +database_name test +table_name t +index_name PRIMARY +compress_ops 64 +compress_ops_ok 64 +uncompress_ops 0 +DROP TABLE t; +SET GLOBAL innodb_cmp_per_index_enabled=@save_enabled; diff --git a/mysql-test/suite/innodb_zip/r/create_options.result b/mysql-test/suite/innodb_zip/r/create_options.result new file mode 100644 index 00000000..a678d7a8 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/create_options.result @@ -0,0 +1,760 @@ +SET default_storage_engine=InnoDB; +SET GLOBAL innodb_file_per_table=ON; +SET SESSION innodb_strict_mode = ON; +# Test 1) StrictMode=ON, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 +# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified' +# 'FIXED' is sent to InnoDB since it is used by MyISAM. +# But it is an invalid mode in InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: invalid ROW_FORMAT specifier. +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED +ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic +ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: invalid ROW_FORMAT specifier. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic +# Test 2) StrictMode=ON, CREATE with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE +# KEY_BLOCK_SIZE is incompatible with COMPACT, REDUNDANT, & DYNAMIC +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +# Test 3) StrictMode=ON, ALTER with each ROW_FORMAT & a valid non-zero KEY_BLOCK_SIZE +DROP TABLE t1; +CREATE TABLE t1 ( i INT ); +ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: invalid ROW_FORMAT specifier. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_TYPE' +ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +# Test 4) StrictMode=ON, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid non-zero KEY_BLOCK_SIZE +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +ALTER TABLE t1 KEY_BLOCK_SIZE=2; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT +ALTER TABLE t1 KEY_BLOCK_SIZE=4; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +ALTER TABLE t1 KEY_BLOCK_SIZE=2; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=COMPRESSED; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED +ALTER TABLE t1 KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +# Test 5) StrictMode=ON, CREATE with a valid KEY_BLOCK_SIZE +# ALTER with each ROW_FORMAT +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=2; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=2 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + `f1` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=2 +ALTER TABLE t1 ROW_FORMAT=COMPACT; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=COMPRESSED; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic +ALTER TABLE t1 ROW_FORMAT=COMPACT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +# Test 6) StrictMode=ON, CREATE with an invalid KEY_BLOCK_SIZE. +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=9; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +# Test 7) StrictMode=ON, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and +# and a valid non-zero KEY_BLOCK_SIZE +# can be set to default values during strict mode. +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + `f1` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +ALTER TABLE t1 ADD COLUMN f2 INT; +SHOW WARNINGS; +Level Code Message +# Test 8) StrictMode=ON, Make sure ROW_FORMAT=COMPRESSED +# and a valid non-zero KEY_BLOCK_SIZE are rejected with +# innodb_file_per_table=OFF and that they can be set to default +# values during strict mode. +SET GLOBAL innodb_file_per_table=OFF; +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED; +Got one of the listed errors +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. +Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT; +SHOW WARNINGS; +Level Code Message +ALTER TABLE t1 KEY_BLOCK_SIZE=1; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'KEY_BLOCK_SIZE' +ALTER TABLE t1 ROW_FORMAT=COMPRESSED; +ERROR HY000: Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. +Error 1478 Table storage engine 'InnoDB' does not support the create option 'ROW_FORMAT' +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +SHOW WARNINGS; +Level Code Message +ALTER TABLE t1 ROW_FORMAT=COMPACT; +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT +ALTER TABLE t1 ROW_FORMAT=DEFAULT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic +SET GLOBAL innodb_file_per_table=ON; +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +SET GLOBAL innodb_file_per_table=OFF; +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +ALTER TABLE t1 ADD COLUMN f2 INT; +SHOW WARNINGS; +Level Code Message +SET GLOBAL innodb_file_per_table=ON; +################################################## +SET SESSION innodb_strict_mode = OFF; +# Test 9) StrictMode=OFF, CREATE and ALTER with each ROW_FORMAT & KEY_BLOCK_SIZE=0 +# KEY_BLOCK_SIZE=0 means 'no KEY_BLOCK_SIZE is specified' +# 'FIXED' is sent to InnoDB since it is used by MyISAM. +# It is an invalid mode in InnoDB, use COMPACT +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=FIXED; +Warnings: +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=FIXED +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED +ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic +ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=0; +Warnings: +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=FIXED +# Test 10) StrictMode=OFF, CREATE with each ROW_FORMAT & a valid KEY_BLOCK_SIZE +# KEY_BLOCK_SIZE is ignored with COMPACT, REDUNDANT, & DYNAMIC +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=1; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT key_block_size=1 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT key_block_size=2 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC key_block_size=4 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +# Test 11) StrictMode=OFF, ALTER with each ROW_FORMAT & a valid KEY_BLOCK_SIZE +DROP TABLE t1; +CREATE TABLE t1 ( i INT ); +ALTER TABLE t1 ROW_FORMAT=FIXED KEY_BLOCK_SIZE=1; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=FIXED key_block_size=1 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ); +ALTER TABLE t1 ROW_FORMAT=COMPACT KEY_BLOCK_SIZE=2; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT key_block_size=2 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ); +ALTER TABLE t1 ROW_FORMAT=DYNAMIC KEY_BLOCK_SIZE=4; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC key_block_size=4 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ); +ALTER TABLE t1 ROW_FORMAT=REDUNDANT KEY_BLOCK_SIZE=2; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT key_block_size=2 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ); +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=1 +ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +# Test 12) StrictMode=OFF, CREATE with ROW_FORMAT=COMPACT, ALTER with a valid KEY_BLOCK_SIZE +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +ALTER TABLE t1 KEY_BLOCK_SIZE=2; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT key_block_size=2 +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT key_block_size=2 +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=2 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC key_block_size=2 +ALTER TABLE t1 ROW_FORMAT=COMPRESSED; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +ALTER TABLE t1 KEY_BLOCK_SIZE=4; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=4 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPACT; +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=2; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed key_block_size=2 +# Test 13) StrictMode=OFF, CREATE with a valid KEY_BLOCK_SIZE +# ALTER with each ROW_FORMAT +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=1 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `i` int(11) DEFAULT NULL, + `f1` int(11) DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=1 +ALTER TABLE t1 ROW_FORMAT=COMPACT; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT key_block_size=1 +ALTER TABLE t1 ROW_FORMAT=REDUNDANT; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Redundant row_format=REDUNDANT key_block_size=1 +ALTER TABLE t1 ROW_FORMAT=DYNAMIC; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC key_block_size=1 +ALTER TABLE t1 ROW_FORMAT=COMPRESSED; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +ALTER TABLE t1 ROW_FORMAT=DEFAULT KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic +ALTER TABLE t1 ROW_FORMAT=COMPACT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compact row_format=COMPACT +# Test 14) StrictMode=OFF, CREATE with an invalid KEY_BLOCK_SIZE, +# it defaults to half of the page size. +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) KEY_BLOCK_SIZE=15; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15. +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=15. +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic key_block_size=15 +# Test 15) StrictMode=OFF. +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +ALTER TABLE t1 ADD COLUMN f2 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=1 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +ALTER TABLE t1 ADD COLUMN f2 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +# Test 16) StrictMode=OFF, Make sure ROW_FORMAT= COMPRESSED & DYNAMIC and a +valid KEY_BLOCK_SIZE are remembered but not used when innodb_file_per_table=OFF +and then used again when innodb_file_per_table=ON. +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +SET GLOBAL innodb_file_per_table=OFF; +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +SET GLOBAL innodb_file_per_table=ON; +ALTER TABLE t1 ADD COLUMN f2 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Compressed row_format=COMPRESSED key_block_size=2 +DROP TABLE t1; +CREATE TABLE t1 ( i INT ) ROW_FORMAT=DYNAMIC; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +SET GLOBAL innodb_file_per_table=OFF; +ALTER TABLE t1 ADD COLUMN f1 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +SET GLOBAL innodb_file_per_table=ON; +ALTER TABLE t1 ADD COLUMN f2 INT; +SHOW WARNINGS; +Level Code Message +SELECT TABLE_NAME,ROW_FORMAT,CREATE_OPTIONS FROM information_schema.tables WHERE TABLE_NAME = 't1'; +TABLE_NAME ROW_FORMAT CREATE_OPTIONS +t1 Dynamic row_format=DYNAMIC +# Cleanup +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix.result b/mysql-test/suite/innodb_zip/r/index_large_prefix.result new file mode 100644 index 00000000..ce302327 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/index_large_prefix.result @@ -0,0 +1,452 @@ +SET default_storage_engine=InnoDB; +set global innodb_file_per_table=1; +### Test 1 ### +create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC; +show warnings; +Level Code Message +insert into worklog5743 values(repeat("a", 20000)); +update worklog5743 set a = (repeat("b", 16000)); +create index idx on worklog5743(a(2000)); +show warnings; +Level Code Message +begin; +update worklog5743 set a = (repeat("x", 17000)); +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +connect con1,localhost,root,,; +select a = repeat("x", 17000) from worklog5743; +a = repeat("x", 17000) +0 +select a = repeat("b", 16000) from worklog5743; +a = repeat("b", 16000) +1 +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a = repeat("x", 17000) from worklog5743; +a = repeat("x", 17000) +1 +connection default; +rollback; +drop table worklog5743; +### Test 2 ### +create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; +show warnings; +Level Code Message +create index idx on worklog5743(a1, a2(2000)); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 10000)); +begin; +update worklog5743 set a1 = 1000; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx idx 5 const 1 +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +9 1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +connection default; +rollback; +drop table worklog5743; +### Test 3 ### +create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; +create index idx on worklog5743(a1, a2(50)); +insert into worklog5743 values(9, repeat("a", 10000)); +begin; +update worklog5743 set a1 = 1000; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx idx 5 const 1 +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +9 1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +connection default; +rollback; +drop table worklog5743; +### Test 4 ### +create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; +create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; +create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; +create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; +create table worklog5743_16(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=16; +create index idx2 on worklog5743_1(a2(4000)); +Got one of the listed errors +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx3 on worklog5743_1(a2(436)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx4 on worklog5743_1(a2(290)); +show warnings; +Level Code Message +create index idx5 on worklog5743_1(a1, a2(430)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx6 on worklog5743_1(a1, a2(283)); +show warnings; +Level Code Message +create index idx2 on worklog5743_2(a2(4000)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx3 on worklog5743_2(a2(948)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx4 on worklog5743_2(a2(802)); +show warnings; +Level Code Message +create index idx5 on worklog5743_2(a1, a2(942)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx6 on worklog5743_2(a1, a2(795)); +show warnings; +Level Code Message +create index idx2 on worklog5743_4(a2(4000)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx3 on worklog5743_4(a2(1972)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx4 on worklog5743_4(a2(1826)); +show warnings; +Level Code Message +create index idx5 on worklog5743_4(a1, a2(1966)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx6 on worklog5743_4(a1, a2(1819)); +show warnings; +Level Code Message +create index idx2 on worklog5743_8(a2(3073)); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +create index idx3 on worklog5743_8(a2(3072)); +Warnings: +Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release +show warnings; +Level Code Message +Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release +create index idx4 on worklog5743_8(a1, a2(3069)); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 3072 bytes +create index idx5 on worklog5743_8(a1, a2(3068)); +show warnings; +Level Code Message +create index idx6 on worklog5743_8(a1, a2(2000), a3(1069)); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 3072 bytes +create index idx7 on worklog5743_8(a1, a2(2000), a3(1068)); +show warnings; +Level Code Message +create index idx2 on worklog5743_16(a2(3073)); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +create index idx3 on worklog5743_16(a2(3072)); +Warnings: +Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release +show warnings; +Level Code Message +Note 1831 Duplicate index `idx3`. This is deprecated and will be disallowed in a future release +create index idx4 on worklog5743_16(a1, a2(3069)); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 3072 bytes +create index idx5 on worklog5743_16(a1, a2(3068)); +show warnings; +Level Code Message +create index idx6 on worklog5743_16(a1, a2(2000), a3(1069)); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 3072 bytes +create index idx7 on worklog5743_16(a1, a2(2000), a3(1068)); +show warnings; +Level Code Message +set sql_mode= default; +insert into worklog5743_1 values(9, repeat("a", 10000)); +insert into worklog5743_2 values(9, repeat("a", 10000)); +insert into worklog5743_4 values(9, repeat("a", 10000)); +insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000)); +insert into worklog5743_16 values(9, repeat("a", 10000), repeat("a", 10000)); +select a1, left(a2, 20) from worklog5743_1; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_8; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_16; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +begin; +update worklog5743_1 set a1 = 1000; +update worklog5743_2 set a1 = 1000; +update worklog5743_4 set a1 = 1000; +update worklog5743_8 set a1 = 1000; +update worklog5743_16 set a1 = 1000; +select a1, left(a2, 20) from worklog5743_1; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_8; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_16; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_1 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_2 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_4 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_8 ref idx5,idx7 idx5 5 const 1 +explain select a1, left(a2, 20) from worklog5743_16 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_16 ref idx5,idx7 idx5 5 const 1 +select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_8 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_16 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_8 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_16 where a1 = 9; +a1 left(a2, 20) +connection default; +rollback; +drop table worklog5743_1; +drop table worklog5743_2; +drop table worklog5743_4; +drop table worklog5743_8; +drop table worklog5743_16; +### Test 5 ### +create table worklog5743(a1 int, +a2 varchar(20000), +a3 varchar(3073), +a4 varchar(3072), +a5 varchar(3069), +a6 varchar(3068)) +ROW_FORMAT=DYNAMIC; +SET sql_mode=''; +create index idx1 on worklog5743(a2); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +create index idx2 on worklog5743(a3); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +create index idx3 on worklog5743(a4); +show warnings; +Level Code Message +SET sql_mode= default; +create index idx4 on worklog5743(a1, a2); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +Error 1071 Specified key was too long; max key length is 3072 bytes +create index idx5 on worklog5743(a1, a5); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 3072 bytes +create index idx6 on worklog5743(a1, a6); +show warnings; +Level Code Message +show create table worklog5743; +Table Create Table +worklog5743 CREATE TABLE `worklog5743` ( + `a1` int(11) DEFAULT NULL, + `a2` varchar(20000) DEFAULT NULL, + `a3` varchar(3073) DEFAULT NULL, + `a4` varchar(3072) DEFAULT NULL, + `a5` varchar(3069) DEFAULT NULL, + `a6` varchar(3068) DEFAULT NULL, + KEY `idx1` (`a2`(3072)), + KEY `idx2` (`a3`(3072)), + KEY `idx3` (`a4`), + KEY `idx6` (`a1`,`a6`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +insert into worklog5743 values(9, +repeat("a", 20000), repeat("a", 3073), +repeat("a", 3072), repeat("a", 3069), +repeat("a", 3068)); +begin; +update worklog5743 set a1 = 1000; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1 from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx6 idx6 5 const 1 Using index +select a1 from worklog5743 where a1 = 9; +a1 +9 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1 from worklog5743 where a1 = 9; +a1 +connection default; +rollback; +drop table worklog5743; +### Test 6 ### +create table worklog5743(a TEXT not null, primary key (a(1000))) +row_format=compact; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table worklog5743(a TEXT) +row_format=compact; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx on worklog5743(a(767)); +insert into worklog5743 values(repeat("a", 20000)); +begin; +insert into worklog5743 values(repeat("b", 20000)); +update worklog5743 set a = (repeat("x", 25000)); +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +connection con1; +select a = repeat("a", 20000) from worklog5743; +a = repeat("a", 20000) +1 +disconnect con1; +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a = repeat("x", 25000) from worklog5743; +a = repeat("x", 25000) +1 +1 +disconnect con2; +connection default; +rollback; +drop table worklog5743; +### Test 7 ### +create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC; +SET sql_mode=''; +create index idx1 on worklog5743(a(3073)); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +create index idx2 on worklog5743(a(3072)); +Warnings: +Note 1831 Duplicate index `idx2`. This is deprecated and will be disallowed in a future release +show create table worklog5743; +Table Create Table +worklog5743 CREATE TABLE `worklog5743` ( + `a` text NOT NULL, + KEY `idx1` (`a`(3072)), + KEY `idx2` (`a`(3072)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +drop table worklog5743; +SET sql_mode= default; +create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx2 on worklog5743(a(767)); +drop table worklog5743; +create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx2 on worklog5743(a(767)); +drop table worklog5743; +SET GLOBAL innodb_file_per_table=1; diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result new file mode 100644 index 00000000..9d4db6a2 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_4k.result @@ -0,0 +1,356 @@ +SET default_storage_engine=InnoDB; +set global innodb_file_per_table=1; +### Test 1 ### +create table worklog5743(a TEXT not null, primary key (a(768))) ROW_FORMAT=DYNAMIC; +show warnings; +Level Code Message +insert into worklog5743 values(repeat("a", 20000)); +update worklog5743 set a = (repeat("b", 16000)); +SET sql_mode= ''; +create index idx on worklog5743(a(900)); +show warnings; +Level Code Message +SET sql_mode= default; +begin; +update worklog5743 set a = (repeat("x", 17000)); +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +connect con1,localhost,root,,; +select a = repeat("x", 17000) from worklog5743; +a = repeat("x", 17000) +0 +select a = repeat("b", 16000) from worklog5743; +a = repeat("b", 16000) +1 +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a = repeat("x", 17000) from worklog5743; +a = repeat("x", 17000) +1 +connection default; +rollback; +drop table worklog5743; +### Test 2 ### +create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; +show warnings; +Level Code Message +create index idx on worklog5743(a1, a2(750)); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 10000)); +begin; +update worklog5743 set a1 = 1111; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx idx 5 const 1 +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +9 1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +connection default; +rollback; +drop table worklog5743; +### Test 3 ### +create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; +create index idx on worklog5743(a1, a2(50)); +insert into worklog5743 values(9, repeat("a", 10000)); +begin; +update worklog5743 set a1 = 2222; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx idx 5 const 1 +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +9 1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +connection default; +rollback; +drop table worklog5743; +### Test 4 ### +create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; +create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; +create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; +create index idx1 on worklog5743_1(a2(4000)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1173 bytes +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx3 on worklog5743_1(a2(436)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx4 on worklog5743_1(a2(290)); +show warnings; +Level Code Message +create index idx5 on worklog5743_1(a1, a2(430)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 1982. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx6 on worklog5743_1(a1, a2(283)); +show warnings; +Level Code Message +SET sql_mode= ''; +set innodb_strict_mode=off; +create index idx1 on worklog5743_2(a2(4000)); +Warnings: +Note 1071 Specified key was too long; max key length is 1173 bytes +Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +set innodb_strict_mode=on; +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1173 bytes +Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +show create table worklog5743_2; +Table Create Table +worklog5743_2 CREATE TABLE `worklog5743_2` ( + `a1` int(11) DEFAULT NULL, + `a2` text NOT NULL, + KEY `idx1` (`a2`(1173)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=2 +drop index idx1 on worklog5743_2; +create index idx3 on worklog5743_2(a2(769)); +show warnings; +Level Code Message +create index idx4 on worklog5743_2(a2(768)); +show warnings; +Level Code Message +create index idx6 on worklog5743_2(a1, a2(768)); +show warnings; +Level Code Message +set innodb_strict_mode=off; +create index idx1 on worklog5743_4(a2(4000)); +Warnings: +Note 1071 Specified key was too long; max key length is 1173 bytes +set innodb_strict_mode=on; +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1173 bytes +show create table worklog5743_4; +Table Create Table +worklog5743_4 CREATE TABLE `worklog5743_4` ( + `a1` int(11) DEFAULT NULL, + `a2` text NOT NULL, + KEY `idx1` (`a2`(1173)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci KEY_BLOCK_SIZE=4 +create index idx3 on worklog5743_4(a2(769)); +show warnings; +Level Code Message +create index idx4 on worklog5743_4(a2(768)); +show warnings; +Level Code Message +create index idx6 on worklog5743_4(a1, a2(764)); +show warnings; +Level Code Message +SET sql_mode= default; +insert into worklog5743_1 values(9, repeat("a", 10000)); +insert into worklog5743_2 values(9, repeat("a", 10000)); +insert into worklog5743_4 values(9, repeat("a", 10000)); +select a1, left(a2, 20) from worklog5743_1; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +begin; +update worklog5743_1 set a1 = 1000; +update worklog5743_2 set a1 = 1000; +update worklog5743_4 set a1 = 1000; +select a1, left(a2, 20) from worklog5743_1; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_1 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_2 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_4 ref idx6 idx6 5 const 1 +select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +a1 left(a2, 20) +connection default; +rollback; +drop table worklog5743_1; +drop table worklog5743_2; +drop table worklog5743_4; +### Test 5 ### +create table worklog5743(a1 int, a2 varchar(20000)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +ERROR 42000: Specified key was too long; max key length is 1173 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 3072 bytes +Error 1071 Specified key was too long; max key length is 1173 bytes +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(3072)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +ERROR 42000: Specified key was too long; max key length is 1173 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 1173 bytes +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(769)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +show warnings; +Level Code Message +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(768)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 768)); +update worklog5743 set a1 = 3333; +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(765)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a1, a2); +show warnings; +Level Code Message +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(764)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a1, a2); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 764)); +begin; +update worklog5743 set a1 = 4444; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1 from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx1 idx1 5 const 1 Using index +select a1 from worklog5743 where a1 = 9; +a1 +9 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1 from worklog5743 where a1 = 9; +a1 +connection default; +rollback; +drop table worklog5743; +### Test 6 ### +create table worklog5743(a TEXT not null, primary key (a(1000))); +drop table worklog5743; +create table worklog5743(a TEXT) ROW_FORMAT=COMPACT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx on worklog5743(a(767)); +insert into worklog5743 values(repeat("a", 20000)); +begin; +insert into worklog5743 values(repeat("b", 20000)); +update worklog5743 set a = (repeat("x", 25000)); +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +connection con1; +select a = repeat("a", 20000) from worklog5743; +a = repeat("a", 20000) +1 +disconnect con1; +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a = repeat("x", 25000) from worklog5743; +a = repeat("x", 25000) +1 +1 +disconnect con2; +connection default; +rollback; +drop table worklog5743; +### Test 7 ### +create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC; +SET sql_mode= ''; +create index idx1 on worklog5743(a(769)); +show warnings; +Level Code Message +SET sql_mode= default; +create index idx2 on worklog5743(a(768)); +show warnings; +Level Code Message +show create table worklog5743; +Table Create Table +worklog5743 CREATE TABLE `worklog5743` ( + `a` text NOT NULL, + KEY `idx1` (`a`(769)), + KEY `idx2` (`a`(768)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +insert into worklog5743 values(repeat("a", 768)); +drop table worklog5743; +create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx2 on worklog5743(a(767)); +drop table worklog5743; +create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx2 on worklog5743(a(767)); +drop table worklog5743; +SET GLOBAL innodb_file_per_table=1; diff --git a/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result new file mode 100644 index 00000000..925bd3f8 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/index_large_prefix_8k.result @@ -0,0 +1,377 @@ +SET default_storage_engine=InnoDB; +set global innodb_file_per_table=1; +### Test 1 ### +create table worklog5743(a TEXT not null, primary key (a(1000))) ROW_FORMAT=DYNAMIC; +show warnings; +Level Code Message +insert into worklog5743 values(repeat("a", 20000)); +update worklog5743 set a = (repeat("b", 16000)); +SET sql_mode= ''; +create index idx on worklog5743(a(2000)); +Warnings: +Note 1071 Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1536 bytes +SET sql_mode= default; +begin; +update worklog5743 set a = (repeat("x", 17000)); +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +connect con1,localhost,root,,; +select a = repeat("x", 17000) from worklog5743; +a = repeat("x", 17000) +0 +select a = repeat("b", 16000) from worklog5743; +a = repeat("b", 16000) +1 +connect con2,localhost,root,,; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a = repeat("x", 17000) from worklog5743; +a = repeat("x", 17000) +1 +connection default; +rollback; +drop table worklog5743; +### Test 2 ### +create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; +show warnings; +Level Code Message +create index idx on worklog5743(a1, a2(1250)); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 10000)); +begin; +update worklog5743 set a1 = 1000; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx idx 5 const 1 +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +9 1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +connection default; +rollback; +drop table worklog5743; +### Test 3 ### +create table worklog5743(a1 int, a2 TEXT not null) ROW_FORMAT=DYNAMIC; +create index idx on worklog5743(a1, a2(50)); +insert into worklog5743 values(9, repeat("a", 10000)); +begin; +update worklog5743 set a1 = 1000; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx idx 5 const 1 +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +9 1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9; +a1 a2 = repeat("a", 10000) +connection default; +rollback; +drop table worklog5743; +### Test 4 ### +create table worklog5743_1(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=1; +create table worklog5743_2(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=2; +create table worklog5743_4(a1 int, a2 TEXT not null) KEY_BLOCK_SIZE=4; +create table worklog5743_8(a1 int, a2 TEXT, a3 TEXT) KEY_BLOCK_SIZE=8; +create index idx2 on worklog5743_1(a2(4000)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1536 bytes +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx3 on worklog5743_1(a2(436)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx4 on worklog5743_1(a2(290)); +show warnings; +Level Code Message +create index idx5 on worklog5743_1(a1, a2(430)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx6 on worklog5743_1(a1, a2(283)); +show warnings; +Level Code Message +create index idx2 on worklog5743_2(a2(4000)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1536 bytes +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx3 on worklog5743_2(a2(948)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx4 on worklog5743_2(a2(802)); +show warnings; +Level Code Message +create index idx5 on worklog5743_2(a1, a2(942)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +show warnings; +Level Code Message +Error 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 4030. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +create index idx6 on worklog5743_2(a1, a2(795)); +show warnings; +Level Code Message +create index idx3 on worklog5743_4(a2(1537)); +Warnings: +Note 1071 Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1536 bytes +create index idx4 on worklog5743_4(a2(1536)); +Warnings: +Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release +show warnings; +Level Code Message +Note 1831 Duplicate index `idx4`. This is deprecated and will be disallowed in a future release +create index idx5 on worklog5743_4(a1, a2(1533)); +ERROR 42000: Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 1536 bytes +create index idx6 on worklog5743_4(a1, a2(1532)); +show warnings; +Level Code Message +create index idx2 on worklog5743_8(a2(3073)); +Warnings: +Note 1071 Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1536 bytes +create index idx3 on worklog5743_8(a2(3072)); +Warnings: +Note 1071 Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Note 1071 Specified key was too long; max key length is 1536 bytes +create index idx4 on worklog5743_8(a1, a2(1533)); +ERROR 42000: Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 1536 bytes +create index idx5 on worklog5743_8(a1, a2(1532)); +show warnings; +Level Code Message +SET sql_mode= default; +insert into worklog5743_1 values(9, repeat("a", 10000)); +insert into worklog5743_2 values(9, repeat("a", 10000)); +insert into worklog5743_4 values(9, repeat("a", 10000)); +insert into worklog5743_8 values(9, repeat("a", 10000), repeat("a", 10000)); +select a1, left(a2, 20) from worklog5743_1; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_8; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +begin; +update worklog5743_1 set a1 = 1000; +update worklog5743_2 set a1 = 1000; +update worklog5743_4 set a1 = 1000; +update worklog5743_8 set a1 = 1000; +select a1, left(a2, 20) from worklog5743_1; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_8; +a1 left(a2, 20) +1000 aaaaaaaaaaaaaaaaaaaa +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_1 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_2 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_4 ref idx6 idx6 5 const 1 +explain select a1, left(a2, 20) from worklog5743_8 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743_8 ref idx5 idx5 5 const 1 +select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +select a1, left(a2, 20) from worklog5743_8 where a1 = 9; +a1 left(a2, 20) +9 aaaaaaaaaaaaaaaaaaaa +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1, left(a2, 20) from worklog5743_1 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_2 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_4 where a1 = 9; +a1 left(a2, 20) +select a1, left(a2, 20) from worklog5743_8 where a1 = 9; +a1 left(a2, 20) +connection default; +rollback; +drop table worklog5743_1; +drop table worklog5743_2; +drop table worklog5743_4; +drop table worklog5743_8; +### Test 5 ### +create table worklog5743(a1 int, a2 varchar(20000)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +ERROR 42000: Specified key was too long; max key length is 1536 bytes +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(1537)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +ERROR 42000: Specified key was too long; max key length is 1536 bytes +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(1536)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a2); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 1536)); +update worklog5743 set a1 = 1000; +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(1533)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a1, a2); +ERROR 42000: Specified key was too long; max key length is 1536 bytes +show warnings; +Level Code Message +Error 1071 Specified key was too long; max key length is 1536 bytes +drop table worklog5743; +create table worklog5743(a1 int, a2 varchar(1532)) ROW_FORMAT=DYNAMIC; +create index idx1 on worklog5743(a1, a2); +show warnings; +Level Code Message +insert into worklog5743 values(9, repeat("a", 1532)); +update worklog5743 set a1 = 1000; +begin; +update worklog5743 set a1 = 1000; +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +explain select a1 from worklog5743 where a1 = 9; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE worklog5743 ref idx1 idx1 5 const 1 Using index +select a1 from worklog5743 where a1 = 9; +a1 +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a1 from worklog5743 where a1 = 9; +a1 +connection default; +rollback; +drop table worklog5743; +### Test 6 ### +create table worklog5743(a TEXT not null, primary key (a(1000))) +row_format=compact; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create table worklog5743(a TEXT) row_format=compact; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx on worklog5743(a(767)); +insert into worklog5743 values(repeat("a", 20000)); +begin; +insert into worklog5743 values(repeat("b", 20000)); +update worklog5743 set a = (repeat("x", 25000)); +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +connection con1; +select a = repeat("a", 20000) from worklog5743; +a = repeat("a", 20000) +1 +disconnect con1; +connection con2; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +select a = repeat("x", 25000) from worklog5743; +a = repeat("x", 25000) +1 +1 +disconnect con2; +connection default; +rollback; +drop table worklog5743; +### Test 7 ### +create table worklog5743(a TEXT not null) ROW_FORMAT=DYNAMIC; +SET sql_mode= ''; +create index idx1 on worklog5743(a(3073)); +Warnings: +Note 1071 Specified key was too long; max key length is 1536 bytes +create index idx2 on worklog5743(a(3072)); +Warnings: +Note 1071 Specified key was too long; max key length is 1536 bytes +SET sql_mode= default; +show create table worklog5743; +Table Create Table +worklog5743 CREATE TABLE `worklog5743` ( + `a` text NOT NULL, + KEY `idx1` (`a`(1536)), + KEY `idx2` (`a`(1536)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +drop table worklog5743; +create table worklog5743(a TEXT not null) ROW_FORMAT=REDUNDANT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx2 on worklog5743(a(767)); +drop table worklog5743; +create table worklog5743(a TEXT not null) ROW_FORMAT=COMPACT; +create index idx on worklog5743(a(768)); +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +create index idx2 on worklog5743(a(767)); +drop table worklog5743; +SET GLOBAL innodb_file_per_table=1; diff --git a/mysql-test/suite/innodb_zip/r/innochecksum.result b/mysql-test/suite/innodb_zip/r/innochecksum.result new file mode 100644 index 00000000..bb94de7a --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/innochecksum.result @@ -0,0 +1,23 @@ +call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); +call mtr.add_suppression("InnoDB: Warning: database page corruption or a failed"); +CREATE TABLE tab1(c1 INT PRIMARY KEY,c2 VARCHAR(20)) ENGINE=InnoDB; +CREATE INDEX idx1 ON tab1(c2(10)); +INSERT INTO tab1 VALUES(1, 'Innochecksum InnoDB1'); +# Shutdown the Server +# Server Default checksum = innodb +[1b]: check the innochecksum without --strict-check +[4]: check the innochecksum with --no-check ignores algorithm check, warning is expected +FOUND 1 /Error: --no-check must be associated with --write option./ in my_restart.err +[5]: check the innochecksum with short form --no-check ignores algorithm check, warning is expected +FOUND 1 /Error: --no-check must be associated with --write option./ in my_restart.err +[6]: check the innochecksum with full form strict-check & no-check , an error is expected +FOUND 1 /unknown variable 'strict-check=innodb'/ in my_restart.err +[7]: check the innochecksum with short form strict-check & no-check , an error is expected +FOUND 1 /unknown option '-C'/ in my_restart.err +FOUND 1 /ignoring option '--write' due to invalid value 'crc32'/ in my_restart.err +FOUND 1 /Error: --no-check must be associated with --write option/ in my_restart.err +# restart +SELECT * FROM tab1; +c1 c2 +1 Innochecksum InnoDB1 +DROP TABLE tab1; diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_2.result b/mysql-test/suite/innodb_zip/r/innochecksum_2.result new file mode 100644 index 00000000..681d8e1f --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/innochecksum_2.result @@ -0,0 +1,92 @@ +SET GLOBAL innodb_compression_level=0; +SELECT @@innodb_compression_level; +@@innodb_compression_level +0 +CREATE TABLE t1 (j LONGBLOB) ENGINE = InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +INSERT INTO t1 VALUES (repeat('abcdefghijklmnopqrstuvwxyz',200)); +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +INSERT INTO t1 SELECT * from t1; +# stop the server + +Variables (--variable-name=value) +and boolean options {FALSE|TRUE} Value (after reading options) +--------------------------------- ---------------------------------------- +verbose TRUE +debug FALSE +count FALSE +start-page 0 +end-page 0 +page 0 +no-check FALSE +allow-mismatches 0 +write FALSE +page-type-summary FALSE +page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt +per-page-details FALSE +log (No default value) +leaf FALSE +merge 0 +[1]:# check the both short and long options for "help" +[2]:# Run the innochecksum when file isn't provided. +# It will print the innochecksum usage similar to --help option. +innochecksum Ver #.#.# +Copyright (c) YEAR, YEAR , Oracle, MariaDB Corporation Ab and others. + +InnoDB offline file checksum utility. +Usage: innochecksum [-c] [-s <start page>] [-e <end page>] [-p <page>] [-i] [-v] [-a <allow mismatches>] [-n] [-S] [-D <page type dump>] [-l <log>] [-l] [-m <merge pages>] <filename or [-]> +See https://mariadb.com/kb/en/library/innochecksum/ for usage hints. + -?, --help Displays this help and exits. + -I, --info Synonym for --help. + -V, --version Displays version information and exits. + -v, --verbose Verbose (prints progress every 5 seconds). + https://mariadb.com/kb/en/library/creating-a-trace-file/ + -c, --count Print the count of pages in the file and exits. + -s, --start-page=# Start on this page number (0 based). + -e, --end-page=# End at this page number (0 based). + -p, --page=# Check only this page (0 based). + -n, --no-check Ignore the checksum verification. + -a, --allow-mismatches=# + Maximum checksum mismatch allowed. + -w, --write Rewrite the checksum. + -S, --page-type-summary + Display a count of each page type in a tablespace. + -D, --page-type-dump=name + Dump the page type info for each page in a tablespace. + -i, --per-page-details + Print out per-page detail information. + -l, --log=name log output. + -f, --leaf Examine leaf index pages + -m, --merge=# leaf page count if merge given number of consecutive + pages + +Variables (--variable-name=value) +and boolean options {FALSE|TRUE} Value (after reading options) +--------------------------------- ---------------------------------------- +verbose FALSE +count FALSE +start-page 0 +end-page 0 +page 0 +no-check FALSE +allow-mismatches 0 +write FALSE +page-type-summary FALSE +page-type-dump (No default value) +per-page-details FALSE +log (No default value) +leaf FALSE +merge 0 +[3]:# check the both short and long options for "count" and exit +Number of pages:# +Number of pages:# +[4]:# Print the version of innochecksum and exit +innochecksum Ver #.#.## Restart the DB server +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_zip/r/innochecksum_3.result b/mysql-test/suite/innodb_zip/r/innochecksum_3.result new file mode 100644 index 00000000..03a31194 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/innochecksum_3.result @@ -0,0 +1,177 @@ +# Set the environmental variables +call mtr.add_suppression("InnoDB: Unable to read tablespace .* page no .* into the buffer pool after 100 attempts"); +call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to.*"); +CREATE TABLE tab1 (pk INTEGER NOT NULL PRIMARY KEY, +linestring_key GEOMETRY NOT NULL, +linestring_nokey GEOMETRY NOT NULL) +ENGINE=InnoDB ; +INSERT INTO tab1 (pk, linestring_key, linestring_nokey) +VALUES (1, ST_GeomFromText('POINT(10 10) '), ST_GeomFromText('POINT(10 10) ')); +CREATE INDEX linestring_index ON tab1(linestring_nokey(5)); +ALTER TABLE tab1 ADD KEY (linestring_key(5)); +# create a compressed table +CREATE TABLE tab2(col_1 CHAR (255) , +col_2 VARCHAR (255), col_3 longtext, +col_4 longtext,col_5 longtext, +col_6 longtext , col_7 int ) +engine = innodb row_format=compressed key_block_size=4; +CREATE INDEX idx1 ON tab2(col_3(10)); +CREATE INDEX idx2 ON tab2(col_4(10)); +CREATE INDEX idx3 ON tab2(col_5(10)); +SET @col_1 = repeat('a', 5); +SET @col_2 = repeat('b', 20); +SET @col_3 = repeat('c', 100); +SET @col_4 = repeat('d', 100); +SET @col_5 = repeat('e', 100); +SET @col_6 = repeat('f', 100); +INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,5); +INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,4); +INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,3); +INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,2); +INSERT INTO tab2(col_1,col_2,col_3,col_4,col_5,col_6,col_7) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,1); +# stop the server +[2]: Check the page type summary with shortform for tab1.ibd + +File::tab#.ibd +================PAGE TYPE SUMMARY============== +#PAGE_COUNT PAGE_TYPE +=============================================== + # Index page + # Undo log page + # Inode page + # Insert buffer free list page + # Freshly allocated page + # Insert buffer bitmap + # System page + # Transaction system page + # File Space Header + # Extent descriptor page + # BLOB page + # Compressed BLOB page + # Page compressed page + # Page compressed encrypted page + # Other type of page + +=============================================== +Additional information: +Undo page type: # +Undo page state: # active, # cached, # to_purge, # prepared, # other +index_id #pages #leaf_pages #recs_per_page #bytes_per_page +# # # # # +# # # # # +# # # # # + +index_id page_data_bytes_histgram(empty,...,oversized) +# # # # # # # # # # # # # +# # # # # # # # # # # # # +# # # # # # # # # # # # # +[3]: Check the page type summary with longform for tab1.ibd + +File::tab#.ibd +================PAGE TYPE SUMMARY============== +#PAGE_COUNT PAGE_TYPE +=============================================== + # Index page + # Undo log page + # Inode page + # Insert buffer free list page + # Freshly allocated page + # Insert buffer bitmap + # System page + # Transaction system page + # File Space Header + # Extent descriptor page + # BLOB page + # Compressed BLOB page + # Page compressed page + # Page compressed encrypted page + # Other type of page + +=============================================== +Additional information: +Undo page type: # +Undo page state: # active, # cached, # to_purge, # prepared, # other +index_id #pages #leaf_pages #recs_per_page #bytes_per_page +# # # # # +# # # # # +# # # # # + +index_id page_data_bytes_histgram(empty,...,oversized) +# # # # # # # # # # # # # +# # # # # # # # # # # # # +# # # # # # # # # # # # # +[4]: Page type dump for with longform for tab1.ibd +# Print the contents stored in dump.txt + + +Filename::tab#.ibd +============================================================================== + PAGE_NO | PAGE_TYPE | EXTRA INFO +============================================================================== +#::# | File Space Header | - +#::# | Insert Buffer Bitmap | - +#::# | Inode page | - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - +#::# | Freshly allocated page | - +#::# | Freshly allocated page | - +# Variables used by page type dump for ibdata1 + +Variables (--variable-name=value) +and boolean options {FALSE|TRUE} Value (after reading options) +--------------------------------- ---------------------------------------- +verbose TRUE +count FALSE +start-page 0 +end-page 0 +page 0 +no-check FALSE +allow-mismatches 0 +write FALSE +page-type-summary FALSE +page-type-dump MYSQLTEST_VARDIR/tmp/dump.txt +per-page-details FALSE +log (No default value) +leaf FALSE +merge 0 +[5]: Page type dump for with shortform for tab1.ibd + + +Filename::tab#.ibd +============================================================================== + PAGE_NO | PAGE_TYPE | EXTRA INFO +============================================================================== +#::# | File Space Header | - +#::# | Insert Buffer Bitmap | - +#::# | Inode page | - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - +#::# | Index page | index id=#, page level=#, No. of records=#, garbage=#, - +#::# | Freshly allocated page | - +#::# | Freshly allocated page | - +[6]: check the valid lower bound values for option +# allow-mismatches,page,start-page,end-page +[9]: check the both short and long options "page" and "start-page" when +# seek value is larger than file size. +FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err +FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err +FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err +FOUND 1 /Error: Unable to seek to necessary offset/ in my_restart.err +[34]: check the invalid upper bound values for options, allow-mismatches, end-page, start-page and page. +# innochecksum will fail with error code: 1 +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +NOT FOUND /Incorrect unsigned integer value: '18446744073709551616'/ in my_restart.err +# restart +DROP TABLE tab1,tab2; diff --git a/mysql-test/suite/innodb_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result new file mode 100644 index 00000000..0a3119f4 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result @@ -0,0 +1,289 @@ +CREATE DATABASE mysqltest_innodb_zip; +USE mysqltest_innodb_zip; +SELECT table_name, row_format, data_length, index_length +FROM information_schema.tables +WHERE table_schema='mysqltest_innodb_zip'; +table_name row_format data_length index_length +SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata; +set session innodb_strict_mode=0; +set global innodb_file_per_table=off; +SET @@global.innodb_stats_on_metadata=ON; +create table t0(a int primary key) engine=innodb row_format=compressed; +Warnings: +Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +create table t00(a int primary key) engine=innodb +key_block_size=4 row_format=compressed; +Warnings: +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=4. +Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +create table t1(a int primary key) engine=innodb row_format=dynamic; +create table t2(a int primary key) engine=innodb row_format=redundant; +create table t3(a int primary key) engine=innodb row_format=compact; +create table t4(a int primary key) engine=innodb key_block_size=9; +Warnings: +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9. +create table t5(a int primary key) engine=innodb +key_block_size=1 row_format=redundant; +Warnings: +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1. +set global innodb_file_per_table=on; +create table t6(a int primary key) engine=innodb +key_block_size=1 row_format=redundant; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +create table t7(a int primary key) engine=innodb +key_block_size=1 row_format=redundant; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +create table t8(a int primary key) engine=innodb +key_block_size=1 row_format=fixed; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC. +create table t9(a int primary key) engine=innodb +key_block_size=1 row_format=compact; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +create table t10(a int primary key) engine=innodb +key_block_size=1 row_format=dynamic; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=1 unless ROW_FORMAT=COMPRESSED. +create table t11(a int primary key) engine=innodb +key_block_size=1 row_format=compressed; +create table t12(a int primary key) engine=innodb +key_block_size=1; +create table t13(a int primary key) engine=innodb +row_format=compressed; +create table t14(a int primary key) engine=innodb key_block_size=9; +Warnings: +Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=9. +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t0 Dynamic {valid} 0 +mysqltest_innodb_zip t00 Dynamic {valid} 0 +mysqltest_innodb_zip t1 Dynamic {valid} 0 +mysqltest_innodb_zip t10 Dynamic {valid} 0 +mysqltest_innodb_zip t11 Compressed 1024 0 +mysqltest_innodb_zip t12 Compressed 1024 0 +mysqltest_innodb_zip t13 Compressed {valid} 0 +mysqltest_innodb_zip t14 Dynamic {valid} 0 +mysqltest_innodb_zip t2 Redundant {valid} 0 +mysqltest_innodb_zip t3 Compact {valid} 0 +mysqltest_innodb_zip t4 Dynamic {valid} 0 +mysqltest_innodb_zip t5 Redundant {valid} 0 +mysqltest_innodb_zip t6 Redundant {valid} 0 +mysqltest_innodb_zip t7 Redundant {valid} 0 +mysqltest_innodb_zip t8 Dynamic {valid} 0 +mysqltest_innodb_zip t9 Compact {valid} 0 +drop table t0,t00,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14; +alter table t1 key_block_size=0; +alter table t1 row_format=dynamic; +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t1 Dynamic {valid} 0 +alter table t1 row_format=compact; +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t1 Compact {valid} 0 +alter table t1 row_format=redundant; +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t1 Redundant {valid} 0 +drop table t1; +create table t1(a int not null, b text, index(b(10))) engine=innodb +key_block_size=1; +create table t2(b text)engine=innodb; +insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000))); +insert into t1 select 1, b from t2; +commit; +connect a,localhost,root,,mysqltest_innodb_zip; +connect b,localhost,root,,mysqltest_innodb_zip; +connection a; +begin; +update t1 set b=repeat('B',100); +connection b; +select a,left(b,40) from t1 natural join t2; +a left(b,40) +1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA +connection a; +rollback; +connection b; +select a,left(b,40) from t1 natural join t2; +a left(b,40) +1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA +connection default; +disconnect a; +disconnect b; +analyze table t1; +Table Op Msg_type Msg_text +mysqltest_innodb_zip.t1 analyze status Engine-independent statistics collected +mysqltest_innodb_zip.t1 analyze Warning Engine-independent statistics are not collected for column 'b' +mysqltest_innodb_zip.t1 analyze status OK +analyze table t2; +Table Op Msg_type Msg_text +mysqltest_innodb_zip.t2 analyze status Engine-independent statistics collected +mysqltest_innodb_zip.t2 analyze Warning Engine-independent statistics are not collected for column 'b' +mysqltest_innodb_zip.t2 analyze status OK +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t1 Compressed 2048 1024 +mysqltest_innodb_zip t2 Dynamic {valid} 0 +drop table t1,t2; +create table t1( c1 int not null, c2 blob, c3 blob, c4 blob, +primary key(c1, c2(22), c3(22))) +engine = innodb row_format = dynamic; +begin; +insert into t1 values(1, repeat('A', 20000), repeat('B', 20000), +repeat('C', 20000)); +update t1 set c3 = repeat('D', 20000) where c1 = 1; +commit; +select count(*) from t1 where c2 = repeat('A', 20000); +count(*) +1 +select count(*) from t1 where c3 = repeat('D', 20000); +count(*) +1 +select count(*) from t1 where c4 = repeat('C', 20000); +count(*) +1 +update t1 set c3 = repeat('E', 20000) where c1 = 1; +drop table t1; +set global innodb_file_per_table = on; +set innodb_strict_mode = off; +create table t1 (id int primary key) engine = innodb key_block_size = 0; +drop table t1; +set innodb_strict_mode = on; +create table t1 (id int primary key) engine = innodb key_block_size = 0; +create table t2 (id int primary key) engine = innodb key_block_size = 9; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] +Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t3 (id int primary key) engine = innodb key_block_size = 1; +create table t4 (id int primary key) engine = innodb key_block_size = 2; +create table t5 (id int primary key) engine = innodb key_block_size = 4; +create table t8 (id int primary key) engine = innodb row_format = compressed; +create table t9 (id int primary key) engine = innodb row_format = dynamic; +create table t10(id int primary key) engine = innodb row_format = compact; +create table t11(id int primary key) engine = innodb row_format = redundant; +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t1 Dynamic {valid} 0 +mysqltest_innodb_zip t10 Compact {valid} 0 +mysqltest_innodb_zip t11 Redundant {valid} 0 +mysqltest_innodb_zip t3 Compressed 1024 0 +mysqltest_innodb_zip t4 Compressed {valid} 0 +mysqltest_innodb_zip t5 Compressed {valid} 0 +mysqltest_innodb_zip t8 Compressed {valid} 0 +mysqltest_innodb_zip t9 Dynamic {valid} 0 +drop table t1, t3, t4, t5, t8, t9, t10, t11; +create table t1 (id int primary key) engine = innodb +key_block_size = 4 row_format = compressed; +create table t2 (id int primary key) engine = innodb +key_block_size = 4 row_format = redundant; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t3 (id int primary key) engine = innodb +key_block_size = 4 row_format = compact; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t4 (id int primary key) engine = innodb +key_block_size = 4 row_format = dynamic; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t4` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t4` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t5 (id int primary key) engine = innodb +key_block_size = 4 row_format = default; +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t1 Compressed 4096 0 +mysqltest_innodb_zip t5 Compressed 4096 0 +drop table t1, t5; +create table t1 (id int primary key) engine = innodb +key_block_size = 9 row_format = redundant; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] +Warning 1478 InnoDB: cannot specify ROW_FORMAT = REDUNDANT with KEY_BLOCK_SIZE. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t2 (id int primary key) engine = innodb +key_block_size = 9 row_format = compact; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] +Warning 1478 InnoDB: cannot specify ROW_FORMAT = COMPACT with KEY_BLOCK_SIZE. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t2 (id int primary key) engine = innodb +key_block_size = 9 row_format = dynamic; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: invalid KEY_BLOCK_SIZE = 9. Valid values are [1, 2, 4, 8, 16] +Warning 1478 InnoDB: cannot specify ROW_FORMAT = DYNAMIC with KEY_BLOCK_SIZE. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +set global innodb_file_per_table = off; +create table t1 (id int primary key) engine = innodb key_block_size = 1; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t1` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t2 (id int primary key) engine = innodb key_block_size = 2; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t2` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t3 (id int primary key) engine = innodb key_block_size = 4; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t3` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t6 (id int primary key) engine = innodb row_format = compressed; +ERROR HY000: Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options") +show warnings; +Level Code Message +Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table. +Error 1005 Can't create table `mysqltest_innodb_zip`.`t6` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +create table t7 (id int primary key) engine = innodb row_format = dynamic; +show warnings; +Level Code Message +create table t8 (id int primary key) engine = innodb row_format = compact; +create table t9 (id int primary key) engine = innodb row_format = redundant; +SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql' and table_schema != 'sys' order by table_name; +table_schema table_name row_format data_length index_length +mysqltest_innodb_zip t7 Dynamic {valid} 0 +mysqltest_innodb_zip t8 Compact {valid} 0 +mysqltest_innodb_zip t9 Redundant {valid} 0 +drop table t7, t8, t9; +DROP DATABASE mysqltest_innodb_zip; diff --git a/mysql-test/suite/innodb_zip/r/large_blob.result b/mysql-test/suite/innodb_zip/r/large_blob.result new file mode 100644 index 00000000..7070d610 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/large_blob.result @@ -0,0 +1,83 @@ +# +# This tests the use of large blobs in InnoDB. +# +call mtr.add_suppression("InnoDB: Warning: a long semaphore wait"); +SET GLOBAL innodb_file_per_table = OFF; +# +# System tablespace, Row Format = Redundant +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; +# +# System tablespace, Row Format = Compact +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; +SET GLOBAL innodb_file_per_table = ON; +# +# Separate tablespace, Row Format = Redundant +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; +# +# Separate tablespace, Row Format = Compact +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; +# +# Separate tablespace, Row Format = Compressed, Key Block Size = 2k +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=2; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; +# +# Separate tablespace, Row Format = Compressed, Key Block Size = 1k +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=1; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; +# +# Separate tablespace, Row Format = Dynamic +# +CREATE TABLE t1 ( +c1 INT DEFAULT NULL, +c2 LONGBLOB NOT NULL, +KEY k2 (c2(250), c1) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 VALUES (1, ''); +UPDATE t1 SET c2=@longblob; +DROP TABLE t1; diff --git a/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff b/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff new file mode 100644 index 00000000..afc2e9d5 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/page_size,4k.rdiff @@ -0,0 +1,467 @@ +@@ -3,7 +3,7 @@ + SELECT variable_value FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_page_size'; + variable_value +-16384 ++4096 + # Test 3) Query some information_shema tables that are dependent upon + # the page size. + SELECT t.name table_name, t.n_cols, t.flag table_flags, +@@ -36,13 +36,13 @@ + table_name n_cols table_flags index_name root_page type n_fields merge_threshold + test/t1 5 0 PRIMARY 3 3 1 50 + test/t2 5 1 PRIMARY 3 3 1 50 +-test/t3 5 41 PRIMARY 3 3 1 50 ++test/t3 5 37 PRIMARY 3 3 1 50 + test/t4 5 33 PRIMARY 3 3 1 50 + === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === + Space_Name Page_Size Zip_Size Path + test/t1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t1.ibd + test/t2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t2.ibd +-test/t3 DEFAULT 8192 MYSQLD_DATADIR/test/t3.ibd ++test/t3 DEFAULT 2048 MYSQLD_DATADIR/test/t3.ibd + test/t4 DEFAULT DEFAULT MYSQLD_DATADIR/test/t4.ibd + innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 + DROP TABLE t1, t2, t3, t4; +@@ -52,141 +52,90 @@ + SET SESSION innodb_strict_mode = ON; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(127) + ) ROW_FORMAT=redundant; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(128) + ) ROW_FORMAT=redundant; +-ERROR 42000: Row size too large (> 8123). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155) + ) ROW_FORMAT=compact; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156) + ) ROW_FORMAT=compact; +-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(196) ++c06 char(200), c07 char(200), c08 char(176) + ) ROW_FORMAT=compressed; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(79) + ) ROW_FORMAT=compressed; +-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(155) + ) ROW_FORMAT=dynamic; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +-c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +-c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247) ++c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(156) + ) ROW_FORMAT=dynamic; +-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(4) character set utf8, +-PRIMARY KEY (a,b,c,d,e)) ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++CREATE TABLE t1 (a varchar(98) character set utf8, ++b varchar(98) character set utf8, ++c varchar(98) character set utf8, ++d varchar(97) character set utf8, ++PRIMARY KEY (a,b,c,d)) + ENGINE=innodb; + DROP TABLE t1; +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(5) character set utf8, +-PRIMARY KEY (a,b,c,d,e)) ++CREATE TABLE t1 (a varchar(98) character set utf8, ++b varchar(98) character set utf8, ++c varchar(98) character set utf8, ++d varchar(98) character set utf8, ++PRIMARY KEY (a,b,c,d)) + ENGINE=innodb; +-ERROR 42000: Specified key was too long; max key length is 3072 bytes +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(255) character set utf8, +-f varchar(4) character set utf8, +-PRIMARY KEY (a), KEY (b,c,d,e,f)) ++ERROR 42000: Specified key was too long; max key length is 1173 bytes ++CREATE TABLE t1 (a varchar(98) character set utf8, ++b varchar(98) character set utf8, ++c varchar(98) character set utf8, ++d varchar(98) character set utf8, ++e varchar(97) character set utf8, ++PRIMARY KEY (a), KEY (b,c,d,e)) + ENGINE=innodb; + DROP TABLE t1; +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(255) character set utf8, +-f varchar(5) character set utf8, +-PRIMARY KEY (a), KEY (b,c,d,e,f)) ++CREATE TABLE t1 (a varchar(98) character set utf8, ++b varchar(98) character set utf8, ++c varchar(98) character set utf8, ++d varchar(98) character set utf8, ++e varchar(98) character set utf8, ++PRIMARY KEY (a), KEY (b,c,d,e)) + ENGINE=innodb; +-ERROR 42000: Specified key was too long; max key length is 3072 bytes ++ERROR 42000: Specified key was too long; max key length is 1173 bytes + # Test 5) KEY_BLOCK_SIZE validation + CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; ++ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") + SHOW WARNINGS; + Level Code Message +-SELECT table_name, row_format, create_options +-FROM information_schema.tables WHERE table_name = 't1'; +-table_name row_format create_options +-t1 Compressed row_format=COMPRESSED key_block_size=16 +-ALTER TABLE t1 KEY_BLOCK_SIZE=8; ++Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4. ++Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") ++Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB ++CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; ++ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") + SHOW WARNINGS; + Level Code Message +-SELECT table_name, row_format, create_options +-FROM information_schema.tables WHERE table_name = 't1'; +-table_name row_format create_options +-t1 Compressed row_format=COMPRESSED key_block_size=8 ++Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4. ++Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") ++Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB ++CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED; + ALTER TABLE t1 KEY_BLOCK_SIZE=4; + SHOW WARNINGS; + Level Code Message +@@ -218,15 +167,21 @@ + DROP TABLE t1; + SET SESSION innodb_strict_mode = OFF; + CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; ++Warnings: ++Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. + SHOW WARNINGS; + Level Code Message ++Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. + SELECT table_name, row_format, create_options + FROM information_schema.tables WHERE table_name = 't1'; + table_name row_format create_options + t1 Compressed row_format=COMPRESSED key_block_size=16 + ALTER TABLE t1 KEY_BLOCK_SIZE=8; ++Warnings: ++Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8. + SHOW WARNINGS; + Level Code Message ++Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=8. + SELECT table_name, row_format, create_options + FROM information_schema.tables WHERE table_name = 't1'; + table_name row_format create_options +@@ -270,6 +225,7 @@ + ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") + SHOW WARNINGS; + Level Code Message ++Warning 1478 InnoDB: KEY_BLOCK_SIZE=8 cannot be larger than 4. + Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. + Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options") + Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +@@ -277,105 +233,11 @@ + ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options") + SHOW WARNINGS; + Level Code Message ++Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 4. + Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. + Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options") + Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB + SET GLOBAL innodb_file_per_table = ON; +-# Test 7) This series of tests were moved from innodb-index to here +-# because the second alter table t1 assumes a 16k page size. +-# Moving the test allows the rest of innodb-index to be run on all +-# page sizes. The previously disabled portions of this test were +-# moved as well. +-CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8; +-CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb; +-INSERT INTO t3 VALUES (22),(44),(33),(55),(66); +-INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'), +-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik'); +-CREATE TABLE t1(a int, b blob, c text, d text NOT NULL) +-ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0; +-INSERT INTO t1 +-SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d; +-DROP TABLE t2, t3; +-SELECT COUNT(*) FROM t1 WHERE a=44; +-COUNT(*) +-5 +-SELECT a, +-LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1 +-ORDER BY 1, 2, 3, 4, 5, 6; +-a LENGTH(b) b=LEFT(REPEAT(d,100*a),65535) LENGTH(c) c=REPEAT(d,20*a) d +-22 22000 1 4400 1 adfd72nh9k +-22 22000 1 4400 1 jejdkrun87 +-22 26400 1 5280 1 adfdpplkeock +-22 28600 1 5720 1 adfdijnmnb78k +-22 35200 1 7040 1 adfdijn0loKNHJik +-33 33000 1 6600 1 adfd72nh9k +-33 33000 1 6600 1 jejdkrun87 +-33 39600 1 7920 1 adfdpplkeock +-33 42900 1 8580 1 adfdijnmnb78k +-33 52800 1 10560 1 adfdijn0loKNHJik +-44 44000 1 8800 1 adfd72nh9k +-44 44000 1 8800 1 jejdkrun87 +-44 52800 1 10560 1 adfdpplkeock +-44 57200 1 11440 1 adfdijnmnb78k +-44 65535 1 14080 1 adfdijn0loKNHJik +-55 55000 1 11000 1 adfd72nh9k +-55 55000 1 11000 1 jejdkrun87 +-55 65535 1 13200 1 adfdpplkeock +-55 65535 1 14300 1 adfdijnmnb78k +-55 65535 1 17600 1 adfdijn0loKNHJik +-66 65535 1 13200 1 adfd72nh9k +-66 65535 1 13200 1 jejdkrun87 +-66 65535 1 15840 1 adfdpplkeock +-66 65535 1 17160 1 adfdijnmnb78k +-66 65535 1 21120 1 adfdijn0loKNHJik +-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20)); +-ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +-DELETE FROM t1 WHERE d='null'; +-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20)); +-ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +-DELETE FROM t1 WHERE a%2; +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check status OK +-ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767)); +-SELECT COUNT(*) FROM t1 WHERE a=44; +-COUNT(*) +-5 +-SELECT a, +-LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1; +-a LENGTH(b) b=LEFT(REPEAT(d,100*a), 65535) LENGTH(c) c=REPEAT(d,20*a) d +-22 22000 1 4400 1 adfd72nh9k +-22 35200 1 7040 1 adfdijn0loKNHJik +-22 28600 1 5720 1 adfdijnmnb78k +-22 26400 1 5280 1 adfdpplkeock +-22 22000 1 4400 1 jejdkrun87 +-44 44000 1 8800 1 adfd72nh9k +-44 65535 1 14080 1 adfdijn0loKNHJik +-44 57200 1 11440 1 adfdijnmnb78k +-44 52800 1 10560 1 adfdpplkeock +-44 44000 1 8800 1 jejdkrun87 +-66 65535 1 13200 1 adfd72nh9k +-66 65535 1 21120 1 adfdijn0loKNHJik +-66 65535 1 17160 1 adfdijnmnb78k +-66 65535 1 15840 1 adfdpplkeock +-66 65535 1 13200 1 jejdkrun87 +-SHOW CREATE TABLE t1; +-Table Create Table +-t1 CREATE TABLE `t1` ( +- `a` int(11) NOT NULL, +- `b` blob NOT NULL, +- `c` text NOT NULL, +- `d` text NOT NULL, +- PRIMARY KEY (`a`,`b`(255),`c`(255)), +- KEY `b` (`b`(767)) +-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci STATS_PERSISTENT=0 +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check status OK +-EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%'; +-id select_type table type possible_keys key key_len ref rows Extra +-1 SIMPLE t1 range b b 769 NULL # Using where +-DROP TABLE t1; + # Test 8) Test creating a table that could lead to undo log overflow. + CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, + h blob,i blob,j blob,k blob,l blob,m blob,n blob, +@@ -390,10 +252,6 @@ + UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b, + k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b; + CREATE INDEX t1a ON t1 (a(767)); +-CREATE INDEX t1b ON t1 (b(767)); +-CREATE INDEX t1c ON t1 (c(767)); +-CREATE INDEX t1d ON t1 (d(767)); +-CREATE INDEX t1e ON t1 (e(767)); + UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c, + k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c; + CREATE INDEX t1f ON t1 (f(767)); +@@ -408,37 +266,15 @@ + COMMIT; + CREATE INDEX t1g ON t1 (g(767)); + UPDATE t1 SET g=@e; +-CREATE INDEX t1h ON t1 (h(767)); +-UPDATE t1 SET h=@e; +-CREATE INDEX t1i ON t1 (i(767)); +-UPDATE t1 SET i=@e; +-CREATE INDEX t1j ON t1 (j(767)); +-UPDATE t1 SET j=@e; +-CREATE INDEX t1k ON t1 (k(767)); +-UPDATE t1 SET k=@e; +-CREATE INDEX t1l ON t1 (l(767)); +-UPDATE t1 SET l=@e; +-CREATE INDEX t1m ON t1 (m(767)); +-UPDATE t1 SET m=@e; +-CREATE INDEX t1n ON t1 (n(767)); +-UPDATE t1 SET n=@e; +-CREATE INDEX t1o ON t1 (o(767)); +-UPDATE t1 SET o=@e; +-CREATE INDEX t1p ON t1 (p(767)); +-UPDATE t1 SET p=@e; +-CREATE INDEX t1q ON t1 (q(767)); +-UPDATE t1 SET q=@e; +-CREATE INDEX t1r ON t1 (r(767)); +-UPDATE t1 SET r=@e; +-CREATE INDEX t1s ON t1 (s(767)); +-UPDATE t1 SET s=@e; + CREATE INDEX t1t ON t1 (t(767)); + BEGIN; + UPDATE t1 SET t=@e; + ROLLBACK; + CREATE INDEX t1u ON t1 (u(767)); +-CREATE INDEX t1ut ON t1 (u(767), t(767)); +-CREATE INDEX t1st ON t1 (s(767), t(767)); ++CREATE INDEX t1ut ON t1 (u(767)); ++Warnings: ++Note 1831 Duplicate index `t1ut`. This is deprecated and will be disallowed in a future release ++CREATE INDEX t1st ON t1 (s(767)); + SHOW CREATE TABLE t1; + Table Create Table + t1 CREATE TABLE `t1` ( +@@ -464,28 +300,12 @@ + `t` blob DEFAULT NULL, + `u` blob DEFAULT NULL, + KEY `t1a` (`a`(767)), +- KEY `t1b` (`b`(767)), +- KEY `t1c` (`c`(767)), +- KEY `t1d` (`d`(767)), +- KEY `t1e` (`e`(767)), + KEY `t1f` (`f`(767)), + KEY `t1g` (`g`(767)), +- KEY `t1h` (`h`(767)), +- KEY `t1i` (`i`(767)), +- KEY `t1j` (`j`(767)), +- KEY `t1k` (`k`(767)), +- KEY `t1l` (`l`(767)), +- KEY `t1m` (`m`(767)), +- KEY `t1n` (`n`(767)), +- KEY `t1o` (`o`(767)), +- KEY `t1p` (`p`(767)), +- KEY `t1q` (`q`(767)), +- KEY `t1r` (`r`(767)), +- KEY `t1s` (`s`(767)), + KEY `t1t` (`t`(767)), + KEY `t1u` (`u`(767)), +- KEY `t1ut` (`u`(767),`t`(767)), +- KEY `t1st` (`s`(767),`t`(767)) ++ KEY `t1ut` (`u`(767)), ++ KEY `t1st` (`s`(767)) + ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + DROP TABLE t1; + # Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE +@@ -570,27 +390,25 @@ + DROP TABLE t1; + CREATE TABLE t1( + c text NOT NULL, d text NOT NULL, +-PRIMARY KEY (c(767),d(767))) ++PRIMARY KEY (c(767))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; + Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + DROP TABLE t1; + CREATE TABLE t1( + c text NOT NULL, d text NOT NULL, +-PRIMARY KEY (c(767),d(767))) ++PRIMARY KEY (c(767))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII; +-Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + DROP TABLE t1; + CREATE TABLE t1( + c text NOT NULL, d text NOT NULL, +-PRIMARY KEY (c(767),d(767))) ++PRIMARY KEY (c(767))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII; + DROP TABLE t1; + CREATE TABLE t1(c text, PRIMARY KEY (c(440))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; + Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++Warning 139 Row size too large (> 1982). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + DROP TABLE t1; + CREATE TABLE t1(c text, PRIMARY KEY (c(293))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; diff --git a/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff b/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff new file mode 100644 index 00000000..11b22081 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/page_size,8k.rdiff @@ -0,0 +1,413 @@ +@@ -3,7 +3,7 @@ + SELECT variable_value FROM information_schema.global_status + WHERE LOWER(variable_name) = 'innodb_page_size'; + variable_value +-16384 ++8192 + # Test 3) Query some information_shema tables that are dependent upon + # the page size. + SELECT t.name table_name, t.n_cols, t.flag table_flags, +@@ -36,13 +36,13 @@ + table_name n_cols table_flags index_name root_page type n_fields merge_threshold + test/t1 5 0 PRIMARY 3 3 1 50 + test/t2 5 1 PRIMARY 3 3 1 50 +-test/t3 5 41 PRIMARY 3 3 1 50 ++test/t3 5 39 PRIMARY 3 3 1 50 + test/t4 5 33 PRIMARY 3 3 1 50 + === information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === + Space_Name Page_Size Zip_Size Path + test/t1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t1.ibd + test/t2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t2.ibd +-test/t3 DEFAULT 8192 MYSQLD_DATADIR/test/t3.ibd ++test/t3 DEFAULT 4096 MYSQLD_DATADIR/test/t3.ibd + test/t4 DEFAULT DEFAULT MYSQLD_DATADIR/test/t4.ibd + innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 + DROP TABLE t1, t2, t3, t4; +@@ -54,133 +54,97 @@ + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(155) + ) ROW_FORMAT=redundant; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(156) + ) ROW_FORMAT=redundant; +-ERROR 42000: Row size too large (> 8123). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202) + ) ROW_FORMAT=compact; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203) + ) ROW_FORMAT=compact; +-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(196) ++c16 char(200), c17 char(200), c18 char(182) + ) ROW_FORMAT=compressed; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(106) + ) ROW_FORMAT=compressed; +-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(202) + ) ROW_FORMAT=dynamic; + DROP TABLE t1; + CREATE TABLE t1 ( + c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), + c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), + c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +-c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +-c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +-c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +-c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +-c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247) ++c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(203) + ) ROW_FORMAT=dynamic; +-ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(4) character set utf8, +-PRIMARY KEY (a,b,c,d,e)) ++ERROR 42000: Row size too large (> max_row_size). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++CREATE TABLE t1 (a varchar(128) character set utf8, ++b varchar(128) character set utf8, ++c varchar(128) character set utf8, ++d varchar(128) character set utf8, ++PRIMARY KEY (a,b,c,d)) + ENGINE=innodb; + DROP TABLE t1; +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(5) character set utf8, +-PRIMARY KEY (a,b,c,d,e)) ++CREATE TABLE t1 (a varchar(128) character set utf8, ++b varchar(128) character set utf8, ++c varchar(128) character set utf8, ++d varchar(129) character set utf8, ++PRIMARY KEY (a,b,c,d)) + ENGINE=innodb; +-ERROR 42000: Specified key was too long; max key length is 3072 bytes +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(255) character set utf8, +-f varchar(4) character set utf8, +-PRIMARY KEY (a), KEY (b,c,d,e,f)) ++ERROR 42000: Specified key was too long; max key length is 1536 bytes ++CREATE TABLE t1 (a varchar(128) character set utf8, ++b varchar(128) character set utf8, ++c varchar(128) character set utf8, ++d varchar(128) character set utf8, ++e varchar(128) character set utf8, ++PRIMARY KEY (a), KEY (b,c,d,e)) + ENGINE=innodb; + DROP TABLE t1; +-CREATE TABLE t1 (a varchar(255) character set utf8, +-b varchar(255) character set utf8, +-c varchar(255) character set utf8, +-d varchar(255) character set utf8, +-e varchar(255) character set utf8, +-f varchar(5) character set utf8, +-PRIMARY KEY (a), KEY (b,c,d,e,f)) ++CREATE TABLE t1 (a varchar(128) character set utf8, ++b varchar(128) character set utf8, ++c varchar(128) character set utf8, ++d varchar(128) character set utf8, ++e varchar(129) character set utf8, ++PRIMARY KEY (a), KEY (b,c,d,e)) + ENGINE=innodb; +-ERROR 42000: Specified key was too long; max key length is 3072 bytes ++ERROR 42000: Specified key was too long; max key length is 1536 bytes + # Test 5) KEY_BLOCK_SIZE validation +-CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; ++CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; ++ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options") + SHOW WARNINGS; + Level Code Message +-SELECT table_name, row_format, create_options +-FROM information_schema.tables WHERE table_name = 't1'; +-table_name row_format create_options +-t1 Compressed row_format=COMPRESSED key_block_size=16 +-ALTER TABLE t1 KEY_BLOCK_SIZE=8; ++Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8. ++Error 1005 Can't create table `test`.`t1` (errno: 140 "Wrong create options") ++Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB ++CREATE TABLE t1 ( i INT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; + SHOW WARNINGS; + Level Code Message + SELECT table_name, row_format, create_options +@@ -218,8 +182,11 @@ + DROP TABLE t1; + SET SESSION innodb_strict_mode = OFF; + CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; ++Warnings: ++Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. + SHOW WARNINGS; + Level Code Message ++Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16. + SELECT table_name, row_format, create_options + FROM information_schema.tables WHERE table_name = 't1'; + table_name row_format create_options +@@ -277,105 +244,11 @@ + ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options") + SHOW WARNINGS; + Level Code Message ++Warning 1478 InnoDB: KEY_BLOCK_SIZE=16 cannot be larger than 8. + Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. + Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options") + Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB + SET GLOBAL innodb_file_per_table = ON; +-# Test 7) This series of tests were moved from innodb-index to here +-# because the second alter table t1 assumes a 16k page size. +-# Moving the test allows the rest of innodb-index to be run on all +-# page sizes. The previously disabled portions of this test were +-# moved as well. +-CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8; +-CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb; +-INSERT INTO t3 VALUES (22),(44),(33),(55),(66); +-INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'), +-('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik'); +-CREATE TABLE t1(a int, b blob, c text, d text NOT NULL) +-ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0; +-INSERT INTO t1 +-SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d; +-DROP TABLE t2, t3; +-SELECT COUNT(*) FROM t1 WHERE a=44; +-COUNT(*) +-5 +-SELECT a, +-LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1 +-ORDER BY 1, 2, 3, 4, 5, 6; +-a LENGTH(b) b=LEFT(REPEAT(d,100*a),65535) LENGTH(c) c=REPEAT(d,20*a) d +-22 22000 1 4400 1 adfd72nh9k +-22 22000 1 4400 1 jejdkrun87 +-22 26400 1 5280 1 adfdpplkeock +-22 28600 1 5720 1 adfdijnmnb78k +-22 35200 1 7040 1 adfdijn0loKNHJik +-33 33000 1 6600 1 adfd72nh9k +-33 33000 1 6600 1 jejdkrun87 +-33 39600 1 7920 1 adfdpplkeock +-33 42900 1 8580 1 adfdijnmnb78k +-33 52800 1 10560 1 adfdijn0loKNHJik +-44 44000 1 8800 1 adfd72nh9k +-44 44000 1 8800 1 jejdkrun87 +-44 52800 1 10560 1 adfdpplkeock +-44 57200 1 11440 1 adfdijnmnb78k +-44 65535 1 14080 1 adfdijn0loKNHJik +-55 55000 1 11000 1 adfd72nh9k +-55 55000 1 11000 1 jejdkrun87 +-55 65535 1 13200 1 adfdpplkeock +-55 65535 1 14300 1 adfdijnmnb78k +-55 65535 1 17600 1 adfdijn0loKNHJik +-66 65535 1 13200 1 adfd72nh9k +-66 65535 1 13200 1 jejdkrun87 +-66 65535 1 15840 1 adfdpplkeock +-66 65535 1 17160 1 adfdijnmnb78k +-66 65535 1 21120 1 adfdijn0loKNHJik +-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20)); +-ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +-DELETE FROM t1 WHERE d='null'; +-ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20)); +-ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +-DELETE FROM t1 WHERE a%2; +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check status OK +-ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767)); +-SELECT COUNT(*) FROM t1 WHERE a=44; +-COUNT(*) +-5 +-SELECT a, +-LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1; +-a LENGTH(b) b=LEFT(REPEAT(d,100*a), 65535) LENGTH(c) c=REPEAT(d,20*a) d +-22 22000 1 4400 1 adfd72nh9k +-22 35200 1 7040 1 adfdijn0loKNHJik +-22 28600 1 5720 1 adfdijnmnb78k +-22 26400 1 5280 1 adfdpplkeock +-22 22000 1 4400 1 jejdkrun87 +-44 44000 1 8800 1 adfd72nh9k +-44 65535 1 14080 1 adfdijn0loKNHJik +-44 57200 1 11440 1 adfdijnmnb78k +-44 52800 1 10560 1 adfdpplkeock +-44 44000 1 8800 1 jejdkrun87 +-66 65535 1 13200 1 adfd72nh9k +-66 65535 1 21120 1 adfdijn0loKNHJik +-66 65535 1 17160 1 adfdijnmnb78k +-66 65535 1 15840 1 adfdpplkeock +-66 65535 1 13200 1 jejdkrun87 +-SHOW CREATE TABLE t1; +-Table Create Table +-t1 CREATE TABLE `t1` ( +- `a` int(11) NOT NULL, +- `b` blob NOT NULL, +- `c` text NOT NULL, +- `d` text NOT NULL, +- PRIMARY KEY (`a`,`b`(255),`c`(255)), +- KEY `b` (`b`(767)) +-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci STATS_PERSISTENT=0 +-CHECK TABLE t1; +-Table Op Msg_type Msg_text +-test.t1 check status OK +-EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%'; +-id select_type table type possible_keys key key_len ref rows Extra +-1 SIMPLE t1 range b b 769 NULL # Using where +-DROP TABLE t1; + # Test 8) Test creating a table that could lead to undo log overflow. + CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, + h blob,i blob,j blob,k blob,l blob,m blob,n blob, +@@ -390,10 +263,6 @@ + UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b, + k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b; + CREATE INDEX t1a ON t1 (a(767)); +-CREATE INDEX t1b ON t1 (b(767)); +-CREATE INDEX t1c ON t1 (c(767)); +-CREATE INDEX t1d ON t1 (d(767)); +-CREATE INDEX t1e ON t1 (e(767)); + UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c, + k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c; + CREATE INDEX t1f ON t1 (f(767)); +@@ -408,30 +277,6 @@ + COMMIT; + CREATE INDEX t1g ON t1 (g(767)); + UPDATE t1 SET g=@e; +-CREATE INDEX t1h ON t1 (h(767)); +-UPDATE t1 SET h=@e; +-CREATE INDEX t1i ON t1 (i(767)); +-UPDATE t1 SET i=@e; +-CREATE INDEX t1j ON t1 (j(767)); +-UPDATE t1 SET j=@e; +-CREATE INDEX t1k ON t1 (k(767)); +-UPDATE t1 SET k=@e; +-CREATE INDEX t1l ON t1 (l(767)); +-UPDATE t1 SET l=@e; +-CREATE INDEX t1m ON t1 (m(767)); +-UPDATE t1 SET m=@e; +-CREATE INDEX t1n ON t1 (n(767)); +-UPDATE t1 SET n=@e; +-CREATE INDEX t1o ON t1 (o(767)); +-UPDATE t1 SET o=@e; +-CREATE INDEX t1p ON t1 (p(767)); +-UPDATE t1 SET p=@e; +-CREATE INDEX t1q ON t1 (q(767)); +-UPDATE t1 SET q=@e; +-CREATE INDEX t1r ON t1 (r(767)); +-UPDATE t1 SET r=@e; +-CREATE INDEX t1s ON t1 (s(767)); +-UPDATE t1 SET s=@e; + CREATE INDEX t1t ON t1 (t(767)); + BEGIN; + UPDATE t1 SET t=@e; +@@ -464,24 +309,8 @@ + `t` blob DEFAULT NULL, + `u` blob DEFAULT NULL, + KEY `t1a` (`a`(767)), +- KEY `t1b` (`b`(767)), +- KEY `t1c` (`c`(767)), +- KEY `t1d` (`d`(767)), +- KEY `t1e` (`e`(767)), + KEY `t1f` (`f`(767)), + KEY `t1g` (`g`(767)), +- KEY `t1h` (`h`(767)), +- KEY `t1i` (`i`(767)), +- KEY `t1j` (`j`(767)), +- KEY `t1k` (`k`(767)), +- KEY `t1l` (`l`(767)), +- KEY `t1m` (`m`(767)), +- KEY `t1n` (`n`(767)), +- KEY `t1o` (`o`(767)), +- KEY `t1p` (`p`(767)), +- KEY `t1q` (`q`(767)), +- KEY `t1r` (`r`(767)), +- KEY `t1s` (`s`(767)), + KEY `t1t` (`t`(767)), + KEY `t1u` (`u`(767)), + KEY `t1ut` (`u`(767),`t`(767)), +@@ -573,14 +402,14 @@ + PRIMARY KEY (c(767),d(767))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; + Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++Warning 139 Row size too large (> 4030). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + DROP TABLE t1; + CREATE TABLE t1( + c text NOT NULL, d text NOT NULL, + PRIMARY KEY (c(767),d(767))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII; + Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++Warning 139 Row size too large (> 4030). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + DROP TABLE t1; + CREATE TABLE t1( + c text NOT NULL, d text NOT NULL, +@@ -590,7 +419,7 @@ + CREATE TABLE t1(c text, PRIMARY KEY (c(440))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; + Warnings: +-Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. ++Warning 139 Row size too large (> 4030). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. + DROP TABLE t1; + CREATE TABLE t1(c text, PRIMARY KEY (c(293))) + ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; diff --git a/mysql-test/suite/innodb_zip/r/page_size.result b/mysql-test/suite/innodb_zip/r/page_size.result new file mode 100644 index 00000000..48b954c9 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/page_size.result @@ -0,0 +1,632 @@ +SET default_storage_engine=InnoDB; +# Test 1) Show the page size from Information Schema +SELECT variable_value FROM information_schema.global_status +WHERE LOWER(variable_name) = 'innodb_page_size'; +variable_value +16384 +# Test 3) Query some information_shema tables that are dependent upon +# the page size. +SELECT t.name table_name, t.n_cols, t.flag table_flags, +i.name index_name, i.page_no root_page, i.type, +i.n_fields, i.merge_threshold +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t, +INFORMATION_SCHEMA.INNODB_SYS_INDEXES i +WHERE t.table_id = i.table_id +AND t.name LIKE 'mysql%' + ORDER BY t.name, i.index_id; +table_name n_cols table_flags index_name root_page type n_fields merge_threshold +mysql/innodb_index_stats 11 33 PRIMARY 3 3 4 50 +mysql/innodb_table_stats 9 33 PRIMARY 3 3 2 50 +mysql/transaction_registry 8 33 PRIMARY 3 3 1 50 +mysql/transaction_registry 8 33 commit_id 4 2 1 50 +mysql/transaction_registry 8 33 begin_timestamp 5 0 1 50 +mysql/transaction_registry 8 33 commit_timestamp 6 0 2 50 +CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb; +CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb; +CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb; +CREATE TABLE t4 (a INT KEY, b TEXT) ROW_FORMAT=DYNAMIC ENGINE=innodb; +SELECT t.name table_name, t.n_cols, t.flag table_flags, +i.name index_name, i.page_no root_page, i.type, +i.n_fields, i.merge_threshold +FROM INFORMATION_SCHEMA.INNODB_SYS_TABLES t, +INFORMATION_SCHEMA.INNODB_SYS_INDEXES i +WHERE t.table_id = i.table_id +AND t.name LIKE 'test%' + ORDER BY t.name, i.name; +table_name n_cols table_flags index_name root_page type n_fields merge_threshold +test/t1 5 0 PRIMARY 3 3 1 50 +test/t2 5 1 PRIMARY 3 3 1 50 +test/t3 5 41 PRIMARY 3 3 1 50 +test/t4 5 33 PRIMARY 3 3 1 50 +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t1.ibd +test/t2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t2.ibd +test/t3 DEFAULT 8192 MYSQLD_DATADIR/test/t3.ibd +test/t4 DEFAULT DEFAULT MYSQLD_DATADIR/test/t4.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +DROP TABLE t1, t2, t3, t4; +# Test 4) The maximum row size is dependent upon the page size. +# Each row format has its own amount of overhead that +# varies depending on number of fields and other overhead. +SET SESSION innodb_strict_mode = ON; +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(211) +) ROW_FORMAT=redundant; +DROP TABLE t1; +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(212) +) ROW_FORMAT=redundant; +ERROR 42000: Row size too large (> 8123). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246) +) ROW_FORMAT=compact; +DROP TABLE t1; +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247) +) ROW_FORMAT=compact; +ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(196) +) ROW_FORMAT=compressed; +DROP TABLE t1; +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(200), c40 char(160) +) ROW_FORMAT=compressed; +ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(246) +) ROW_FORMAT=dynamic; +DROP TABLE t1; +CREATE TABLE t1 ( +c01 char(200), c02 char(200), c03 char(200), c04 char(200), c05 char(200), +c06 char(200), c07 char(200), c08 char(200), c09 char(200), c10 char(200), +c11 char(200), c12 char(200), c13 char(200), c14 char(200), c15 char(200), +c16 char(200), c17 char(200), c18 char(200), c19 char(200), c20 char(200), +c21 char(200), c22 char(200), c23 char(200), c24 char(200), c25 char(200), +c26 char(200), c27 char(200), c28 char(200), c29 char(200), c30 char(200), +c31 char(200), c32 char(200), c33 char(200), c34 char(200), c35 char(200), +c36 char(200), c37 char(200), c38 char(200), c39 char(250), c40 char(247) +) ROW_FORMAT=dynamic; +ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +CREATE TABLE t1 (a varchar(255) character set utf8, +b varchar(255) character set utf8, +c varchar(255) character set utf8, +d varchar(255) character set utf8, +e varchar(4) character set utf8, +PRIMARY KEY (a,b,c,d,e)) +ENGINE=innodb; +DROP TABLE t1; +CREATE TABLE t1 (a varchar(255) character set utf8, +b varchar(255) character set utf8, +c varchar(255) character set utf8, +d varchar(255) character set utf8, +e varchar(5) character set utf8, +PRIMARY KEY (a,b,c,d,e)) +ENGINE=innodb; +ERROR 42000: Specified key was too long; max key length is 3072 bytes +CREATE TABLE t1 (a varchar(255) character set utf8, +b varchar(255) character set utf8, +c varchar(255) character set utf8, +d varchar(255) character set utf8, +e varchar(255) character set utf8, +f varchar(4) character set utf8, +PRIMARY KEY (a), KEY (b,c,d,e,f)) +ENGINE=innodb; +DROP TABLE t1; +CREATE TABLE t1 (a varchar(255) character set utf8, +b varchar(255) character set utf8, +c varchar(255) character set utf8, +d varchar(255) character set utf8, +e varchar(255) character set utf8, +f varchar(5) character set utf8, +PRIMARY KEY (a), KEY (b,c,d,e,f)) +ENGINE=innodb; +ERROR 42000: Specified key was too long; max key length is 3072 bytes +# Test 5) KEY_BLOCK_SIZE validation +CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=16 +ALTER TABLE t1 KEY_BLOCK_SIZE=8; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=8 +ALTER TABLE t1 KEY_BLOCK_SIZE=4; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=4 +ALTER TABLE t1 KEY_BLOCK_SIZE=2; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=2 +ALTER TABLE t1 KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=1 +ALTER TABLE t1 KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED +DROP TABLE t1; +SET SESSION innodb_strict_mode = OFF; +CREATE TABLE t1 (i int) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=16 +ALTER TABLE t1 KEY_BLOCK_SIZE=8; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=8 +ALTER TABLE t1 KEY_BLOCK_SIZE=4; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=4 +ALTER TABLE t1 KEY_BLOCK_SIZE=2; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=2 +ALTER TABLE t1 KEY_BLOCK_SIZE=1; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED key_block_size=1 +ALTER TABLE t1 KEY_BLOCK_SIZE=0; +SHOW WARNINGS; +Level Code Message +SELECT table_name, row_format, create_options +FROM information_schema.tables WHERE table_name = 't1'; +table_name row_format create_options +t1 Compressed row_format=COMPRESSED +DROP TABLE t1; +# Test 6) KEY_BLOCK_SIZE with innodb_file_per_table=OFF +SET SESSION innodb_strict_mode = ON; +SET GLOBAL innodb_file_per_table = OFF; +SHOW VARIABLES LIKE 'innodb_file_per_table'; +Variable_name Value +innodb_file_per_table OFF +CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8; +ERROR HY000: Can't create table `test`.`t4` (errno: 140 "Wrong create options") +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16; +ERROR HY000: Can't create table `test`.`t5` (errno: 140 "Wrong create options") +SHOW WARNINGS; +Level Code Message +Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. +Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options") +Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB +SET GLOBAL innodb_file_per_table = ON; +# Test 7) This series of tests were moved from innodb-index to here +# because the second alter table t1 assumes a 16k page size. +# Moving the test allows the rest of innodb-index to be run on all +# page sizes. The previously disabled portions of this test were +# moved as well. +CREATE TABLE t2(d varchar(17) PRIMARY KEY) ENGINE=innodb DEFAULT CHARSET=utf8; +CREATE TABLE t3(a int PRIMARY KEY) ENGINE=innodb; +INSERT INTO t3 VALUES (22),(44),(33),(55),(66); +INSERT INTO t2 VALUES ('jejdkrun87'),('adfd72nh9k'), +('adfdpplkeock'),('adfdijnmnb78k'),('adfdijn0loKNHJik'); +CREATE TABLE t1(a int, b blob, c text, d text NOT NULL) +ENGINE=innodb DEFAULT CHARSET=utf8 STATS_PERSISTENT=0; +INSERT INTO t1 +SELECT a,LEFT(REPEAT(d,100*a),65535),REPEAT(d,20*a),d FROM t2,t3 order by a, d; +DROP TABLE t2, t3; +SELECT COUNT(*) FROM t1 WHERE a=44; +COUNT(*) +5 +SELECT a, +LENGTH(b),b=LEFT(REPEAT(d,100*a),65535),LENGTH(c),c=REPEAT(d,20*a),d FROM t1 +ORDER BY 1, 2, 3, 4, 5, 6; +a LENGTH(b) b=LEFT(REPEAT(d,100*a),65535) LENGTH(c) c=REPEAT(d,20*a) d +22 22000 1 4400 1 adfd72nh9k +22 22000 1 4400 1 jejdkrun87 +22 26400 1 5280 1 adfdpplkeock +22 28600 1 5720 1 adfdijnmnb78k +22 35200 1 7040 1 adfdijn0loKNHJik +33 33000 1 6600 1 adfd72nh9k +33 33000 1 6600 1 jejdkrun87 +33 39600 1 7920 1 adfdpplkeock +33 42900 1 8580 1 adfdijnmnb78k +33 52800 1 10560 1 adfdijn0loKNHJik +44 44000 1 8800 1 adfd72nh9k +44 44000 1 8800 1 jejdkrun87 +44 52800 1 10560 1 adfdpplkeock +44 57200 1 11440 1 adfdijnmnb78k +44 65535 1 14080 1 adfdijn0loKNHJik +55 55000 1 11000 1 adfd72nh9k +55 55000 1 11000 1 jejdkrun87 +55 65535 1 13200 1 adfdpplkeock +55 65535 1 14300 1 adfdijnmnb78k +55 65535 1 17600 1 adfdijn0loKNHJik +66 65535 1 13200 1 adfd72nh9k +66 65535 1 13200 1 jejdkrun87 +66 65535 1 15840 1 adfdpplkeock +66 65535 1 17160 1 adfdijnmnb78k +66 65535 1 21120 1 adfdijn0loKNHJik +ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20)); +ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +DELETE FROM t1 WHERE d='null'; +ALTER TABLE t1 ADD PRIMARY KEY (a), ADD KEY (b(20)); +ERROR 23000: Duplicate entry '22' for key 'PRIMARY' +DELETE FROM t1 WHERE a%2; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +ALTER TABLE t1 ADD PRIMARY KEY (a,b(255),c(255)), ADD KEY (b(767)); +SELECT COUNT(*) FROM t1 WHERE a=44; +COUNT(*) +5 +SELECT a, +LENGTH(b), b=LEFT(REPEAT(d,100*a), 65535),LENGTH(c), c=REPEAT(d,20*a), d FROM t1; +a LENGTH(b) b=LEFT(REPEAT(d,100*a), 65535) LENGTH(c) c=REPEAT(d,20*a) d +22 22000 1 4400 1 adfd72nh9k +22 35200 1 7040 1 adfdijn0loKNHJik +22 28600 1 5720 1 adfdijnmnb78k +22 26400 1 5280 1 adfdpplkeock +22 22000 1 4400 1 jejdkrun87 +44 44000 1 8800 1 adfd72nh9k +44 65535 1 14080 1 adfdijn0loKNHJik +44 57200 1 11440 1 adfdijnmnb78k +44 52800 1 10560 1 adfdpplkeock +44 44000 1 8800 1 jejdkrun87 +66 65535 1 13200 1 adfd72nh9k +66 65535 1 21120 1 adfdijn0loKNHJik +66 65535 1 17160 1 adfdijnmnb78k +66 65535 1 15840 1 adfdpplkeock +66 65535 1 13200 1 jejdkrun87 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL, + `b` blob NOT NULL, + `c` text NOT NULL, + `d` text NOT NULL, + PRIMARY KEY (`a`,`b`(255),`c`(255)), + KEY `b` (`b`(767)) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci STATS_PERSISTENT=0 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range b b 769 NULL # Using where +DROP TABLE t1; +# Test 8) Test creating a table that could lead to undo log overflow. +CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob, +h blob,i blob,j blob,k blob,l blob,m blob,n blob, +o blob,p blob,q blob,r blob,s blob,t blob,u blob) +ENGINE=InnoDB ROW_FORMAT=dynamic; +SET @a = repeat('a', 767); +SET @b = repeat('b', 767); +SET @c = repeat('c', 767); +SET @d = repeat('d', 767); +SET @e = repeat('e', 767); +INSERT INTO t1 VALUES (@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a,@a); +UPDATE t1 SET a=@b,b=@b,c=@b,d=@b,e=@b,f=@b,g=@b,h=@b,i=@b,j=@b, +k=@b,l=@b,m=@b,n=@b,o=@b,p=@b,q=@b,r=@b,s=@b,t=@b,u=@b; +CREATE INDEX t1a ON t1 (a(767)); +CREATE INDEX t1b ON t1 (b(767)); +CREATE INDEX t1c ON t1 (c(767)); +CREATE INDEX t1d ON t1 (d(767)); +CREATE INDEX t1e ON t1 (e(767)); +UPDATE t1 SET a=@c,b=@c,c=@c,d=@c,e=@c,f=@c,g=@c,h=@c,i=@c,j=@c, +k=@c,l=@c,m=@c,n=@c,o=@c,p=@c,q=@c,r=@c,s=@c,t=@c,u=@c; +CREATE INDEX t1f ON t1 (f(767)); +BEGIN; +UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d,f=@d,g=@d,h=@d,i=@d,j=@d, +k=@d,l=@d,m=@d,n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d; +ROLLBACK; +BEGIN; +UPDATE t1 SET a=@d,b=@d,c=@d,d=@d,e=@d; +UPDATE t1 SET f=@d,g=@d,h=@d,i=@d,j=@d,k=@d,l=@d,m=@d, +n=@d,o=@d,p=@d,q=@d,r=@d,s=@d,t=@d,u=@d; +COMMIT; +CREATE INDEX t1g ON t1 (g(767)); +UPDATE t1 SET g=@e; +CREATE INDEX t1h ON t1 (h(767)); +UPDATE t1 SET h=@e; +CREATE INDEX t1i ON t1 (i(767)); +UPDATE t1 SET i=@e; +CREATE INDEX t1j ON t1 (j(767)); +UPDATE t1 SET j=@e; +CREATE INDEX t1k ON t1 (k(767)); +UPDATE t1 SET k=@e; +CREATE INDEX t1l ON t1 (l(767)); +UPDATE t1 SET l=@e; +CREATE INDEX t1m ON t1 (m(767)); +UPDATE t1 SET m=@e; +CREATE INDEX t1n ON t1 (n(767)); +UPDATE t1 SET n=@e; +CREATE INDEX t1o ON t1 (o(767)); +UPDATE t1 SET o=@e; +CREATE INDEX t1p ON t1 (p(767)); +UPDATE t1 SET p=@e; +CREATE INDEX t1q ON t1 (q(767)); +UPDATE t1 SET q=@e; +CREATE INDEX t1r ON t1 (r(767)); +UPDATE t1 SET r=@e; +CREATE INDEX t1s ON t1 (s(767)); +UPDATE t1 SET s=@e; +CREATE INDEX t1t ON t1 (t(767)); +BEGIN; +UPDATE t1 SET t=@e; +ROLLBACK; +CREATE INDEX t1u ON t1 (u(767)); +CREATE INDEX t1ut ON t1 (u(767), t(767)); +CREATE INDEX t1st ON t1 (s(767), t(767)); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` blob DEFAULT NULL, + `b` blob DEFAULT NULL, + `c` blob DEFAULT NULL, + `d` blob DEFAULT NULL, + `e` blob DEFAULT NULL, + `f` blob DEFAULT NULL, + `g` blob DEFAULT NULL, + `h` blob DEFAULT NULL, + `i` blob DEFAULT NULL, + `j` blob DEFAULT NULL, + `k` blob DEFAULT NULL, + `l` blob DEFAULT NULL, + `m` blob DEFAULT NULL, + `n` blob DEFAULT NULL, + `o` blob DEFAULT NULL, + `p` blob DEFAULT NULL, + `q` blob DEFAULT NULL, + `r` blob DEFAULT NULL, + `s` blob DEFAULT NULL, + `t` blob DEFAULT NULL, + `u` blob DEFAULT NULL, + KEY `t1a` (`a`(767)), + KEY `t1b` (`b`(767)), + KEY `t1c` (`c`(767)), + KEY `t1d` (`d`(767)), + KEY `t1e` (`e`(767)), + KEY `t1f` (`f`(767)), + KEY `t1g` (`g`(767)), + KEY `t1h` (`h`(767)), + KEY `t1i` (`i`(767)), + KEY `t1j` (`j`(767)), + KEY `t1k` (`k`(767)), + KEY `t1l` (`l`(767)), + KEY `t1m` (`m`(767)), + KEY `t1n` (`n`(767)), + KEY `t1o` (`o`(767)), + KEY `t1p` (`p`(767)), + KEY `t1q` (`q`(767)), + KEY `t1r` (`r`(767)), + KEY `t1s` (`s`(767)), + KEY `t1t` (`t`(767)), + KEY `t1u` (`u`(767)), + KEY `t1ut` (`u`(767),`t`(767)), + KEY `t1st` (`s`(767),`t`(767)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +DROP TABLE t1; +# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE +CREATE TABLE bug12547647( +a int NOT NULL, b blob NOT NULL, c text, +PRIMARY KEY (b(10), a), INDEX (c(767)), INDEX(b(767)) +) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; +INSERT INTO bug12547647 VALUES (5,REPEAT('khdfo5AlOq',1900),REPEAT('g',7751)); +COMMIT; +BEGIN; +UPDATE bug12547647 SET c = REPEAT('b',16928); +SHOW WARNINGS; +Level Code Message +ROLLBACK; +DROP TABLE bug12547647; +SET SESSION innodb_strict_mode = OFF; +CREATE TABLE t1( +pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48), +pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48), +pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48), +pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48), +sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48), +sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48), +sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48), +sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48), +PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08, +pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16), +KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08, +sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16)) +ROW_FORMAT=Redundant ENGINE=InnoDB; +Warnings: +Warning 1280 Name 'pk' ignored for PRIMARY key. +SET @r = repeat('a', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('b', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('c', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('d', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('e', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +DELETE from t1; +DROP TABLE t1; +CREATE TABLE t1( +pk01 varchar(48), pk02 varchar(48), pk03 varchar(48), pk04 varchar(48), +pk05 varchar(48), pk06 varchar(48), pk07 varchar(48), pk08 varchar(48), +pk09 varchar(48), pk10 varchar(48), pk11 varchar(48), pk12 varchar(48), +pk13 varchar(48), pk14 varchar(48), pk15 varchar(48), pk16 varchar(48), +sk01 varchar(48), sk02 varchar(48), sk03 varchar(48), sk04 varchar(48), +sk05 varchar(48), sk06 varchar(48), sk07 varchar(48), sk08 varchar(48), +sk09 varchar(48), sk10 varchar(48), sk11 varchar(48), sk12 varchar(48), +sk13 varchar(48), sk14 varchar(48), sk15 varchar(48), sk16 varchar(48), +PRIMARY KEY pk(pk01,pk02,pk03,pk04,pk05,pk06,pk07,pk08, +pk09,pk10,pk11,pk12,pk13,pk14,pk15,pk16), +KEY pk(sk01,sk02,sk03,sk04,sk05,sk06,sk07,sk08, +sk09,sk10,sk11,sk12,sk13,sk14,sk15,sk16)) +ROW_FORMAT=Compressed KEY_BLOCK_SIZE=4 ENGINE=InnoDB; +Warnings: +Warning 1280 Name 'pk' ignored for PRIMARY key. +SET @r = repeat('a', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('b', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('c', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('d', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +SET @r = repeat('e', 48); +INSERT INTO t1 VALUES(@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r, +@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r); +DELETE from t1; +DROP TABLE t1; +CREATE TABLE t1( +c text NOT NULL, d text NOT NULL, +PRIMARY KEY (c(767),d(767))) +ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; +Warnings: +Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +DROP TABLE t1; +CREATE TABLE t1( +c text NOT NULL, d text NOT NULL, +PRIMARY KEY (c(767),d(767))) +ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 CHARSET=ASCII; +Warnings: +Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +DROP TABLE t1; +CREATE TABLE t1( +c text NOT NULL, d text NOT NULL, +PRIMARY KEY (c(767),d(767))) +ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4 CHARSET=ASCII; +DROP TABLE t1; +CREATE TABLE t1(c text, PRIMARY KEY (c(440))) +ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; +Warnings: +Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. +DROP TABLE t1; +CREATE TABLE t1(c text, PRIMARY KEY (c(293))) +ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; +INSERT INTO t1 VALUES(REPEAT('A',512)),(REPEAT('B',512)); +DROP TABLE t1; +# +# MDEV-28950 Assertion `*err == DB_SUCCESS' in btr_page_split_and_insert +# +CREATE TABLE t1(c CHAR(255) NOT NULL) ENGINE=InnoDB; +INSERT INTO t1 VALUES (''); +ALTER TABLE t1 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +INSERT INTO t1 VALUES (''),(''),(''); +SET @save_innodb_compression_level= @@innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +INSERT INTO t1 VALUES (''); +SET GLOBAL innodb_compression_level= @save_innodb_compression_level; +DROP TABLE t1; +# +# MDEV-31158 Assertion ...MTR_MEMO_X_LOCKED in btr_attach_half_pages() +# +SET @save_compression_level=@@GLOBAL.innodb_compression_level; +SET GLOBAL innodb_compression_level=0; +CREATE TEMPORARY TABLE t(a SERIAL, prefix VARBINARY(4), pad INT); +INSERT INTO t(prefix, pad) VALUES +(_binary 0xff,160),('',19),(_binary 0x0001,253),(_binary 0x0b11,169), +(_binary 0x0b010001,23),(_binary 0x0b100001,251),(_binary 0x0d,163), +(_binary 0xb3,254),(_binary 0x96,254),(_binary 0xeb,61), +(_binary 0xf231,253),(_binary 0x1db0,253),(_binary 0x0005,101), +(_binary 0x6370,253),(_binary 0x0b12,112),(_binary 0x0b010002,23), +(_binary 0x0b100002,80),(_binary 0x181984,163),(_binary 0x181926,168), +(_binary 0xe1,176),(_binary 0xe2,187),(_binary 0xe6,254),(_binary 0xbb,51), +(_binary 0x1c,248),(_binary 0x8a,94),(_binary 0x14,254); +CREATE TABLE u(a SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT, +b VARBINARY(255), KEY(b)) ENGINE=InnoDB +KEY_BLOCK_SIZE=1 ROW_FORMAT=COMPRESSED; +INSERT INTO u SELECT a,CONCAT(prefix,REPEAT(chr(0),pad)) FROM t; +DROP TABLE u, t; +SET GLOBAL innodb_compression_level=@save_compression_level; +# End of 10.6 tests diff --git a/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result new file mode 100644 index 00000000..43a63a29 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/prefix_index_liftedlimit.result @@ -0,0 +1,1420 @@ +call mtr.add_suppression('InnoDB: Cannot add field.*because after adding it, the row size is'); +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM +INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ; +COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE +col_1_varchar PRIMARY 3072 BTREE +col_1_varchar prefix_idx 3072 BTREE +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743; +col_1_varchar = REPEAT("c", 4000) +0 +1 +ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +ALTER TABLE worklog5743 ROW_FORMAT=COMPACT; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +ALTER TABLE worklog5743 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT (4000) , col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072)); +SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM +INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ; +COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE +col_1_text PRIMARY 3072 BTREE +col_1_text prefix_idx 3072 BTREE +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) +FROM worklog5743; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743; +col_1_text = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_mediumtext MEDIUMTEXT , col_2_mediumtext MEDIUMTEXT , +PRIMARY KEY (col_1_mediumtext(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_mediumtext (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_mediumtext = REPEAT("a", 4000),col_2_mediumtext = REPEAT("o", 4000) +FROM worklog5743; +col_1_mediumtext = REPEAT("a", 4000) col_2_mediumtext = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_mediumtext = REPEAT("c", 4000) +WHERE col_1_mediumtext = REPEAT("a", 4000) +AND col_2_mediumtext = REPEAT("o", 4000); +SELECT col_1_mediumtext = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_mediumtext = REPEAT("c", 4000) +AND col_2_mediumtext = REPEAT("o", 4000); +col_1_mediumtext = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_mediumtext = REPEAT("b", 4000); +SELECT col_1_mediumtext = REPEAT("c", 4000) FROM worklog5743; +col_1_mediumtext = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_longtext LONGTEXT , col_2_longtext LONGTEXT , +PRIMARY KEY (col_1_longtext(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_longtext (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_longtext = REPEAT("a", 4000) , col_2_longtext = REPEAT("o", 4000) +FROM worklog5743; +col_1_longtext = REPEAT("a", 4000) col_2_longtext = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_longtext = REPEAT("c", 4000) +WHERE col_1_longtext = REPEAT("a", 4000) +AND col_2_longtext = REPEAT("o", 4000); +SELECT col_1_longtext = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_longtext = REPEAT("c", 4000) +AND col_2_longtext = REPEAT("o", 4000); +col_1_longtext = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_longtext = REPEAT("b", 4000); +SELECT col_1_longtext = REPEAT("c", 4000) FROM worklog5743; +col_1_longtext = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_blob BLOB (4000) , col_2_blob BLOB (4000) , +PRIMARY KEY (col_1_blob(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_blob (3072)); +SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE FROM +INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ; +COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE +col_1_blob PRIMARY 3072 BTREE +col_1_blob prefix_idx 3072 BTREE +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000) +FROM worklog5743; +col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_blob = REPEAT("c", 4000) +WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000); +SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000); +col_1_blob = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_blob = REPEAT("b", 4000); +SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743; +col_1_blob = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_mediumblob MEDIUMBLOB , col_2_mediumblob MEDIUMBLOB , +PRIMARY KEY (col_1_mediumblob(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_mediumblob (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_mediumblob = REPEAT("a", 4000),col_2_mediumblob = REPEAT("o", 4000) +FROM worklog5743; +col_1_mediumblob = REPEAT("a", 4000) col_2_mediumblob = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_mediumblob = REPEAT("c", 4000) +WHERE col_1_mediumblob = REPEAT("a", 4000) +AND col_2_mediumblob = REPEAT("o", 4000); +SELECT col_1_mediumblob = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_mediumblob = REPEAT("c", 4000) +AND col_2_mediumblob = REPEAT("o", 4000); +col_1_mediumblob = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_mediumblob = REPEAT("b", 4000); +SELECT col_1_mediumblob = REPEAT("c", 4000) FROM worklog5743; +col_1_mediumblob = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_longblob LONGBLOB , col_2_longblob LONGBLOB , +PRIMARY KEY (col_1_longblob(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_longblob (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_longblob = REPEAT("a", 4000) , col_2_longblob = REPEAT("o", 4000) +FROM worklog5743; +col_1_longblob = REPEAT("a", 4000) col_2_longblob = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_longblob = REPEAT("c", 4000) +WHERE col_1_longblob = REPEAT("a", 4000) +AND col_2_longblob = REPEAT("o", 4000); +SELECT col_1_longblob = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_longblob = REPEAT("c", 4000) +AND col_2_longblob = REPEAT("o", 4000); +col_1_longblob = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_longblob = REPEAT("b", 4000); +SELECT col_1_longblob = REPEAT("c", 4000) FROM worklog5743; +col_1_longblob = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) , +PRIMARY KEY (col_1_varbinary(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varbinary = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varbinary = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743; +col_1_varbinary = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 (col_1_char CHAR (255) , col_2_char CHAR (255), +col_3_char CHAR (255), col_4_char CHAR (255),col_5_char CHAR (255), +col_6_char CHAR (255), col_7_char CHAR (255),col_8_char CHAR (255), +col_9_char CHAR (255), col_10_char CHAR (255),col_11_char CHAR (255), +col_12_char CHAR (255), col_13_char CHAR (255),col_14_char CHAR (255) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255) +); +CREATE INDEX prefix_idx ON worklog5743(col_1_char(250),col_2_char(250), +col_3_char(250),col_4_char(250),col_5_char(250),col_6_char(250), +col_7_char(250),col_8_char(250),col_9_char(250),col_10_char(250), +col_11_char(250),col_12_char(250),col_13_char(72) +); +INSERT INTO worklog5743 VALUES(REPEAT("b", 255) , REPEAT("p", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255) +); +SELECT col_1_char = REPEAT("a", 255) , col_2_char = REPEAT("o", 255) FROM worklog5743; +col_1_char = REPEAT("a", 255) col_2_char = REPEAT("o", 255) +1 1 +0 0 +UPDATE worklog5743 SET col_1_char = REPEAT("c", 255) +WHERE col_1_char = REPEAT("a", 255) AND col_2_char = REPEAT("o", 255); +SELECT col_1_char = REPEAT("c", 255) FROM worklog5743 +WHERE col_1_char = REPEAT("c", 255) AND col_2_char = REPEAT("o", 255); +col_1_char = REPEAT("c", 255) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255),REPEAT("a", 255) +); +DELETE FROM worklog5743 WHERE col_1_char = REPEAT("b", 255); +SELECT col_1_char = REPEAT("c", 255) FROM worklog5743; +col_1_char = REPEAT("c", 255) +1 +0 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 (col_1_binary BINARY (255) , col_2_binary BINARY (255), +col_3_binary BINARY(255),col_4_binary BINARY (255),col_5_binary BINARY (255), +col_6_binary BINARY(255),col_7_binary BINARY (255),col_8_binary BINARY (255), +col_9_binary BINARY(255),col_10_binary BINARY (255),col_11_binary BINARY (255), +col_12_binary BINARY(255),col_13_binary BINARY (255),col_14_binary BINARY (255) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255) +); +CREATE INDEX prefix_idx ON worklog5743(col_1_binary (250),col_2_binary (250), +col_3_binary (250),col_4_binary (250),col_5_binary (250), +col_6_binary (250),col_7_binary (250),col_8_binary (250), +col_9_binary (250),col_10_binary (250),col_11_binary (250), +col_12_binary (250),col_13_binary (72) +); +INSERT INTO worklog5743 VALUES(REPEAT("b", 255) , REPEAT("p", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255) +); +SELECT col_1_binary = REPEAT("a", 255) , col_2_binary = REPEAT("o", 255) FROM worklog5743; +col_1_binary = REPEAT("a", 255) col_2_binary = REPEAT("o", 255) +1 1 +0 0 +UPDATE worklog5743 SET col_1_binary = REPEAT("c", 255) +WHERE col_1_binary = REPEAT("a", 255) +AND col_2_binary = REPEAT("o", 255); +SELECT col_1_binary = REPEAT("c", 255) FROM worklog5743 +WHERE col_1_binary = REPEAT("c", 255) +AND col_2_binary = REPEAT("o", 255); +col_1_binary = REPEAT("c", 255) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 255) , REPEAT("o", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255), +REPEAT("a", 255) , REPEAT("o", 255), REPEAT("a", 255) +); +DELETE FROM worklog5743 WHERE col_1_binary = REPEAT("b", 255); +SELECT col_1_binary = REPEAT("c", 255) FROM worklog5743; +col_1_binary = REPEAT("c", 255) +1 +0 +DROP TABLE worklog5743; +CREATE TABLE worklog5743_key2 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(801)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb; +INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743_key2; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key2 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key2 +WHERE col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key2 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key2; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key2; +CREATE TABLE worklog5743_key4 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(1825)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb; +INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743_key4; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key4 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) +AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743_key4 +WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key4 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key4; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key4; +CREATE TABLE worklog5743_key8 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(3072)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb; +INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743_key8; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key8 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743_key8 +WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key8 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743_key8; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key8; +CREATE TABLE worklog5743_key2 ( +col_1_text TEXT (4000) , col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(801)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb; +INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) +FROM worklog5743_key2; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key2 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key2 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key2 WHERE col_1_text = REPEAT("b", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key2; +col_1_text = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key2; +CREATE TABLE worklog5743_key4 ( +col_1_text TEXT (4000) , col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(1825)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb; +INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) +FROM worklog5743_key4; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key4 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key4 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key4 WHERE col_1_text = REPEAT("b", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key4; +col_1_text = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key4; +CREATE TABLE worklog5743_key8 ( +col_1_text TEXT (4000) , col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(3072)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb; +INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) +FROM worklog5743_key8; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key8 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("b", 3500) FROM worklog5743_key8 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key8 WHERE col_1_text = REPEAT("b", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743_key8; +col_1_text = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key8; +CREATE TABLE worklog5743_key2 ( +col_1_blob BLOB (4000) , col_2_blob BLOB (4000) , +PRIMARY KEY (col_1_blob(801)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb; +INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key2 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000) +FROM worklog5743_key2; +col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key2 SET col_1_blob = REPEAT("c", 4000) +WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000); +SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key2 +WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000); +col_1_blob = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key2 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key2 WHERE col_1_blob = REPEAT("b", 4000); +SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key2; +col_1_blob = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key2; +CREATE TABLE worklog5743_key4 ( +col_1_blob BLOB (4000) , col_2_blob BLOB (4000) , +PRIMARY KEY (col_1_blob(1825)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4, engine = innodb; +INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key4 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000) +FROM worklog5743_key4; +col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key4 SET col_1_blob = REPEAT("c", 4000) +WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000); +SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key4 +WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000); +col_1_blob = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key4 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key4 WHERE col_1_blob = REPEAT("b", 4000); +SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key4; +col_1_blob = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key4; +CREATE TABLE worklog5743_key8 ( +col_1_blob BLOB (4000) , col_2_blob BLOB (4000) , +PRIMARY KEY (col_1_blob(3072)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8, engine = innodb; +INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743_key8 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_blob = REPEAT("a", 4000) , col_2_blob = REPEAT("o", 4000) +FROM worklog5743_key8; +col_1_blob = REPEAT("a", 4000) col_2_blob = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743_key8 SET col_1_blob = REPEAT("c", 4000) +WHERE col_1_blob = REPEAT("a", 4000) AND col_2_blob = REPEAT("o", 4000); +SELECT col_1_blob = REPEAT("b", 3500) FROM worklog5743_key8 +WHERE col_1_blob = REPEAT("c", 4000) AND col_2_blob = REPEAT("o", 4000); +col_1_blob = REPEAT("b", 3500) +0 +INSERT INTO worklog5743_key8 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743_key8 WHERE col_1_blob = REPEAT("b", 4000); +SELECT col_1_blob = REPEAT("c", 4000) FROM worklog5743_key8; +col_1_blob = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743_key8; +CREATE TABLE worklog5743 ( +col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) , +col_3_text TEXT (4000), col_4_blob BLOB (4000), col_5_text TEXT (4000), +col_6_varchar VARCHAR (4000), col_7_binary BINARY (255) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +CREATE INDEX prefix_idx1 ON worklog5743(col_1_varbinary (3072)); +CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743; +col_1_varbinary = REPEAT("c", 4000) +1 +0 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072)); +CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072)); +CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072)); +BEGIN; +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SHOW WARNINGS; +Level Code Message +ROLLBACK; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varbinary VARBINARY (4000) , col_2_varchar VARCHAR (4000) , +col_3_text TEXT (4000), col_4_blob BLOB (4000),col_5_text TEXT (4000), +col_6_varchar VARCHAR (4000), col_7_binary BINARY (255) +) ROW_FORMAT=DYNAMIC, engine = innodb; +CREATE INDEX prefix_idx1 ON worklog5743(col_1_varbinary (3072)); +CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (3072)); +CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (3072)); +CREATE INDEX prefix_idx4 ON worklog5743(col_4_blob (3072)); +CREATE INDEX prefix_idx5 ON worklog5743(col_5_text (3072)); +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +ROLLBACK; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +COMMIT; +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +ROLLBACK; +BEGIN; +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) +AND col_2_varchar = REPEAT("o", 4000); +SHOW WARNINGS; +Level Code Message +ROLLBACK; +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743; +col_1_varbinary = REPEAT("c", 4000) +0 +0 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT (4000) CHARACTER SET 'utf8', +col_2_text TEXT (4000) CHARACTER SET 'utf8', +PRIMARY KEY (col_1_text(1024)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_text (1024)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) FROM worklog5743; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743; +col_1_text = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 (col_1_varchar VARCHAR (4000) CHARACTER SET 'utf8', +col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8' , +PRIMARY KEY (col_1_varchar(1024)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1024)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) FROM worklog5743; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varbinary VARBINARY (4000) , +col_2_varchar VARCHAR (4000) CHARACTER SET 'utf8', +col_3_text TEXT (4000) CHARACTER SET 'utf8', +col_4_blob BLOB (4000),col_5_text TEXT (4000), +col_6_varchar VARCHAR (4000), col_7_binary BINARY (255) +) ROW_FORMAT=DYNAMIC, engine = innodb; +CREATE INDEX prefix_idx2 ON worklog5743(col_2_varchar (500)); +CREATE INDEX prefix_idx3 ON worklog5743(col_3_text (500)); +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +ROLLBACK; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +COMMIT; +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +ROLLBACK; +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) +AND col_2_varchar = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000), +REPEAT("a", 4000) , REPEAT("o", 4000), REPEAT("a", 4000), +REPEAT("a", 4000) , REPEAT("a", 255) +); +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("b", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743; +col_1_varbinary = REPEAT("c", 4000) +0 +0 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT (4000) CHARACTER SET 'utf8', +col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(1024)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("स", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_text (1024)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("स", 4000) , col_2_text = REPEAT("o", 4000) +FROM worklog5743; +col_1_text = REPEAT("स", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_text = REPEAT("क", 4000) +WHERE col_1_text = REPEAT("स", 4000) AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("क", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("क", 4000) +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 4000); +SELECT col_1_text = REPEAT("क", 4000) FROM worklog5743; +col_1_text = REPEAT("क", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT(4000) , col_2_text TEXT(4000) , +PRIMARY KEY (col_1_text(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200)); +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +connect con1,localhost,root,,; +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +connect con2,localhost,root,,; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200)); +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +0 1 +connection con1; +select @@session.tx_isolation; +@@session.tx_isolation +REPEATABLE-READ +SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200) +0 1 +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200) +0 1 +1 1 +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +START TRANSACTION; +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +connection con2; +COMMIT; +connection con1; +SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200) +0 1 +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +COMMIT; +connection default; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT(4000) , col_2_text TEXT(4000) , +PRIMARY KEY (col_1_text(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200)); +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +connection con1; +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +START TRANSACTION; +connection con2; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200)); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200); +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +0 1 +COMMIT; +connection con1; +SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; +select @@session.tx_isolation; +@@session.tx_isolation +READ-UNCOMMITTED +SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200) +1 1 +SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ; +SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200) +1 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +COMMIT; +connection default; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT(4000) , col_2_text TEXT(4000) , +PRIMARY KEY (col_1_text(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200)); +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +connection con1; +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +1 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +START TRANSACTION; +connection con2; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200)); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200); +SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200) +0 1 +ROLLBACK; +disconnect con2; +connection con1; +SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM +worklog5743; +col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200) +0 1 +SELECT COUNT(*) FROM worklog5743; +COUNT(*) +1 +COMMIT; +connection default; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) +AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varchar = REPEAT("c", 4000) +AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743; +col_1_varchar = REPEAT("c", 4000) +0 +0 +1 +SELECT tbl1.col_1_varchar = tbl2.col_1_varchar +FROM worklog5743 tbl1 , worklog5743 tbl2 +WHERE tbl1.col_1_varchar = tbl2.col_1_varchar ; +tbl1.col_1_varchar = tbl2.col_1_varchar +1 +1 +1 +SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 +WHERE col_1_varchar IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) ; +tbl1.col_1_varchar = REPEAT("c", 4000) +0 +0 +1 +SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 +WHERE col_1_varchar NOT IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) ; +tbl1.col_1_varchar = REPEAT("c", 4000) +SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 WHERE +col_1_varchar IN (SELECT tbl2.col_1_varchar FROM worklog5743 tbl2) +AND col_1_varchar = REPEAT("c", 4000); +tbl1.col_1_varchar = REPEAT("c", 4000) +1 +SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 +WHERE col_1_varchar in ( +SELECT tbl2.col_1_varchar FROM worklog5743 tbl2 +WHERE tbl1.col_1_varchar != tbl2.col_1_varchar +) ; +tbl1.col_1_varchar = REPEAT("c", 4000) +SELECT tbl1.col_1_varchar = REPEAT("c", 4000) FROM worklog5743 tbl1 +WHERE col_1_varchar in ( +SELECT tbl2.col_1_varchar FROM worklog5743 tbl2 +WHERE tbl1.col_1_varchar = tbl2.col_1_varchar +) ; +tbl1.col_1_varchar = REPEAT("c", 4000) +0 +0 +1 +SELECT +REVERSE(col_1_varchar) = REPEAT("c", 4000) , +REVERSE(REVERSE(col_1_varchar)) = REPEAT("c", 4000) +FROM worklog5743; +REVERSE(col_1_varchar) = REPEAT("c", 4000) REVERSE(REVERSE(col_1_varchar)) = REPEAT("c", 4000) +0 0 +0 0 +1 1 +SELECT +UPPER(col_1_varchar) = REPEAT("c", 4000) , +UPPER(col_1_varchar) = REPEAT("C", 4000) , +LOWER(UPPER(col_1_varchar)) = REPEAT("c", 4000) +FROM worklog5743; +UPPER(col_1_varchar) = REPEAT("c", 4000) UPPER(col_1_varchar) = REPEAT("C", 4000) LOWER(UPPER(col_1_varchar)) = REPEAT("c", 4000) +0 0 0 +0 0 0 +1 1 1 +SELECT +col_1_varchar = REPEAT("c", 4000) +FROM worklog5743 WHERE col_1_varchar like '%c__%'; +col_1_varchar = REPEAT("c", 4000) +1 +SELECT SUBSTRING(INSERT(col_1_varchar, 1, 4, 'kkkk'),1,10) FROM worklog5743 ; +SUBSTRING(INSERT(col_1_varchar, 1, 4, 'kkkk'),1,10) +kkkkaaaaaa +kkkkbbbbbb +kkkkcccccc +SELECT CONCAT(SUBSTRING(col_1_varchar,-5,3),'append') FROM worklog5743 ; +CONCAT(SUBSTRING(col_1_varchar,-5,3),'append') +aaaappend +bbbappend +cccappend +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , +col_2_varchar VARCHAR (4000) , +UNIQUE INDEX (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 +VALUES(concat(REPEAT("a", 2000),REPEAT("b", 1000),REPEAT("c", 1000)), REPEAT("o", 4000)); +INSERT INTO worklog5743 +VALUES(concat(REPEAT("a", 2000),REPEAT("b", 2000)), REPEAT("o", 4000)); +INSERT INTO worklog5743 VALUES(NULL,NULL); +INSERT INTO worklog5743 VALUES(NULL,NULL); +SELECT COLUMN_NAME,INDEX_NAME,SUB_PART,INDEX_TYPE +FROM INFORMATION_SCHEMA.STATISTICS WHERE table_name = 'worklog5743' ; +COLUMN_NAME INDEX_NAME SUB_PART INDEX_TYPE +col_1_varchar col_1_varchar 3072 BTREE +SELECT col_1_varchar FROM worklog5743 WHERE col_1_varchar IS NULL; +col_1_varchar +NULL +NULL +SELECT col_1_varchar = concat(REPEAT("a", 2000),REPEAT("b", 2000)) +FROM worklog5743 WHERE col_1_varchar IS NOT NULL ORDER BY 1; +col_1_varchar = concat(REPEAT("a", 2000),REPEAT("b", 2000)) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(3072))) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +DROP INDEX prefix_idx ON worklog5743; +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY `prefix_primary` (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +Warnings: +Warning 1280 Name 'prefix_primary' ignored for PRIMARY key. +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +ALTER TABLE worklog5743 DROP PRIMARY KEY; +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) +AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varchar = REPEAT("c", 4000) +AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar(3072)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...' for key 'PRIMARY' +DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY `prefix_primary` (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +Warnings: +Warning 1280 Name 'prefix_primary' ignored for PRIMARY key. +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +ALTER TABLE worklog5743 DROP PRIMARY KEY; +DROP INDEX prefix_idx ON worklog5743; +SELECT col_1_varchar = REPEAT("a", 4000) , col_2_varchar = REPEAT("o", 4000) +FROM worklog5743; +col_1_varchar = REPEAT("a", 4000) col_2_varchar = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varchar = REPEAT("c", 4000) +WHERE col_1_varchar = REPEAT("a", 4000) AND col_2_varchar = REPEAT("o", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varchar = REPEAT("c", 4000) AND col_2_varchar = REPEAT("o", 4000); +col_1_varchar = REPEAT("c", 4000) +1 +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar(3072)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...' for key 'PRIMARY' +DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 4000); +SELECT col_1_varchar = REPEAT("c", 4000) FROM worklog5743; +col_1_varchar = REPEAT("c", 4000) +0 +1 +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR(4000) , col_2_varchar VARCHAR(4000) , +PRIMARY KEY (col_1_varchar (3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("c", 3500) , REPEAT("o", 3500)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072)); +connection con1; +SELECT col_1_varchar = REPEAT("c", 3500) , col_2_varchar = REPEAT("o", 3500) +FROM worklog5743; +col_1_varchar = REPEAT("c", 3500) col_2_varchar = REPEAT("o", 3500) +1 1 +connection default; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500)); +SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743 +WHERE col_2_varchar = REPEAT("o", 3500); +col_1_varchar = REPEAT("b", 3500) +0 +0 +COMMIT; +connection con1; +START TRANSACTION; +INSERT INTO worklog5743 VALUES(REPEAT("k", 3500),REPEAT("p", 3500)); +ALTER TABLE worklog5743 DROP PRIMARY KEY; +UPDATE worklog5743 SET col_1_varchar = REPEAT("b", 3500) +WHERE col_1_varchar = REPEAT("a", 3500) +AND col_2_varchar = REPEAT("o", 3500); +SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743 +WHERE col_2_varchar = REPEAT("o", 3500); +col_1_varchar = REPEAT("b", 3500) +1 +0 +connection default; +DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 3500); +SELECT col_1_varchar = REPEAT("a", 3500) FROM worklog5743 +WHERE col_2_varchar = REPEAT("p", 3500); +col_1_varchar = REPEAT("a", 3500) +0 +connection con1; +COMMIT; +disconnect con1; +connection default; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) , +PRIMARY KEY (col_1_varbinary(3072))) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_varbinary = REPEAT("a", 4000) , col_2_varbinary = REPEAT("o", 4000) +FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) col_2_varbinary = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +1 +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +DROP INDEX prefix_idx ON worklog5743; +SELECT col_1_varbinary = REPEAT("b", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("b", 4000) +AND col_2_varbinary = REPEAT("p", 4000); +col_1_varbinary = REPEAT("b", 4000) +1 +CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (2000)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) +1 +0 +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +DROP INDEX prefix_idx ON worklog5743; +SET sql_mode = 'NO_ENGINE_SUBSTITUTION'; +CREATE INDEX prefix_idx ON worklog5743(col_1_varbinary (4000)); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +SET sql_mode = default; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_varbinary = REPEAT("a", 4000) FROM worklog5743; +col_1_varbinary = REPEAT("a", 4000) +1 +0 +UPDATE worklog5743 SET col_1_varbinary = REPEAT("c", 4000) +WHERE col_1_varbinary = REPEAT("a", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +DELETE FROM worklog5743 WHERE col_1_varbinary = REPEAT("c", 4000); +SELECT col_1_varbinary = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_varbinary = REPEAT("c", 4000) +AND col_2_varbinary = REPEAT("o", 4000); +col_1_varbinary = REPEAT("c", 4000) +DROP TABLE worklog5743; +CREATE TABLE worklog5743 (col_1_text TEXT (4000) , col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(500)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_text (3072)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) +FROM worklog5743; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) +AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +1 +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +DROP INDEX prefix_idx ON worklog5743; +SELECT col_1_text = REPEAT("b", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("b", 4000) AND col_2_text = REPEAT("p", 4000); +col_1_text = REPEAT("b", 4000) +1 +CREATE INDEX prefix_idx ON worklog5743(col_1_text (1000)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743; +col_1_text = REPEAT("a", 4000) +1 +0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +DROP INDEX prefix_idx ON worklog5743; +CREATE INDEX prefix_idx ON worklog5743(col_1_text (4000)); +Warnings: +Note 1071 Specified key was too long; max key length is 3072 bytes +SHOW CREATE TABLE worklog5743; +Table Create Table +worklog5743 CREATE TABLE `worklog5743` ( + `col_1_text` text NOT NULL, + `col_2_text` text DEFAULT NULL, + PRIMARY KEY (`col_1_text`(500)), + KEY `prefix_idx` (`col_1_text`(3072)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743; +col_1_text = REPEAT("a", 4000) +1 +0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) AND col_2_text = REPEAT("o", 4000); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_text TEXT (4000) , col_2_text TEXT (4000) , +PRIMARY KEY (col_1_text(801)) +) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2, engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000) , REPEAT("o", 4000)); +INSERT INTO worklog5743 VALUES(REPEAT("b", 4000) , REPEAT("p", 4000)); +SELECT col_1_text = REPEAT("a", 4000) , col_2_text = REPEAT("o", 4000) FROM worklog5743; +col_1_text = REPEAT("a", 4000) col_2_text = REPEAT("o", 4000) +1 1 +0 0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) +AND col_2_text = REPEAT("o", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) +AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +1 +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) +AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +ALTER TABLE worklog5743 DROP PRIMARY KEY; +SELECT col_1_text = REPEAT("b", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("b", 4000) +AND col_2_text = REPEAT("p", 4000); +col_1_text = REPEAT("b", 4000) +1 +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_text (700)); +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743; +col_1_text = REPEAT("a", 4000) +1 +0 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) +AND col_2_text = REPEAT("o", 4000); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) +AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +ALTER TABLE worklog5743 DROP PRIMARY KEY; +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_text (950)); +ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs +INSERT INTO worklog5743 VALUES(REPEAT("a", 4000),REPEAT("o", 4000)); +SELECT col_1_text = REPEAT("a", 4000) FROM worklog5743; +col_1_text = REPEAT("a", 4000) +0 +1 +UPDATE worklog5743 SET col_1_text = REPEAT("c", 4000) +WHERE col_1_text = REPEAT("a", 4000) +AND col_2_text = REPEAT("o", 4000); +DELETE FROM worklog5743 WHERE col_1_text = REPEAT("c", 4000); +SELECT col_1_text = REPEAT("c", 4000) FROM worklog5743 +WHERE col_1_text = REPEAT("c", 4000) +AND col_2_text = REPEAT("o", 4000); +col_1_text = REPEAT("c", 4000) +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , PRIMARY KEY (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +ALTER TABLE worklog5743 DROP PRIMARY KEY; +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar (900)); +ALTER TABLE worklog5743 DROP PRIMARY KEY; +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_varchar (3073)); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_BLOB BLOB (4000) , PRIMARY KEY (col_1_BLOB(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +ALTER TABLE worklog5743 DROP PRIMARY KEY; +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_BLOB (500)); +ALTER TABLE worklog5743 DROP PRIMARY KEY; +ALTER TABLE worklog5743 ADD PRIMARY KEY (col_1_BLOB (3073)); +ERROR 42000: Specified key was too long; max key length is 3072 bytes +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) +) ROW_FORMAT=DYNAMIC, engine = innodb; +INSERT INTO worklog5743 +VALUES(concat(REPEAT("a", 2000),REPEAT("b", 1000),REPEAT("c", 1000)), +REPEAT("o", 4000)); +INSERT INTO worklog5743 +VALUES(concat(REPEAT("a", 2000),REPEAT("b", 2000)), REPEAT("o", 4000)); +ALTER TABLE worklog5743 ADD PRIMARY KEY `pk_idx` (col_1_varchar(3000)); +ERROR 23000: Duplicate entry 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...' for key 'PRIMARY' +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(3072)) +) ROW_FORMAT=DYNAMIC, engine = innodb; +DROP TABLE worklog5743; +CREATE TABLE worklog5743 ( +col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) , +PRIMARY KEY (col_1_varchar(767)) +) engine = innodb; +INSERT INTO worklog5743 VALUES(REPEAT('a',4000),REPEAT('b',4000)); +CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (1000)); +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=INPLACE; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +ALTER TABLE worklog5743 ROW_FORMAT=REDUNDANT, ALGORITHM=COPY; +ERROR HY000: Index column size too large. The maximum column size is 767 bytes +SHOW CREATE TABLE worklog5743; +Table Create Table +worklog5743 CREATE TABLE `worklog5743` ( + `col_1_varchar` varchar(4000) NOT NULL, + `col_2_varchar` varchar(4000) DEFAULT NULL, + PRIMARY KEY (`col_1_varchar`(767)), + KEY `prefix_idx` (`col_1_varchar`(1000)) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +DROP TABLE worklog5743; diff --git a/mysql-test/suite/innodb_zip/r/recover.result b/mysql-test/suite/innodb_zip/r/recover.result new file mode 100644 index 00000000..fddb0705 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/recover.result @@ -0,0 +1,35 @@ +FLUSH TABLES; +# +# MDEV-21892 Assertion 'index != clust_index || row_get_rec_trx_id()' +# +connect con1,localhost,root; +CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ROW_FORMAT=COMPRESSED; +INSERT INTO t1 VALUES (1),(2); +BEGIN; +UPDATE t1 SET pk=1; +ERROR 23000: Duplicate entry '1' for key 'PRIMARY' +connection default; +# +# MDEV-12720 recovery fails with "Generic error" +# for ROW_FORMAT=compressed +# +CREATE TABLE a(i INT PRIMARY KEY AUTO_INCREMENT, s VARCHAR(255)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +BEGIN; +insert into a(i) select null; +insert into a select null, uuid() from a a, a b, a c; +insert into a select null, uuid() from a a, a b, a c; +insert into a select null, uuid() from a a, a b, a c; +SET GLOBAL innodb_flush_log_at_trx_commit=1; +COMMIT; +# restart +disconnect con1; +SELECT * FROM t1; +pk +1 +2 +DROP TABLE t1; +SELECT COUNT(*) from a; +COUNT(*) +1010 +DROP TABLE a; diff --git a/mysql-test/suite/innodb_zip/r/restart.result b/mysql-test/suite/innodb_zip/r/restart.result new file mode 100644 index 00000000..eb1bfe67 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/restart.result @@ -0,0 +1,1089 @@ +SET default_storage_engine=InnoDB; +# +# A series of tests to make sure tables are opened after restart. +# Bug#13357607 Compressed file-per-table tablespaces fail to open +# +set global innodb_file_per_table=on; +# +# Create and insert records into a REDUNDANT row formatted table. +# +CREATE TABLE t1_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=REDUNDANT ENGINE=InnoDB; +INSERT INTO t1_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); +INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); +INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); +INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); +SHOW CREATE TABLE t1_restart; +Table Create Table +t1_restart CREATE TABLE `t1_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=REDUNDANT +SELECT count(*) FROM t1_restart; +count(*) +16 +# +# Create and insert records into a COMPACT row formatted table. +# +CREATE TABLE t2_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=COMPACT ENGINE=InnoDB; +INSERT INTO t2_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); +INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); +INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); +INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); +SHOW CREATE TABLE t2_restart; +Table Create Table +t2_restart CREATE TABLE `t2_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT +SELECT count(*) FROM t2_restart; +count(*) +16 +# +# Create and insert records into a COMPRESSED row formatted table. +# +CREATE TABLE t3_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB; +INSERT INTO t3_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); +INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); +INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); +INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); +SHOW CREATE TABLE t3_restart; +Table Create Table +t3_restart CREATE TABLE `t3_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 +SELECT count(*) FROM t3_restart; +count(*) +16 +# +# Create and insert records into a DYNAMIC row formatted table. +# +CREATE TABLE t4_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=DYNAMIC ENGINE=InnoDB; +INSERT INTO t4_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +SHOW CREATE TABLE t4_restart; +Table Create Table +t4_restart CREATE TABLE `t4_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +SELECT count(*) FROM t4_restart; +count(*) +16 +# +# Create and insert records into a table that uses a remote DATA DIRECTORY. +# +CREATE TABLE t5_restart(c1 DOUBLE AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=DYNAMIC ENGINE=InnoDB DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir'; +INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +SHOW CREATE TABLE t5_restart; +Table Create Table +t5_restart CREATE TABLE `t5_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000027 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/' +SELECT count(*) FROM t5_restart; +count(*) +16 +# +# Create and insert records into a partitioned table that uses +# a remote DATA DIRECTORY for each partition. +# +CREATE TABLE t6_restart( +c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 ENGINE=InnoDB +PARTITION BY HASH(c1) ( +PARTITION p0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir', +PARTITION p1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir', +PARTITION p2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir'); +INSERT INTO t6_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); +INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); +INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); +INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); +SHOW CREATE TABLE t6_restart; +Table Create Table +t6_restart CREATE TABLE `t6_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) +SELECT count(*) FROM t6_restart; +count(*) +16 +# +# Create and insert records into a subpartitioned table that uses +# a remote DATA DIRECTORY for each subpartition. +# +CREATE TABLE t7_restart( +c1 INT AUTO_INCREMENT KEY, c2 CHAR(10), c3 VARCHAR(100), c4 DATE, c5 TEXT) +ROW_FORMAT=DYNAMIC ENGINE=InnoDB +PARTITION BY RANGE(c1) SUBPARTITION BY HASH(c1) ( +PARTITION p0 VALUES LESS THAN (10) ( +SUBPARTITION s0 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir', +SUBPARTITION s1 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir'), +PARTITION p1 VALUES LESS THAN MAXVALUE ( +SUBPARTITION s2 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir', +SUBPARTITION s3 DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir')); +INSERT INTO t7_restart VALUES (0, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); +INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); +INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); +INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); +SHOW CREATE TABLE t7_restart; +Table Create Table +t7_restart CREATE TABLE `t7_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) +SELECT count(*) FROM t7_restart; +count(*) +16 +# +# Show these tables in information_schema. +# +=== information_schema.innodb_sys_tables and innodb_sys_tablespaces === +Table Name Tablespace Table Flags Columns Row Format Zip Size +test/t1_restart test/t1_restart 0 8 Redundant 0 +test/t2_restart test/t2_restart 1 8 Compact 0 +test/t3_restart test/t3_restart 37 8 Compressed 2048 +test/t4_restart test/t4_restart 33 8 Dynamic 0 +test/t5_restart test/t5_restart 97 8 Dynamic 0 +test/t6_restart#p#p0 test/t6_restart#p#p0 101 8 Compressed 2048 +test/t6_restart#p#p1 test/t6_restart#p#p1 101 8 Compressed 2048 +test/t6_restart#p#p2 test/t6_restart#p#p2 101 8 Compressed 2048 +test/t7_restart#p#p0#sp#s0 test/t7_restart#p#p0#sp#s0 97 8 Dynamic 0 +test/t7_restart#p#p0#sp#s1 test/t7_restart#p#p0#sp#s1 97 8 Dynamic 0 +test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0 +test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0 +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t1_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t1_restart.ibd +test/t2_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t2_restart.ibd +test/t3_restart DEFAULT 2048 MYSQLD_DATADIR/test/t3_restart.ibd +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd +test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd +test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd +test/t7_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +# +# Shutdown the server and list the tablespace OS files +# +---- MYSQL_DATA_DIR/test +db.opt +t1_restart.frm +t1_restart.ibd +t2_restart.frm +t2_restart.ibd +t3_restart.frm +t3_restart.ibd +t4_restart.frm +t4_restart.ibd +t5_restart.frm +t5_restart.isl +t6_restart#p#p0.isl +t6_restart#p#p1.isl +t6_restart#p#p2.isl +t6_restart.frm +t6_restart.par +t7_restart#p#p0#sp#s0.isl +t7_restart#p#p0#sp#s1.isl +t7_restart#p#p1#sp#s2.isl +t7_restart#p#p1#sp#s3.isl +t7_restart.frm +t7_restart.par +---- MYSQL_TMP_DIR/alt_dir +test +---- MYSQL_TMP_DIR/alt_dir/test +t5_restart.ibd +t6_restart#p#p0.ibd +t6_restart#p#p1.ibd +t6_restart#p#p2.ibd +t7_restart#p#p0#sp#s0.ibd +t7_restart#p#p0#sp#s1.ibd +t7_restart#p#p1#sp#s2.ibd +t7_restart#p#p1#sp#s3.ibd +# +# Start the server and show that tables are still visible and accessible. +# +# restart +SHOW VARIABLES LIKE 'innodb_file_per_table'; +Variable_name Value +innodb_file_per_table ON +SHOW CREATE TABLE t1_restart; +Table Create Table +t1_restart CREATE TABLE `t1_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=REDUNDANT +SHOW CREATE TABLE t2_restart; +Table Create Table +t2_restart CREATE TABLE `t2_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPACT +SHOW CREATE TABLE t3_restart; +Table Create Table +t3_restart CREATE TABLE `t3_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 +SHOW CREATE TABLE t4_restart; +Table Create Table +t4_restart CREATE TABLE `t4_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +SHOW CREATE TABLE t5_restart; +Table Create Table +t5_restart CREATE TABLE `t5_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000020 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/' +SHOW CREATE TABLE t6_restart; +Table Create Table +t6_restart CREATE TABLE `t6_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) +SHOW CREATE TABLE t7_restart; +Table Create Table +t7_restart CREATE TABLE `t7_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) +INSERT INTO t1_restart (SELECT 0, c2, c3, c4, c5 FROM t1_restart); +INSERT INTO t2_restart (SELECT 0, c2, c3, c4, c5 FROM t2_restart); +INSERT INTO t3_restart (SELECT 0, c2, c3, c4, c5 FROM t3_restart); +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +INSERT INTO t6_restart (SELECT 0, c2, c3, c4, c5 FROM t6_restart); +INSERT INTO t7_restart (SELECT 0, c2, c3, c4, c5 FROM t7_restart); +SELECT count(*) FROM t1_restart; +count(*) +32 +SELECT count(*) FROM t2_restart; +count(*) +32 +SELECT count(*) FROM t3_restart; +count(*) +32 +SELECT count(*) FROM t4_restart; +count(*) +32 +SELECT count(*) FROM t5_restart; +count(*) +32 +SELECT count(*) FROM t6_restart; +count(*) +32 +SELECT count(*) FROM t7_restart; +count(*) +32 +# +# Show these tables in information_schema. +# +=== information_schema.innodb_sys_tables and innodb_sys_tablespaces === +Table Name Tablespace Table Flags Columns Row Format Zip Size +test/t1_restart test/t1_restart 0 8 Redundant 0 +test/t2_restart test/t2_restart 1 8 Compact 0 +test/t3_restart test/t3_restart 37 8 Compressed 2048 +test/t4_restart test/t4_restart 33 8 Dynamic 0 +test/t5_restart test/t5_restart 97 8 Dynamic 0 +test/t6_restart#p#p0 test/t6_restart#p#p0 101 8 Compressed 2048 +test/t6_restart#p#p1 test/t6_restart#p#p1 101 8 Compressed 2048 +test/t6_restart#p#p2 test/t6_restart#p#p2 101 8 Compressed 2048 +test/t7_restart#p#p0#sp#s0 test/t7_restart#p#p0#sp#s0 97 8 Dynamic 0 +test/t7_restart#p#p0#sp#s1 test/t7_restart#p#p0#sp#s1 97 8 Dynamic 0 +test/t7_restart#p#p1#sp#s2 test/t7_restart#p#p1#sp#s2 97 8 Dynamic 0 +test/t7_restart#p#p1#sp#s3 test/t7_restart#p#p1#sp#s3 97 8 Dynamic 0 +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t1_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t1_restart.ibd +test/t2_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t2_restart.ibd +test/t3_restart DEFAULT 2048 MYSQLD_DATADIR/test/t3_restart.ibd +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd +test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd +test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd +test/t7_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +DROP TABLE t1_restart; +DROP TABLE t2_restart; +DROP TABLE t3_restart; +# +# Truncate the remote tablespaces. +# +TRUNCATE TABLE t5_restart; +ALTER TABLE t6_restart TRUNCATE PARTITION p2; +ALTER TABLE t7_restart TRUNCATE PARTITION p1; +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd +test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd +test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd +test/t7_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +INSERT INTO t5_restart VALUES (1000000000, 'MySQL', 'InnoDB', '2011-11-11', 'Read this after reboot'); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +INSERT INTO t5_restart (SELECT 0, c2, c3, c4, c5 FROM t5_restart); +SELECT count(*) FROM t5_restart; +count(*) +8 +SHOW CREATE TABLE t5_restart; +Table Create Table +t5_restart CREATE TABLE `t5_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000012 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/' +SELECT count(*) FROM t6_restart; +count(*) +21 +SHOW CREATE TABLE t6_restart; +Table Create Table +t6_restart CREATE TABLE `t6_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) +SELECT count(*) FROM t7_restart; +count(*) +9 +SHOW CREATE TABLE t7_restart; +Table Create Table +t7_restart CREATE TABLE `t7_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) +# +# Shutdown the server and make a backup of a tablespace +# +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.ibd +t5_restart.frm +t5_restart.frm.bak +t5_restart.isl +t5_restart.isl.bak +t6_restart#p#p0.isl +t6_restart#p#p1.isl +t6_restart#p#p2.isl +t6_restart.frm +t6_restart.par +t7_restart#p#p0#sp#s0.isl +t7_restart#p#p0#sp#s1.isl +t7_restart#p#p1#sp#s2.isl +t7_restart#p#p1#sp#s3.isl +t7_restart.frm +t7_restart.par +---- MYSQL_TMP_DIR/alt_dir/test +t5_restart.ibd +t5_restart.ibd.bak +t6_restart#p#p0.ibd +t6_restart#p#p1.ibd +t6_restart#p#p2.ibd +t7_restart#p#p0#sp#s0.ibd +t7_restart#p#p0#sp#s1.ibd +t7_restart#p#p1#sp#s2.ibd +t7_restart#p#p1#sp#s3.ibd +# +# Start the server and show the tablespaces. +# +# restart +SHOW VARIABLES LIKE 'innodb_file_per_table'; +Variable_name Value +innodb_file_per_table ON +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t6_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p0.ibd +test/t6_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p1.ibd +test/t7_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s0.ibd +test/t7_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p0#sp#s1.ibd +test/t5_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t5_restart.ibd +test/t6_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t6_restart#p#p2.ibd +test/t7_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s2.ibd +test/t7_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t7_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +SELECT count(*) FROM t5_restart; +count(*) +8 +SHOW CREATE TABLE t5_restart; +Table Create Table +t5_restart CREATE TABLE `t5_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000009 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/' +SELECT count(*) FROM t6_restart; +count(*) +21 +SHOW CREATE TABLE t6_restart; +Table Create Table +t6_restart CREATE TABLE `t6_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) +SELECT count(*) FROM t7_restart; +count(*) +9 +SHOW CREATE TABLE t7_restart; +Table Create Table +t7_restart CREATE TABLE `t7_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) +# +# Try to rename a tablespace to a file that already exists +# +RENAME TABLE t5_restart TO t55_restart; +ERROR 42S01: Table 't55_restart' already exists +RENAME TABLE t5_restart TO t55_restart; +ERROR HY000: Error on rename of './test/t5_restart' to './test/t55_restart' (errno: 184 "Tablespace already exists") +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.ibd +t5_restart.frm +t5_restart.isl +t6_restart#p#p0.isl +t6_restart#p#p1.isl +t6_restart#p#p2.isl +t6_restart.frm +t6_restart.par +t7_restart#p#p0#sp#s0.isl +t7_restart#p#p0#sp#s1.isl +t7_restart#p#p1#sp#s2.isl +t7_restart#p#p1#sp#s3.isl +t7_restart.frm +t7_restart.par +---- MYSQL_TMP_DIR/alt_dir/test +t5_restart.ibd +t6_restart#p#p0.ibd +t6_restart#p#p1.ibd +t6_restart#p#p2.ibd +t7_restart#p#p0#sp#s0.ibd +t7_restart#p#p0#sp#s1.ibd +t7_restart#p#p1#sp#s2.ibd +t7_restart#p#p1#sp#s3.ibd +# +# Rename file table and tablespace +# +RENAME TABLE t5_restart TO t55_restart; +RENAME TABLE t6_restart TO t66_restart; +RENAME TABLE t7_restart TO t77_restart; +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd +test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd +test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd +test/t55_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd +test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd +test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); +SELECT count(*) FROM t55_restart; +count(*) +16 +SHOW CREATE TABLE t55_restart; +Table Create Table +t55_restart CREATE TABLE `t55_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000024 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/' +INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); +SELECT count(*) FROM t66_restart; +count(*) +42 +SHOW CREATE TABLE t66_restart; +Table Create Table +t66_restart CREATE TABLE `t66_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) +INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); +SELECT count(*) FROM t77_restart; +count(*) +18 +SHOW CREATE TABLE t77_restart; +Table Create Table +t77_restart CREATE TABLE `t77_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.ibd +t55_restart.frm +t55_restart.isl +t66_restart#p#p0.isl +t66_restart#p#p1.isl +t66_restart#p#p2.isl +t66_restart.frm +t66_restart.par +t77_restart#p#p0#sp#s0.isl +t77_restart#p#p0#sp#s1.isl +t77_restart#p#p1#sp#s2.isl +t77_restart#p#p1#sp#s3.isl +t77_restart.frm +t77_restart.par +---- MYSQL_TMP_DIR/alt_dir/test +t55_restart.ibd +t66_restart#p#p0.ibd +t66_restart#p#p1.ibd +t66_restart#p#p2.ibd +t77_restart#p#p0#sp#s0.ibd +t77_restart#p#p0#sp#s1.ibd +t77_restart#p#p1#sp#s2.ibd +t77_restart#p#p1#sp#s3.ibd +# +# Restart the server +# +# restart +SHOW VARIABLES LIKE 'innodb_file_per_table'; +Variable_name Value +innodb_file_per_table ON +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p1.ibd +test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s0.ibd +test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p0#sp#s1.ibd +test/t55_restart DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t55_restart.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/alt_dir/test/t66_restart#p#p2.ibd +test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s2.ibd +test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/alt_dir/test/t77_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); +SELECT count(*) FROM t55_restart; +count(*) +32 +SHOW CREATE TABLE t55_restart; +Table Create Table +t55_restart CREATE TABLE `t55_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000048 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/alt_dir/' +INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); +SELECT count(*) FROM t66_restart; +count(*) +84 +SHOW CREATE TABLE t66_restart; +Table Create Table +t66_restart CREATE TABLE `t66_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=95 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB) +INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); +SELECT count(*) FROM t77_restart; +count(*) +36 +SHOW CREATE TABLE t77_restart; +Table Create Table +t77_restart CREATE TABLE `t77_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/alt_dir' ENGINE = InnoDB)) +# +# Shutdown the server +# +# +# Move the remote tablespaces to a new location and change the ISL files +# +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.ibd +t55_restart.frm +t55_restart.isl +t66_restart#p#p0.isl +t66_restart#p#p1.isl +t66_restart#p#p2.isl +t66_restart.frm +t66_restart.par +t77_restart#p#p0#sp#s0.isl +t77_restart#p#p0#sp#s1.isl +t77_restart#p#p1#sp#s2.isl +t77_restart#p#p1#sp#s3.isl +t77_restart.frm +t77_restart.par +---- MYSQL_TMP_DIR/alt_dir/test +t55_restart.ibd +t66_restart#p#p0.ibd +t66_restart#p#p1.ibd +t66_restart#p#p2.ibd +t77_restart#p#p0#sp#s0.ibd +t77_restart#p#p0#sp#s1.ibd +t77_restart#p#p1#sp#s2.ibd +t77_restart#p#p1#sp#s3.ibd +---- MYSQL_TMP_DIR/new_dir/test +# Moving tablespace 't4_restart' from MYSQL_DATA_DIR to MYSQL_TMP_DIR/new_dir +# Moving tablespace 't55_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir +# Moving tablespace 't66_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir +# Moving tablespace 't77_restart' from MYSQL_TMP_DIR/alt_dir to MYSQL_TMP_DIR/new_dir +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.isl +t55_restart.frm +t55_restart.isl +t66_restart#p#p0.isl +t66_restart#p#p1.isl +t66_restart#p#p2.isl +t66_restart.frm +t66_restart.par +t77_restart#p#p0#sp#s0.isl +t77_restart#p#p0#sp#s1.isl +t77_restart#p#p1#sp#s2.isl +t77_restart#p#p1#sp#s3.isl +t77_restart.frm +t77_restart.par +---- MYSQL_TMP_DIR/alt_dir/test +---- MYSQL_TMP_DIR/new_dir/test +t4_restart.ibd +t55_restart.ibd +t66_restart#p#p0.ibd +t66_restart#p#p1.ibd +t66_restart#p#p2.ibd +t77_restart#p#p0#sp#s0.ibd +t77_restart#p#p0#sp#s1.ibd +t77_restart#p#p1#sp#s2.ibd +t77_restart#p#p1#sp#s3.ibd +# +# Start the server and check tablespaces. +# +# restart +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t4_restart DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t4_restart.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p1.ibd +test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s0.ibd +test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p0#sp#s1.ibd +test/t55_restart DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t55_restart.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQL_TMP_DIR/new_dir/test/t66_restart#p#p2.ibd +test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s2.ibd +test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQL_TMP_DIR/new_dir/test/t77_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +SELECT count(*) FROM t4_restart; +count(*) +64 +SHOW CREATE TABLE t4_restart; +Table Create Table +t4_restart CREATE TABLE `t4_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000099 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/new_dir/' +INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); +SELECT count(*) FROM t55_restart; +count(*) +64 +SHOW CREATE TABLE t55_restart; +Table Create Table +t55_restart CREATE TABLE `t55_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000096 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC DATA DIRECTORY='MYSQL_TMP_DIR/new_dir/' +INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); +SELECT count(*) FROM t66_restart; +count(*) +168 +SHOW CREATE TABLE t66_restart; +Table Create Table +t66_restart CREATE TABLE `t66_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=179 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, + PARTITION `p1` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, + PARTITION `p2` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB) +INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); +SELECT count(*) FROM t77_restart; +count(*) +72 +SHOW CREATE TABLE t77_restart; +Table Create Table +t77_restart CREATE TABLE `t77_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=73 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, + SUBPARTITION `s1` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB, + SUBPARTITION `s3` DATA DIRECTORY = 'MYSQL_TMP_DIR/new_dir' ENGINE = InnoDB)) +# +# Shutdown the server +# +# +# Move the remote tablespaces back to the default datadir and delete the ISL file. +# +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.isl +t55_restart.frm +t55_restart.isl +t66_restart#p#p0.isl +t66_restart#p#p1.isl +t66_restart#p#p2.isl +t66_restart.frm +t66_restart.par +t77_restart#p#p0#sp#s0.isl +t77_restart#p#p0#sp#s1.isl +t77_restart#p#p1#sp#s2.isl +t77_restart#p#p1#sp#s3.isl +t77_restart.frm +t77_restart.par +---- MYSQL_TMP_DIR/new_dir/test +t4_restart.ibd +t55_restart.ibd +t66_restart#p#p0.ibd +t66_restart#p#p1.ibd +t66_restart#p#p2.ibd +t77_restart#p#p0#sp#s0.ibd +t77_restart#p#p0#sp#s1.ibd +t77_restart#p#p1#sp#s2.ibd +t77_restart#p#p1#sp#s3.ibd +# Moving 't4_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR +# Moving 't55_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR +# Moving 't66_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR +# Moving 't77_restart' from MYSQL_TMP_DIR/new_dir to MYSQL_DATA_DIR +---- MYSQL_DATA_DIR/test +db.opt +t4_restart.frm +t4_restart.ibd +t55_restart.frm +t55_restart.ibd +t66_restart#p#p0.ibd +t66_restart#p#p1.ibd +t66_restart#p#p2.ibd +t66_restart.frm +t66_restart.par +t77_restart#p#p0#sp#s0.ibd +t77_restart#p#p0#sp#s1.ibd +t77_restart#p#p1#sp#s2.ibd +t77_restart#p#p1#sp#s3.ibd +t77_restart.frm +t77_restart.par +---- MYSQL_TMP_DIR/new_dir/test +# +# Start the server and check tablespaces. +# +# restart +=== information_schema.innodb_sys_tablespaces and innodb_sys_datafiles === +Space_Name Page_Size Zip_Size Path +test/t4_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t4_restart.ibd +test/t66_restart#p#p0 DEFAULT 2048 MYSQLD_DATADIR/test/t66_restart#p#p0.ibd +test/t66_restart#p#p1 DEFAULT 2048 MYSQLD_DATADIR/test/t66_restart#p#p1.ibd +test/t77_restart#p#p0#sp#s0 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s0.ibd +test/t77_restart#p#p0#sp#s1 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p0#sp#s1.ibd +test/t55_restart DEFAULT DEFAULT MYSQLD_DATADIR/test/t55_restart.ibd +test/t66_restart#p#p2 DEFAULT 2048 MYSQLD_DATADIR/test/t66_restart#p#p2.ibd +test/t77_restart#p#p1#sp#s2 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s2.ibd +test/t77_restart#p#p1#sp#s3 DEFAULT DEFAULT MYSQLD_DATADIR/test/t77_restart#p#p1#sp#s3.ibd +innodb_temporary DEFAULT DEFAULT MYSQLD_DATADIR/ibtmp1 +INSERT INTO t4_restart (SELECT 0, c2, c3, c4, c5 FROM t4_restart); +SELECT count(*) FROM t4_restart; +count(*) +128 +SHOW CREATE TABLE t4_restart; +Table Create Table +t4_restart CREATE TABLE `t4_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000195 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +INSERT INTO t55_restart (SELECT 0, c2, c3, c4, c5 FROM t55_restart); +SELECT count(*) FROM t55_restart; +count(*) +128 +SHOW CREATE TABLE t55_restart; +Table Create Table +t55_restart CREATE TABLE `t55_restart` ( + `c1` double NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=1000000192 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC +INSERT INTO t66_restart (SELECT 0, c2, c3, c4, c5 FROM t66_restart); +SELECT count(*) FROM t66_restart; +count(*) +336 +SHOW CREATE TABLE t66_restart; +Table Create Table +t66_restart CREATE TABLE `t66_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 + PARTITION BY HASH (`c1`) +(PARTITION `p0` ENGINE = InnoDB, + PARTITION `p1` ENGINE = InnoDB, + PARTITION `p2` ENGINE = InnoDB) +INSERT INTO t77_restart (SELECT 0, c2, c3, c4, c5 FROM t77_restart); +SELECT count(*) FROM t77_restart; +count(*) +144 +SHOW CREATE TABLE t77_restart; +Table Create Table +t77_restart CREATE TABLE `t77_restart` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` char(10) DEFAULT NULL, + `c3` varchar(100) DEFAULT NULL, + `c4` date DEFAULT NULL, + `c5` text DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=145 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=DYNAMIC + PARTITION BY RANGE (`c1`) +SUBPARTITION BY HASH (`c1`) +(PARTITION `p0` VALUES LESS THAN (10) + (SUBPARTITION `s0` ENGINE = InnoDB, + SUBPARTITION `s1` ENGINE = InnoDB), + PARTITION `p1` VALUES LESS THAN MAXVALUE + (SUBPARTITION `s2` ENGINE = InnoDB, + SUBPARTITION `s3` ENGINE = InnoDB)) +# +# Cleanup +# +DROP TABLE t4_restart; +DROP TABLE t55_restart; +DROP TABLE t66_restart; +DROP TABLE t77_restart; diff --git a/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result new file mode 100644 index 00000000..62a28a98 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/wl5522_debug_zip.result @@ -0,0 +1,412 @@ +call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded\\."); +call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue\\."); +call mtr.add_suppression("InnoDB: Page 0 at offset 0 looks corrupted in file"); +call mtr.add_suppression("InnoDB: Page for tablespace "); +call mtr.add_suppression("InnoDB: Invalid FSP_SPACE_FLAGS=0x"); +call mtr.add_suppression("InnoDB: Unknown index id .* on page"); +call mtr.add_suppression("InnoDB: Operating system error number"); +call mtr.add_suppression("InnoDB: Error number \\d+ means"); +call mtr.add_suppression("InnoDB: Cannot open datafile .*t1\\.ibd"); +call mtr.add_suppression("InnoDB: Ignoring tablespace for test/t1 "); +call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing"); +call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed read of file '.*ibdata1' page"); +call mtr.add_suppression("InnoDB: File '.*ibdata1' is corrupted"); +FLUSH TABLES; +SET SESSION innodb_strict_mode=1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb +ROW_FORMAT=COMPRESSED; +INSERT INTO t1 VALUES (1), (2), (3), (4); +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb +ROW_FORMAT=COMPRESSED; +INSERT INTO t1 VALUES (1); +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_before_commit_crash"; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Lost connection to server during query +SET SESSION debug_dbug="+d,ib_import_before_checkpoint_crash"; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Lost connection to server during query +unlink: t1.ibd +unlink: t1.cfg +# Restart and reconnect to the server +DROP TABLE t1; +SET SESSION innodb_strict_mode=1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +4 +INSERT INTO t1 VALUES(400), (500), (600); +SELECT * FROM t1; +c1 +1 +2 +3 +4 +400 +500 +600 +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET @saved_debug_dbug = @@SESSION.debug_dbug; +SET SESSION debug_dbug="+d,ib_import_internal_error"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: While updating the <space, root page number> of index GEN_CLUST_INDEX - Generic error +SET SESSION debug_dbug=@saved_debug_dbug; +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT) ENGINE = Innodb +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_reset_space_and_lsn_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Error importing tablespace for table `test`.`t1` : Too many concurrent transactions +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug=@saved_debug_dbug; +SET SESSION debug_dbug="+d,ib_import_open_tablespace_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 42 'Tablespace not found' from ./test/t1.ibd +SET SESSION debug_dbug=@saved_debug_dbug; +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_check_bitmap_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index for table 't1' is corrupt; try to repair it +SET SESSION debug_dbug=@saved_debug_dbug; +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_cluster_root_adjust_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index for table 't1' is corrupt; try to repair it +SET SESSION debug_dbug=@saved_debug_dbug; +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_cluster_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index for table 't1' is corrupt; try to repair it +SET SESSION debug_dbug=@saved_debug_dbug; +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_sec_root_adjust_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index for table 't1' is corrupt; try to repair it +SET SESSION debug_dbug=@saved_debug_dbug; +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +DROP TABLE t1; +CREATE TABLE t1 ( +c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 BIGINT, +c3 VARCHAR(2048), +c4 VARCHAR(2048), +INDEX idx1(c2), +INDEX idx2(c3(512)), +INDEX idx3(c4(512))) Engine=InnoDB +ROW_FORMAT=COMPRESSED; +connect purge_control,localhost,root; +START TRANSACTION WITH CONSISTENT SNAPSHOT; +connection default; +INSERT INTO t1 +SELECT 1 + seq, 1 + (seq MOD 4), +REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048), +REPEAT(SUBSTR('abcd', 1 + (seq MOD 4), 1), 2048) +FROM seq_0_to_127; +DELETE FROM t1 WHERE c2 = 1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c2 = c2 + c1; +UPDATE t1 SET c3 = REPEAT("c2", 1024); +UPDATE t1 SET c4 = REPEAT("c4", 1024); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL AUTO_INCREMENT, + `c2` bigint(20) DEFAULT NULL, + `c3` varchar(2048) DEFAULT NULL, + `c4` varchar(2048) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `idx1` (`c2`), + KEY `idx2` (`c3`(512)), + KEY `idx3` (`c4`(512)) +) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +UNLOCK TABLES; +connection purge_control; +COMMIT; +disconnect purge_control; +connection default; +DROP TABLE t1; +CREATE TABLE t1 ( +c1 BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 BIGINT, +c3 VARCHAR(2048), +c4 VARCHAR(2048), +INDEX idx1(c2), +INDEX idx2(c3(512)), +INDEX idx3(c4(512))) Engine=InnoDB +ROW_FORMAT=COMPRESSED; +SELECT c1, c2 FROM t1; +c1 c2 +ALTER TABLE t1 DISCARD TABLESPACE; +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT c1,c2 FROM t1; +c1 c2 +2 32 +3 48 +4 64 +6 92 +7 108 +8 124 +10 152 +11 168 +12 184 +14 212 +15 228 +16 244 +18 272 +19 288 +20 304 +22 332 +23 348 +24 364 +26 392 +27 408 +28 424 +30 452 +31 468 +32 484 +34 512 +35 528 +36 544 +38 572 +39 588 +40 604 +42 632 +43 648 +44 664 +46 692 +47 708 +48 724 +50 752 +51 768 +52 784 +54 812 +55 828 +56 844 +58 872 +59 888 +60 904 +62 932 +63 948 +64 964 +66 992 +67 1008 +68 1024 +70 1052 +71 1068 +72 1084 +74 1112 +75 1128 +76 1144 +78 1172 +79 1188 +80 1204 +82 1232 +83 1248 +84 1264 +86 1292 +87 1308 +88 1324 +90 1352 +91 1368 +92 1384 +94 1412 +95 1428 +96 1444 +98 1472 +99 1488 +100 1504 +102 1532 +103 1548 +104 1564 +106 1592 +107 1608 +108 1624 +110 1652 +111 1668 +112 1684 +114 1712 +115 1728 +116 1744 +118 1772 +119 1788 +120 1804 +122 1832 +123 1848 +124 1864 +126 1892 +127 1908 +128 1924 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` bigint(20) NOT NULL AUTO_INCREMENT, + `c2` bigint(20) DEFAULT NULL, + `c3` varchar(2048) DEFAULT NULL, + `c4` varchar(2048) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `idx1` (`c2`), + KEY `idx2` (`c3`(512)), + KEY `idx3` (`c4`(512)) +) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +INSERT INTO t1 +SELECT 100, REPEAT('Karanbir', 128), REPEAT('Ajeeth', 1200) +FROM seq_1_to_256; +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_trigger_corruption_1"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Internal error: Error importing tablespace for table `test`.`t1` : Data structure corruption +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +Got one of the listed errors +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_trigger_corruption_2"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index corrupt: Externally stored column(5) has a reference length of 19 in the cluster index GEN_CLUST_INDEX +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,ib_import_trigger_corruption_3"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index for table 't1' is corrupt; try to repair it +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +SET SESSION debug_dbug="+d,ib_import_create_index_failure_1"; +ALTER TABLE t1 ADD INDEX idx(c1); +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,fil_space_create_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 11 'Generic error' from ./test/t1.ibd +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,dict_tf_to_fsp_flags_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Got error 37 'Data structure corruption' from ./test/t1.ibd +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg +CREATE TABLE t1 (c1 INT, c2 VARCHAR(1024), c3 BLOB) ENGINE = Innodb +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT COUNT(*) FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +SET SESSION debug_dbug="+d,fsp_flags_is_valid_failure"; +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Index for table 't1' is corrupt; try to repair it +SET SESSION debug_dbug=@saved_debug_dbug; +DROP TABLE t1; +unlink: t1.ibd +unlink: t1.cfg diff --git a/mysql-test/suite/innodb_zip/r/wl5522_zip.result b/mysql-test/suite/innodb_zip/r/wl5522_zip.result new file mode 100644 index 00000000..1b044d68 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/wl5522_zip.result @@ -0,0 +1,395 @@ +call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT\\."); +call mtr.add_suppression("InnoDB: Cannot save statistics for table `test`\\.`t1` because the \\.ibd file is missing"); +SET SESSION innodb_strict_mode=1; +CREATE TABLE t1 +(a INT AUTO_INCREMENT PRIMARY KEY, +b char(22), +c varchar(255), +KEY (b)) +ENGINE = InnoDB ROW_FORMAT=COMPRESSED ; +CREATE TEMPORARY TABLE t (b char(22),c varchar(255)); +INSERT INTO t VALUES +('Apa', 'Filler........'), +('Banan', 'Filler........'), ('Cavalry', '..asdasdfaeraf'), +('Devotion', 'asdfuihknaskdf'), ('Evolution', 'lsjndofiabsoibeg'); +INSERT INTO t1 (b,c) SELECT b,c FROM t,seq_1_to_128; +DROP TEMPORARY TABLE t; +SELECT COUNT(*) FROM t1; +COUNT(*) +640 +SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; +a b c +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ +SELECT * FROM t1 ORDER BY a DESC LIMIT 3; +a b c +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf +db.opt +t1.frm +t1.ibd +# Restarting server +# restart +# Done restarting server +FLUSH TABLE t1 FOR EXPORT; +# List before copying files +db.opt +t1.cfg +t1.frm +t1.ibd +UNLOCK TABLES; +INSERT INTO t1 (b, c) SELECT b,c FROM t1 ORDER BY a; +SELECT COUNT(*) FROM t1; +COUNT(*) +1280 +SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; +a b c +1276 Apa Filler........ +1271 Apa Filler........ +1266 Apa Filler........ +SELECT * FROM t1 ORDER BY a DESC LIMIT 3; +a b c +1280 Evolution lsjndofiabsoibeg +1279 Devotion asdfuihknaskdf +1278 Cavalry ..asdasdfaeraf +# Restarting server +# restart +# Done restarting server +# List before t1 DISCARD +db.opt +t1.frm +t1.ibd +ALTER TABLE t1 DISCARD TABLESPACE; +# List after t1 DISCARD +db.opt +t1.frm +ALTER TABLE t1 IMPORT TABLESPACE; +ALTER TABLE t1 ENGINE InnoDB; +SELECT COUNT(*) FROM t1; +COUNT(*) +640 +SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; +a b c +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ +SELECT * FROM t1 ORDER BY a DESC LIMIT 3; +a b c +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf +db.opt +t1.cfg +t1.frm +t1.ibd +SELECT COUNT(*) FROM t1; +COUNT(*) +640 +SELECT * FROM t1 ORDER BY b,a DESC LIMIT 3; +a b c +636 Apa Filler........ +631 Apa Filler........ +626 Apa Filler........ +SELECT * FROM t1 ORDER BY a DESC LIMIT 3; +a b c +640 Evolution lsjndofiabsoibeg +639 Devotion asdfuihknaskdf +638 Cavalry ..asdasdfaeraf +DROP TABLE t1; +SET SESSION innodb_strict_mode=1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +INSERT INTO t1(c2) VALUES(1); +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Tablespace for table 'test/t1' exists. Please DISCARD the tablespace before IMPORT +SELECT * FROM t1; +c1 c2 +1 1 +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; +db.opt +t1.frm +t1.ibd +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +db.opt +t1.cfg +t1.frm +t1.ibd +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +db.opt +t1.cfg +t1.frm +t1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; +db.opt +t1.frm +t1.ibd +FLUSH TABLES t1 FOR EXPORT; +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +backup: t1 +db.opt +t1.cfg +t1.frm +t1.ibd +UNLOCK TABLES; +db.opt +t1.frm +t1.ibd +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +db.opt +t1.cfg +t1.frm +t1.ibd +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT COUNT(*) FROM t1; +COUNT(*) +16 +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +db.opt +t1.cfg +t1.frm +t1.ibd +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT COUNT(*) FROM t1 WHERE c2 = 1; +COUNT(*) +16 +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX idx(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX x(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch (Index x not found in tablespace meta-data file.) +ALTER TABLE t1 DROP INDEX x; +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` +ALTER TABLE t1 ADD INDEX idx(c2); +Warnings: +Warning 1814 Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1; +c1 c2 +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 1 +unlink: t1.cfg +DROP TABLE t1; +SET GLOBAL innodb_file_per_table = 0; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci +FLUSH TABLES t1 FOR EXPORT; +Warnings: +Warning 1809 Table `test`.`t1` in system tablespace +UNLOCK TABLES; +DROP TABLE t1; +SET GLOBAL innodb_file_per_table = 1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX idx(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +INSERT INTO t1 SELECT seq,1 FROM seq_1_to_16; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `idx` (`c2`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED +FLUSH TABLES t1 FOR EXPORT; +backup: t1 +UNLOCK TABLES; +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch (Number of indexes don't match, table has 1 indexes but the tablespace meta-data file has 2 indexes) +unlink: t1.ibd +unlink: t1.cfg +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, +c3 INT, INDEX idx(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch (Column c3 not found in tablespace.) +unlink: t1.ibd +unlink: t1.cfg +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 BIGINT, INDEX idx(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch (Column c2 precise type mismatch, it's 0X408 in the table and 0X403 in the tablespace meta file) +unlink: t1.ibd +unlink: t1.cfg +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX idx(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +ERROR HY000: Schema mismatch +unlink: t1.ibd +unlink: t1.cfg +DROP TABLE t1; +CREATE TABLE t1( +c1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, +c2 INT, INDEX idx(c2)) ENGINE=InnoDB +ROW_FORMAT=COMPRESSED; +ALTER TABLE t1 DISCARD TABLESPACE; +SELECT * FROM t1; +ERROR HY000: Tablespace has been discarded for table `t1` +restore: t1 .ibd and .cfg files +ALTER TABLE t1 IMPORT TABLESPACE; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +unlink: t1.cfg +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `c1` int(11) NOT NULL AUTO_INCREMENT, + `c2` int(11) DEFAULT NULL, + PRIMARY KEY (`c1`), + KEY `idx` (`c2`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci ROW_FORMAT=COMPRESSED +SELECT * FROM t1; +c1 c2 +1 1 +2 1 +3 1 +4 1 +5 1 +6 1 +7 1 +8 1 +9 1 +10 1 +11 1 +12 1 +13 1 +14 1 +15 1 +16 1 +DROP TABLE t1; +call mtr.add_suppression("Got error -1 when reading table '.*'"); +call mtr.add_suppression("InnoDB: Error: tablespace id and flags in file '.*'"); +call mtr.add_suppression("InnoDB: The table .* doesn't have a corresponding tablespace, it was discarded"); diff --git a/mysql-test/suite/innodb_zip/r/wl6344_compress_level.result b/mysql-test/suite/innodb_zip/r/wl6344_compress_level.result new file mode 100644 index 00000000..6fa87e64 --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/wl6344_compress_level.result @@ -0,0 +1,111 @@ +SET @save_innodb_stats_persistent = @@GLOBAL.innodb_stats_persistent; +SET GLOBAL innodb_stats_persistent = OFF; +SET @save_innodb_compression_level = @@global.innodb_compression_level; +SET global innodb_compression_level=0; +#create table with 1K block size +CREATE TABLE tab5 (col_1 CHAR (255) , +col_2 VARCHAR (121), col_3 longtext, +col_4 longtext,col_5 longtext, +col_6 longtext , col_7 longtext , +col_8 longtext ,col_9 longtext , +col_10 longtext ,col_11 int auto_increment primary key) +ENGINE = innodb ROW_FORMAT=compressed key_block_size=1; +#create indexes +CREATE INDEX idx1 ON tab5(col_4(10)); +CREATE INDEX idx2 ON tab5(col_5(10)); +CREATE INDEX idx3 ON tab5(col_6(10)); +CREATE INDEX idx4 ON tab5(col_7(10)); +CREATE INDEX idx5 ON tab5(col_8(10)); +CREATE INDEX idx6 ON tab5(col_11); +#load the with repeat function +SET @col_1 = repeat('a', 100); +SET @col_2 = repeat('b', 100); +SET @col_3 = repeat('c', 100); +SET @col_4 = repeat('d', 100); +SET @col_5 = repeat('e', 100); +SET @col_6 = repeat('f', 100); +SET @col_7 = repeat('g', 100); +SET @col_8 = repeat('h', 100); +SET @col_9 = repeat('i', 100); +SET @col_10 = repeat('j', 100); +#insert 10 records +BEGIN; +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +COMMIT; +#set the compression level=9 (High compress) +SET global innodb_compression_level=9; +#create table with 1K block size +CREATE TABLE tab6 (col_1 CHAR (255) , +col_2 VARCHAR (121), col_3 longtext, +col_4 longtext,col_5 longtext, +col_6 longtext , col_7 longtext , +col_8 longtext ,col_9 longtext , +col_10 longtext ,col_11 int auto_increment primary key) +ENGINE = innodb ROW_FORMAT=compressed key_block_size=1; +#create indexes +CREATE INDEX idx1 ON tab6(col_4(10)); +CREATE INDEX idx2 ON tab6(col_5(10)); +CREATE INDEX idx3 ON tab6(col_6(10)); +CREATE INDEX idx4 ON tab6(col_7(10)); +CREATE INDEX idx5 ON tab6(col_8(10)); +CREATE INDEX idx6 ON tab6(col_11); +#insert 10 records +BEGIN; +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10) +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10); +COMMIT; +#diff the sizes of the No compressed table and high compressed table +SET @size=(SELECT +(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024) +FROM INFORMATION_SCHEMA.TABLES +WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test') +- +(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024 +FROM INFORMATION_SCHEMA.TABLES +WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test') +FROM DUAL); +#check the size of the table, it should not be Negative value +#The results of this query Test pass = 1 and fail=0 +SELECT @size >= 0; +@size >= 0 +1 +DROP TABLE tab5, tab6; +SET GLOBAL innodb_compression_level = @save_innodb_compression_level; +SET GLOBAL innodb_stats_persistent = @save_innodb_stats_persistent; diff --git a/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result b/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result new file mode 100644 index 00000000..05b4793e --- /dev/null +++ b/mysql-test/suite/innodb_zip/r/wl6347_comp_indx_stat.result @@ -0,0 +1,7928 @@ +#****************************************************************** +# Test 1: Test the interaction between stats and compression level +# and logging of compressed pages configuration +# This testcase is to verify the table/idex level compression stats +# When the flags are set as follows +# innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 +# page size 1K,2K,4K,8K,16K +# check the size and compression stats of the table tab5 +#****************************************************************** +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_level=0; +#****************************************************************** +# Test 1-1K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 with page size 1K +#****************************************************************** +# create a table with page size=1K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for deterministic reasons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 5242880 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 5242880 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 5242880 +# restart +# set the flag on (default off) +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_compression_level=0; +# fetch the compressed page and check the stats +# The stats figure may be different/same for each restart. +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table +# testcase : pass = 1 fail = 0 +SET @comp_val=0; +SET @uncomp_val=1; +=============== +After Restart Chekc the stats of the table +=============== +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +DROP TABLE tab5; +#****************************************************************** +# Test 1-2K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 with page size 2K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=0; +SET GLOBAL innodb_cmp_per_index_enabled=1; +# create a table with page size=2K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 2097152 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 2097152 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 2097152 +# restart +# set the flag on (default off) +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_compression_level=0; +# fetch the compressed page and check the stats +# The stats figure may be different/same for each restart. +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table +# testcase : pass = 1 fail = 0 +SET @comp_val=0; +SET @uncomp_val=2; +=============== +After Restart Chekc the stats of the table +=============== +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +DROP TABLE tab5; +#****************************************************************** +# Test 1-4K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 with page size 4K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=0; +SET GLOBAL innodb_cmp_per_index_enabled=1; +# create a table with page size=4K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 131072 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 131072 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 131072 +DROP TABLE tab5; +#****************************************************************** +# Test 1-8K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 with page size 8K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=0; +SET GLOBAL innodb_cmp_per_index_enabled=1; +# create a table with page size=8K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 106496 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 180224 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 180224 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 180224 +DROP TABLE tab5; +#****************************************************************** +# Test 1-16K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=0 with page size 16K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=0; +SET GLOBAL innodb_cmp_per_index_enabled=1; +# create a table with page size=16K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 212992 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +DROP TABLE tab5; +#****************************************************************** +# Test 2: test the interaction between wl6347 & wl6344 (2.2) +# This testcase is to verify the table/idex level compression stats +# When the flags are set as follows +# innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 +# page size 1K,2K,4K,8K,16K +# check the size and compression stats of the table tab5 +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=0; +SET GLOBAL innodb_cmp_per_index_enabled=1; +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_compression_level=9; +#****************************************************************** +# Test 2-1K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 with page size 1K +#****************************************************************** +# create a table with page size=1K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 2097152 +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# restart +# set the flag on (default off) +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_compression_level=9; +# fetch the compressed page and check the stats +# The stats figure may be different/same for each restart. +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table +# testcase : pass = 1 fail = 0 +SET @comp_val=0; +SET @uncomp_val=1; +=============== +After Restart Chekc the stats of the table +=============== +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +DROP TABLE tab5; +#****************************************************************** +# Test 2-2K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 with page size 2K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=2K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 2097152 +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# restart +# set the flag on (default off) +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_compression_level=9; +# fetch the compressed page and check the stats +# The stats figure may be different/same for each restart. +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table +# testcase : pass = 1 fail = 0 +SET @comp_val=0; +SET @uncomp_val=1; +=============== +After Restart Chekc the stats of the table +=============== +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +DROP TABLE tab5; +#****************************************************************** +# Test 2-4K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 with page size 4K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=4K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 159744 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +DROP TABLE tab5; +#****************************************************************** +# Test 2-8K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 with page size 8K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=8K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 122880 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 106496 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 212992 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +DROP TABLE tab5; +#****************************************************************** +# Test 2-16K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=9 with page size 16K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=16K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 245760 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 212992 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 344064 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +DROP TABLE tab5; +#****************************************************************** +# Test 3: test the interaction between wl6347 & wl6344 (2.3) +# This testcase is to verify the table/idex level compression stats +# When the flags are set as follows +# innodb_cmp_per_index_enabled=ON and +# innodb_compression_level=6 (default) +# page size 1K,2K,4K,8K,16K +# check the size and compression stats of the table tab5 +#****************************************************************** +#****************************************************************** +# Test 3-1K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=Def with page size 1K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_level=default; +# create a table with page size=1K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +DROP TABLE tab5; +#****************************************************************** +# Test 3-2K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=Def with page size 2K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_level=default; +# create a table with page size=2K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 86016 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +DROP TABLE tab5; +#****************************************************************** +# Test 3-4K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=Def with page size 4K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_level=default; +# create a table with page size=4K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 65536 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 86016 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +DROP TABLE tab5; +#****************************************************************** +# Test 3-8K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=Def with page size 8K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_level=default; +# create a table with page size=8K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 122880 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 106496 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 172032 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +DROP TABLE tab5; +#****************************************************************** +# Test 3-16K: innodb_cmp_per_index_enabled=ON and innodb_compression_level=Def with page size 16K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_level=default; +# create a table with page size=16K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +# The size of the file with 0 compress = 245760 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 212992 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +# The size of the file with 0 compress = 344064 +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +DROP TABLE tab5; +#****************************************************************** +# Test 4: test the interaction between wl6347 & wl6344 (2.5 & 2.6) +# This testcase is to verify the table/idex level compression stats +# When the flags are set as follows +# innodb_cmp_per_index_enabled=ON and +# Innodb_compression_failure_threshold_pct=0 +# page size 1K,2K,4K,8K,16K +# check the size and compression stats of the table tab5 +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_compression_failure_threshold_pct=0; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# check the flags +SELECT @@innodb_cmp_per_index_enabled; +@@innodb_cmp_per_index_enabled 1 +SELECT @@innodb_compression_failure_threshold_pct; +@@innodb_compression_failure_threshold_pct 0 +SELECT @@innodb_file_per_table; +@@innodb_file_per_table 1 +SELECT @@innodb_compression_level; +@@innodb_compression_level 6 +#****************************************************************** +# Test 4-1K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=0 with page size 1K +#****************************************************************** +# create a table with page size=1K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# restart +# set the flag on (default off) +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_compression_failure_threshold_pct=0; +SET GLOBAL innodb_file_per_table=on; +# fetch the compressed page and check the stats +# The stats figure may be different/same for each restart. +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table +# testcase : pass = 1 fail = 0 +SET @comp_val=0; +SET @uncomp_val=1; +=============== +After Restart Chekc the stats of the table +=============== +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +DROP TABLE tab5; +#****************************************************************** +# Test 4-2K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=0 with page size 2K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=2K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +DROP TABLE tab5; +#****************************************************************** +# Test 4-4K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=0 with page size 4K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=4K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +DROP TABLE tab5; +#****************************************************************** +# Test 4-8K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=0 with page size 8K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=8K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 106496 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +DROP TABLE tab5; +#****************************************************************** +# Test 4-16K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=0 with page size 16K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=16K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 212992 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +DROP TABLE tab5; +#****************************************************************** +# Test 5: test the interaction between wl6347 & wl6344 (2.7) +# This testcase is to verify the table/idex level compression stats +# When the flags are set as follows +# innodb_cmp_per_index_enabled=ON and +# Innodb_compression_failure_threshold_pct=10 +# page size 1K,2K,4K,8K,16K +# check the size and compression stats of the table tab5 +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_failure_threshold_pct=10; +SET GLOBAL innodb_compression_level=Default; +# check the flags +SELECT @@innodb_cmp_per_index_enabled; +@@innodb_cmp_per_index_enabled 1 +SELECT @@innodb_compression_failure_threshold_pct; +@@innodb_compression_failure_threshold_pct 10 +SELECT @@innodb_file_per_table; +@@innodb_file_per_table 1 +SELECT @@innodb_compression_level; +@@innodb_compression_level 6 +#****************************************************************** +# Test 5-1K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=10 with page size 1K +#****************************************************************** +# create a table with page size=1K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# restart +# set the flag on (default off) +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# set the flags +SET GLOBAL innodb_compression_failure_threshold_pct=10; +SET GLOBAL innodb_file_per_table=on; +SET GLOBAL innodb_compression_failure_threshold_pct=10; +# fetch the compressed page and check the stats +# The stats figure may be different/same for each restart. +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table +# testcase : pass = 1 fail = 0 +SET @comp_val=0; +SET @uncomp_val=1; +=============== +After Restart Chekc the stats of the table +=============== +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @comp_val AND 1000 +AND uncompress_ops BETWEEN @uncomp_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +DROP TABLE tab5; +#****************************************************************** +# Test 5-2K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=10 with page size 2K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_failure_threshold_pct=10; +# create a table with page size=2K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=2; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +DROP TABLE tab5; +#****************************************************************** +# Test 5-4K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=10 with page size 4K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=4K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 65536 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 77824 +DROP TABLE tab5; +#****************************************************************** +# Test 5-8K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=10 with page size 8K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +SET GLOBAL innodb_compression_failure_threshold_pct=10; +# create a table with page size=8K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 106496 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 155648 +DROP TABLE tab5; +#****************************************************************** +# Test 5-16K: innodb_cmp_per_index_enabled=ON and Innodb_compression_failure_threshold_pct=10 with page size 16K +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=OFF; +SET GLOBAL innodb_cmp_per_index_enabled=ON; +# create a table with page size=16K +# create indexes on each column.(total 9 indexes) +# Create table & Index +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(67)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=16; +CREATE INDEX idx9 ON tab5(col_9(10)); +CREATE INDEX idx8 ON tab5(col_8(10)); +CREATE INDEX idx7 ON tab5(col_7(10)); +CREATE INDEX idx6 ON tab5(col_6(10)); +CREATE INDEX idx5 ON tab5(col_5(10)); +CREATE INDEX idx4 ON tab5(col_4(10)); +CREATE INDEX idx3 ON tab5(col_3(10)); +CREATE INDEX idx2 ON tab5(col_2(10)); +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 212992 +# for determintic resons simple data should be inserted. +# insert some 100 records +# Load the data +SET @col_1 = repeat('a', 67); +SET @col_2 = repeat('b', 67); +SET @col_3 = repeat('c', 67); +SET @col_4 = repeat('d', 67); +SET @col_5 = repeat('e', 67); +SET @col_6 = repeat('f', 67); +SET @col_7 = repeat('g', 67); +SET @col_8 = repeat('h', 67); +SET @col_9 = repeat('i', 67); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +INSERT INTO tab5 +VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9); +commit; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed page and check the stats +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +# fetch the compressed same page once again and check the stats +# the stat figures should be same as above query +=============== +Fetch Records +=============== +SELECT col_7,col_8,col_9 FROM tab5 +WHERE col_2='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' +LIMIT 1; +# check the stats of the table & size of the table +SET @inl_val=1; +# Check the stats of the table +# Check the size of the ibd file +# testcase : pass = 1 fail = 0 +SELECT count(*) > 0 as "compress_stat" +FROM information_schema.innodb_cmp_per_index +WHERE +compress_ops_ok BETWEEN @inl_val AND 1000 +AND compress_ops BETWEEN @inl_val AND 1000 +AND table_name='tab5' AND database_name='test' +AND index_name like 'idx%' ; +compress_stat 1 +The size of the tab5.ibd file: 311296 +DROP TABLE tab5; +#****************************************************************** +# Test 6: Create multiple tables & indexes having same name in 2 diff DB's +# Check the stats of the table. (1.1) +#****************************************************************** +# reset the stat table before starting next testcase +SET GLOBAL innodb_cmp_per_index_enabled=0; +SET GLOBAL innodb_cmp_per_index_enabled=1; +SET GLOBAL innodb_file_per_table=ON; +SET GLOBAL innodb_compression_level=default; +SET GLOBAL innodb_compression_failure_threshold_pct=default; +# create a table page size=1K +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(255)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx1 ON tab5(col_1(10)); +# check the stats of the table +SELECT database_name,table_name,index_name,compress_ops,compress_ops_ok +FROM information_schema.innodb_cmp_per_index +WHERE database_name='test' and table_name='tab5' +ORDER BY index_name,table_name,database_name ; +database_name test +table_name tab5 +index_name GEN_CLUST_INDEX +compress_ops 1 +compress_ops_ok 1 +database_name test +table_name tab5 +index_name idx1 +compress_ops 1 +compress_ops_ok 1 +CREATE DATABASE sb; +USE sb; +# create a table page size=1K (testcase-1) +CREATE TABLE tab5(col_1 TINYBLOB, col_2 TINYTEXT,col_3 BLOB, +col_4 TEXT,col_5 MEDIUMBLOB,col_6 MEDIUMTEXT, +col_7 LONGBLOB,col_8 LONGTEXT,col_9 VARCHAR(255)) +ENGINE=INNODB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1; +CREATE INDEX idx1 ON tab5(col_1(10)); +SELECT database_name,table_name,index_name,compress_ops,compress_ops_ok +FROM information_schema.innodb_cmp_per_index +WHERE database_name='sb' and table_name='tab5' +ORDER BY index_name,table_name,database_name ; +database_name sb +table_name tab5 +index_name GEN_CLUST_INDEX +compress_ops 1 +compress_ops_ok 1 +database_name sb +table_name tab5 +index_name idx1 +compress_ops 1 +compress_ops_ok 1 +DROP TABLE tab5, test.tab5; +DROP DATABASE sb; +# reset the flags +SET GLOBAL innodb_file_per_table=default; +SET GLOBAL innodb_cmp_per_index_enabled=default; +SET GLOBAL innodb_compression_failure_threshold_pct=default; |