Debian Codegraph @

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

raw
1 #
2 # Test CREATE TABLE ... STATS_PERSISTENT=0|1|default
3 #
4
5 -- source include/have_innodb.inc
6
7 set @save_innodb_stats_persistent= @@innodb_stats_persistent;
8
9 set global innodb_stats_persistent=default;
10
11 -- vertical_results
12
13 # confirm that nothing is present before the test
14 SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE
15 database_name = 'test' AND
16 table_name = 'test_ps_create_table';
17
18 ##
19
20 CREATE TABLE test_ps_create_table (a INT, PRIMARY KEY (a))
21 ENGINE=INNODB STATS_PERSISTENT=0;
22
23 # nothing should be present
24 SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE
25 database_name = 'test' AND
26 table_name = 'test_ps_create_table';
27
28 DROP TABLE test_ps_create_table;
29
30 ##
31
32 CREATE TABLE test_ps_create_table (a INT, PRIMARY KEY (a))
33 ENGINE=INNODB;
34
35 # 1 row should be present if the default of --innodb-stats-persistent is 1
36 SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE
37 database_name = 'test' AND
38 table_name = 'test_ps_create_table';
39
40 DROP TABLE test_ps_create_table;
41
42 ##
43
44 CREATE TABLE test_ps_create_table (a INT, PRIMARY KEY (a))
45 ENGINE=INNODB STATS_PERSISTENT=default;
46
47 # 1 row should be present if the default of --innodb-stats-persistent is 1
48 SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE
49 database_name = 'test' AND
50 table_name = 'test_ps_create_table';
51
52 DROP TABLE test_ps_create_table;
53
54 ##
55
56 CREATE TABLE test_ps_create_table (a INT, PRIMARY KEY (a))
57 ENGINE=INNODB STATS_PERSISTENT=1;
58
59 # 1 row should be present
60 SELECT COUNT(*) FROM mysql.innodb_table_stats WHERE
61 database_name = 'test' AND
62 table_name = 'test_ps_create_table';
63
64 DROP TABLE test_ps_create_table;
65
66 set global innodb_stats_persistent= @save_innodb_stats_persistent;