Debian Codegraph @

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

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