Debian Codegraph @

mysql-test/suite/storage_engine/parts/check_table.test

raw
1 #
2 # CHECK TABLE for partitioned tables and ANALYZE PARTITION
3 #
4
5 --source include/have_partition.inc
6 --source ../have_engine.inc
7
8
9 --disable_warnings
10 DROP TABLE IF EXISTS t1, t2;
11 --enable_warnings
12
13 --let $partition_options = PARTITION BY HASH(a) PARTITIONS 2
14 --source ../create_table.inc
15 if ($mysql_errname)
16 {
17 --let $my_last_stmt = $create_statement
18 --let $functionality = Partitions
19 --source ../unexpected_result.inc
20 }
21 if (!$mysql_errname)
22 {
23 INSERT INTO t1 (a,b) VALUES (1,'a'),(2,'b'),(3,'c'),(2,'d'),(4,'e'),(100,'f'),(101,'g');
24
25 let $partition_options = PARTITION BY RANGE(a) (
26 PARTITION p0 VALUES LESS THAN (100),
27 PARTITION p1 VALUES LESS THAN MAXVALUE
28 );
29 --let $table_name = t2
30 --source ../create_table.inc
31
32 INSERT INTO t2 (a,b) SELECT a, b FROM t1;
33
34 let $alter_definition = CHECK PARTITION p0;
35 --source ../alter_table.inc
36 if ($mysql_errname)
37 {
38 --let $my_last_stmt = $alter_statement
39 --let $functionality = ALTER TABLE .. CHECK PARTITION
40 --source ../unexpected_result.inc
41 }
42
43 INSERT INTO t1 (a,b) VALUES (3,'c');
44
45 let $alter_definition = CHECK PARTITION p0, p1 FOR UPGRADE;
46 --source ../alter_table.inc
47
48 INSERT INTO t2 (a,b) VALUES (10000,'e');
49
50 let $alter_definition = CHECK PARTITION p0 QUICK;
51 let $table_name = t2;
52 --source ../alter_table.inc
53
54 INSERT INTO t1 (a,b) VALUES (6,'f');
55
56 let $alter_definition = CHECK PARTITION p1 FAST;
57 --source ../alter_table.inc
58
59 INSERT INTO t2 (a,b) VALUES (8,'h');
60
61 let $alter_definition = CHECK PARTITION p1 MEDIUM;
62 let $table_name = t2;
63 --source ../alter_table.inc
64
65 INSERT INTO t1 (a,b) VALUES (9,'i');
66
67 let $alter_definition = CHECK PARTITION ALL EXTENDED;
68 --source ../alter_table.inc
69
70 INSERT INTO t1 (a,b) VALUES (11,'k');
71
72 let $alter_definition = CHECK PARTITION p0 CHANGED;
73 --source ../alter_table.inc
74
75 DROP TABLE t1, t2;
76 }
77
78 let $extra_tbl_opts = PARTITION BY HASH(a) PARTITIONS 2;
79 --source ../check_table.inc
80
81 --source ../cleanup_engine.inc
82