| 1 |
-- source include/have_innodb.inc |
| 2 |
# CREATE TABLE ... KEY_BLOCK_SIZE=8; does not work with page size = 4k |
| 3 |
-- source include/have_innodb_16k.inc |
| 4 |
|
| 5 |
SET @save_innodb_read_only_compressed=@@GLOBAL.innodb_read_only_compressed; |
| 6 |
SET GLOBAL innodb_read_only_compressed=OFF; |
| 7 |
|
| 8 |
# Check the default value |
| 9 |
SELECT @@global.innodb_cmp_per_index_enabled; |
| 10 |
|
| 11 |
# should be a boolean |
| 12 |
-- error ER_WRONG_VALUE_FOR_VAR |
| 13 |
SET GLOBAL innodb_stats_persistent=123; |
| 14 |
|
| 15 |
-- error ER_WRONG_VALUE_FOR_VAR |
| 16 |
SET GLOBAL innodb_stats_persistent='foo'; |
| 17 |
|
| 18 |
# Check that changing value works and that setting the same value again |
| 19 |
# is as expected |
| 20 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 21 |
SELECT @@global.innodb_cmp_per_index_enabled; |
| 22 |
|
| 23 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 24 |
SELECT @@global.innodb_cmp_per_index_enabled; |
| 25 |
|
| 26 |
SET GLOBAL innodb_cmp_per_index_enabled=OFF; |
| 27 |
SELECT @@global.innodb_cmp_per_index_enabled; |
| 28 |
|
| 29 |
SET GLOBAL innodb_cmp_per_index_enabled=OFF; |
| 30 |
SELECT @@global.innodb_cmp_per_index_enabled; |
| 31 |
|
| 32 |
-- vertical_results |
| 33 |
|
| 34 |
# Check that enabling after being disabled resets the stats |
| 35 |
|
| 36 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 37 |
|
| 38 |
CREATE TABLE t (a INT) ENGINE=INNODB KEY_BLOCK_SIZE=8; |
| 39 |
|
| 40 |
INSERT INTO t VALUES (1); |
| 41 |
|
| 42 |
SELECT * FROM information_schema.innodb_cmp_per_index; |
| 43 |
|
| 44 |
SET GLOBAL innodb_cmp_per_index_enabled=OFF; |
| 45 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 46 |
|
| 47 |
SELECT * FROM information_schema.innodb_cmp_per_index; |
| 48 |
|
| 49 |
DROP TABLE t; |
| 50 |
|
| 51 |
# Check that enabling after being enabled does not reset the stats |
| 52 |
|
| 53 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 54 |
|
| 55 |
CREATE TABLE t (a INT) ENGINE=INNODB KEY_BLOCK_SIZE=8; |
| 56 |
|
| 57 |
INSERT INTO t VALUES (1); |
| 58 |
|
| 59 |
SELECT * FROM information_schema.innodb_cmp_per_index; |
| 60 |
|
| 61 |
SET GLOBAL innodb_cmp_per_index_enabled=ON; |
| 62 |
|
| 63 |
SELECT * FROM information_schema.innodb_cmp_per_index; |
| 64 |
|
| 65 |
DROP TABLE t; |
| 66 |
|
| 67 |
# |
| 68 |
|
| 69 |
SET GLOBAL innodb_cmp_per_index_enabled=default; |
| 70 |
SET GLOBAL innodb_read_only_compressed=@save_innodb_read_only_compressed; |