Debian Codegraph @

mysql-test/suite/innodb/t/innodb_stats_table_flag_sample_pages.test

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