Debian Codegraph @

mysql-test/suite/parts/t/partition_exch_qa_2.test

raw
1 # Author: Horst Hunger
2 # Created: 2010-07-05
3
4 source include/have_partition.inc;
5
6 let $engine_table= MYISAM;
7 let $engine_part= MYISAM;
8 let $engine_subpart= MYISAM;
9
10 use test;
11
12 source suite/parts/inc/part_exch_tabs.inc;
13
14 sorted_result;
15 SELECT * FROM t_10;
16 sorted_result;
17 SELECT * FROM t_100;
18 sorted_result;
19 SELECT * FROM t_1000;
20 sorted_result;
21 SELECT * FROM tp;
22 sorted_result;
23 SELECT * FROM tsp;
24 sorted_result;
25 SELECT * FROM tsp_00;
26 sorted_result;
27 SELECT * FROM tsp_01;
28 sorted_result;
29 SELECT * FROM tsp_02;
30 sorted_result;
31 SELECT * FROM tsp_03;
32 sorted_result;
33 SELECT * FROM tsp_04;
34
35 # 3) Invalid exchanges.
36 # Exchange of partition with table differing in structure.
37 CREATE TABLE t_11(a INT,b VARCHAR(55)) SELECT * FROM t_10;
38 error ER_TABLES_DIFFERENT_METADATA;
39 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
40 DROP TABLE t_11;
41 eval CREATE TABLE t_11(a INT,b CHAR(55),PRIMARY KEY(a)) ENGINE= $engine_table SELECT * FROM t_10;
42 error ER_TABLES_DIFFERENT_METADATA;
43 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
44 DROP TABLE t_11;
45 CREATE TABLE t_11(a INT,b VARCHAR(55),PRIMARY KEY(a)) ENGINE= MEMORY SELECT * FROM t_10;
46 error ER_MIX_HANDLER_ERROR;
47 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
48 DROP TABLE t_11;
49 # Exchange of partition with partitioned table.
50 eval CREATE TABLE t_11(a INT,b CHAR(55),PRIMARY KEY(a)) ENGINE= $engine_table
51 PARTITION BY KEY() AS SELECT * FROM t_10;
52 error ER_PARTITION_EXCHANGE_PART_TABLE;
53 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_11;
54 DROP TABLE t_11;
55 # Exchange of subpartition with partitioned table.
56 error ER_PARTITION_EXCHANGE_PART_TABLE;
57 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE tsp;
58 # Exchange of subpartitioned partition with table.
59 error ER_PARTITION_INSTEAD_OF_SUBPARTITION;
60 ALTER TABLE tsp EXCHANGE PARTITION p0 WITH TABLE t_10;
61 # Exchange of values in partition not fitting the hash.
62 error ER_ROW_DOES_NOT_MATCH_PARTITION;
63 ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_100;
64 # Exchange of values in subpartition not fitting the hash.
65 error ER_ROW_DOES_NOT_MATCH_PARTITION;
66 ALTER TABLE tp EXCHANGE PARTITION p2 WITH TABLE t_10;
67
68 source suite/parts/inc/part_exch_drop_tabs.inc;
69