| 1 |
# |
| 2 |
# Test CREATE TABLE ... STATS_SAMPLE_PAGES=N|default |
| 3 |
# |
| 4 |
|
| 5 |
-- vertical_results |
| 6 |
|
| 7 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB; |
| 8 |
|
| 9 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 10 |
SELECT create_options FROM information_schema.tables |
| 11 |
WHERE table_name='test_ps_sample_pages'; |
| 12 |
|
| 13 |
ALTER TABLE test_ps_sample_pages STATS_SAMPLE_PAGES=12345; |
| 14 |
|
| 15 |
# confirm that the flag survives server restart |
| 16 |
-- source include/restart_mysqld.inc |
| 17 |
|
| 18 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 19 |
SELECT create_options FROM information_schema.tables |
| 20 |
WHERE table_name='test_ps_sample_pages'; |
| 21 |
|
| 22 |
DROP TABLE test_ps_sample_pages; |
| 23 |
|
| 24 |
## |
| 25 |
|
| 26 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 27 |
STATS_SAMPLE_PAGES=default; |
| 28 |
|
| 29 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 30 |
SELECT create_options FROM information_schema.tables |
| 31 |
WHERE table_name='test_ps_sample_pages'; |
| 32 |
|
| 33 |
DROP TABLE test_ps_sample_pages; |
| 34 |
|
| 35 |
## |
| 36 |
|
| 37 |
-- error ER_PARSE_ERROR |
| 38 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 39 |
STATS_SAMPLE_PAGES=-5; |
| 40 |
|
| 41 |
-- error ER_PARSE_ERROR |
| 42 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 43 |
STATS_SAMPLE_PAGES=0; |
| 44 |
|
| 45 |
-- error ER_PARSE_ERROR |
| 46 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 47 |
STATS_SAMPLE_PAGES=67000; |
| 48 |
|
| 49 |
-- error ER_PARSE_ERROR |
| 50 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 51 |
STATS_SAMPLE_PAGES=670000; |
| 52 |
|
| 53 |
-- error ER_PARSE_ERROR |
| 54 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 55 |
STATS_SAMPLE_PAGES=65536; |
| 56 |
|
| 57 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 58 |
STATS_SAMPLE_PAGES=65535; |
| 59 |
|
| 60 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 61 |
|
| 62 |
DROP TABLE test_ps_sample_pages; |
| 63 |
|
| 64 |
## |
| 65 |
|
| 66 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 67 |
STATS_SAMPLE_PAGES=1; |
| 68 |
|
| 69 |
# confirm that the flag survives server restart |
| 70 |
-- source include/restart_mysqld.inc |
| 71 |
|
| 72 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 73 |
SELECT create_options FROM information_schema.tables |
| 74 |
WHERE table_name='test_ps_sample_pages'; |
| 75 |
|
| 76 |
DROP TABLE test_ps_sample_pages; |
| 77 |
|
| 78 |
## |
| 79 |
|
| 80 |
CREATE TABLE test_ps_sample_pages (a INT, PRIMARY KEY (a)) ENGINE=INNODB |
| 81 |
STATS_SAMPLE_PAGES=5678; |
| 82 |
|
| 83 |
# confirm that the flag survives server restart |
| 84 |
-- source include/restart_mysqld.inc |
| 85 |
|
| 86 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 87 |
SELECT create_options FROM information_schema.tables |
| 88 |
WHERE table_name='test_ps_sample_pages'; |
| 89 |
|
| 90 |
ALTER TABLE test_ps_sample_pages STATS_SAMPLE_PAGES=default; |
| 91 |
|
| 92 |
# confirm that the flag survives server restart |
| 93 |
-- source include/restart_mysqld.inc |
| 94 |
|
| 95 |
SHOW CREATE TABLE test_ps_sample_pages; |
| 96 |
SELECT create_options FROM information_schema.tables |
| 97 |
WHERE table_name='test_ps_sample_pages'; |
| 98 |
|
| 99 |
DROP TABLE test_ps_sample_pages; |