~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/r/partition_mgm_lc1_ndb.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Creating database MySQL_TEST_DB
 
2
CREATE DATABASE MySQL_Test_DB;
 
3
USE MySQL_Test_DB;
 
4
# 1.0 KEY partitioning mgm
 
5
# Creating KEY partitioned table
 
6
CREATE TABLE TableA (a INT)
 
7
ENGINE = 'NDBCluster'
 
8
PARTITION BY KEY (a)
 
9
(PARTITION parta ,
 
10
PARTITION partB ,
 
11
PARTITION Partc ,
 
12
PARTITION PartD );
 
13
INSERT INTO TableA VALUES (1), (2), (7), (8), (9), (10);
 
14
INSERT INTO TableA VALUES (3), (4), (5), (6), (11), (12);
 
15
SELECT * FROM TableA;
 
16
a
 
17
1
 
18
10
 
19
11
 
20
12
 
21
2
 
22
3
 
23
4
 
24
5
 
25
6
 
26
7
 
27
8
 
28
9
 
29
# Test of ADD/COALESCE PARTITIONS
 
30
# expecting duplicate partition name
 
31
ALTER TABLE TableA ADD PARTITION
 
32
(PARTITION partA,
 
33
PARTITION Parta,
 
34
PARTITION PartA);
 
35
ERROR HY000: Duplicate partition name parta
 
36
ALTER TABLE TableA ADD PARTITION
 
37
(PARTITION partE,
 
38
PARTITION Partf,
 
39
PARTITION PartG);
 
40
SELECT * FROM TableA;
 
41
a
 
42
1
 
43
10
 
44
11
 
45
12
 
46
2
 
47
3
 
48
4
 
49
5
 
50
6
 
51
7
 
52
8
 
53
9
 
54
SHOW CREATE TABLE TableA;
 
55
Table   Create Table
 
56
TableA  CREATE TABLE `tablea` (
 
57
  `a` int(11) DEFAULT NULL
 
58
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
59
/*!50100 PARTITION BY KEY (a)
 
60
(PARTITION parta ENGINE = ndbcluster,
 
61
 PARTITION partB ENGINE = ndbcluster,
 
62
 PARTITION Partc ENGINE = ndbcluster,
 
63
 PARTITION PartD ENGINE = ndbcluster,
 
64
 PARTITION partE ENGINE = ndbcluster,
 
65
 PARTITION Partf ENGINE = ndbcluster,
 
66
 PARTITION PartG ENGINE = ndbcluster) */
 
67
ALTER TABLE TableA COALESCE PARTITION 4;
 
68
SELECT * FROM TableA;
 
69
a
 
70
1
 
71
10
 
72
11
 
73
12
 
74
2
 
75
3
 
76
4
 
77
5
 
78
6
 
79
7
 
80
8
 
81
9
 
82
SHOW CREATE TABLE TableA;
 
83
Table   Create Table
 
84
TableA  CREATE TABLE `tablea` (
 
85
  `a` int(11) DEFAULT NULL
 
86
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
87
/*!50100 PARTITION BY KEY (a)
 
88
(PARTITION parta ENGINE = ndbcluster,
 
89
 PARTITION partB ENGINE = ndbcluster,
 
90
 PARTITION Partc ENGINE = ndbcluster) */
 
91
# Test of REORGANIZE PARTITIONS
 
92
# Should not work on HASH/KEY
 
93
ALTER TABLE TableA REORGANIZE PARTITION parta,partB,Partc INTO
 
94
(PARTITION PARTA ,
 
95
PARTITION partc );
 
96
ERROR HY000: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers
 
97
ALTER TABLE TableA REORGANIZE PARTITION parta,Partc INTO
 
98
(PARTITION partB ,
 
99
PARTITION parta );
 
100
ERROR HY000: When reorganizing a set of partitions they must be in consecutive order
 
101
ALTER TABLE TableA REORGANIZE PARTITION parta,partB INTO
 
102
(PARTITION partB  COMMENT="Previusly named parta",
 
103
PARTITION parta  COMMENT="Previusly named partB");
 
104
SELECT * FROM TableA;
 
105
a
 
106
1
 
107
10
 
108
11
 
109
12
 
110
2
 
111
3
 
112
4
 
113
5
 
114
6
 
115
7
 
116
8
 
117
9
 
118
SHOW CREATE TABLE TableA;
 
119
Table   Create Table
 
120
TableA  CREATE TABLE `tablea` (
 
121
  `a` int(11) DEFAULT NULL
 
122
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
123
/*!50100 PARTITION BY KEY (a)
 
124
(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
 
125
 PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
 
126
 PARTITION Partc ENGINE = ndbcluster) */
 
127
# Test of RENAME TABLE
 
128
RENAME TABLE TableA to TableB;
 
129
SELECT * FROM TableB;
 
130
a
 
131
1
 
132
10
 
133
11
 
134
12
 
135
2
 
136
3
 
137
4
 
138
5
 
139
6
 
140
7
 
141
8
 
142
9
 
143
RENAME TABLE TableB to TableA;
 
144
SELECT * FROM TableA;
 
145
a
 
146
1
 
147
10
 
148
11
 
149
12
 
150
2
 
151
3
 
152
4
 
153
5
 
154
6
 
155
7
 
156
8
 
157
9
 
158
# Checking name comparision Upper vs Lower case
 
159
# Error if lower_case_table_names != 0
 
160
# lower_case_table_names: 1
 
161
CREATE TABLE tablea (a INT)
 
162
ENGINE = 'NDBCluster'
 
163
PARTITION BY KEY (a)
 
164
(PARTITION parta ,
 
165
PARTITION partB ,
 
166
PARTITION Partc ,
 
167
PARTITION PartD );
 
168
ERROR 42S01: Table 'tablea' already exists
 
169
SHOW TABLES;
 
170
Tables_in_mysql_test_db
 
171
tablea
 
172
RENAME TABLE TableA to tablea;
 
173
ERROR 42S01: Table 'tablea' already exists
 
174
RENAME TABLE tablea to TableA;
 
175
ERROR 42S01: Table 'tablea' already exists
 
176
SELECT * FROM tablea;
 
177
a
 
178
1
 
179
10
 
180
11
 
181
12
 
182
2
 
183
3
 
184
4
 
185
5
 
186
6
 
187
7
 
188
8
 
189
9
 
190
SHOW CREATE TABLE tablea;
 
191
Table   Create Table
 
192
tablea  CREATE TABLE `tablea` (
 
193
  `a` int(11) DEFAULT NULL
 
194
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
195
/*!50100 PARTITION BY KEY (a)
 
196
(PARTITION partB COMMENT = 'Previusly named parta' ENGINE = ndbcluster,
 
197
 PARTITION parta COMMENT = 'Previusly named partB' ENGINE = ndbcluster,
 
198
 PARTITION Partc ENGINE = ndbcluster) */
 
199
# Test of REMOVE PARTITIONING
 
200
ALTER TABLE TableA REMOVE PARTITIONING;
 
201
SELECT * FROM TableA;
 
202
a
 
203
1
 
204
10
 
205
11
 
206
12
 
207
2
 
208
3
 
209
4
 
210
5
 
211
6
 
212
7
 
213
8
 
214
9
 
215
SHOW CREATE TABLE TableA;
 
216
Table   Create Table
 
217
TableA  CREATE TABLE `tablea` (
 
218
  `a` int(11) DEFAULT NULL
 
219
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
220
# Cleaning up after KEY PARTITIONING test
 
221
DROP TABLE TableA;
 
222
# Cleaning up before exit
 
223
USE test;
 
224
DROP DATABASE MySQL_Test_DB;