~ubuntu-branches/ubuntu/trusty/mysql-5.6/trusty

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/t/partition_exch_qa_2.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-12 11:54:27 UTC
  • Revision ID: package-import@ubuntu.com-20140212115427-oq6tfsqxl1wuwehi
Tags: upstream-5.6.15
ImportĀ upstreamĀ versionĀ 5.6.15

Show diffs side-by-side

added added

removed removed

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