~linuxjedi/drizzle/trunk-bug-667053

« back to all changes in this revision

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

  • Committer: brian
  • Date: 2008-06-25 05:29:13 UTC
  • Revision ID: brian@localhost.localdomain-20080625052913-6upwo0jsrl4lnapl
clean slate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
DROP TABLE IF EXISTS t1;
 
2
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b,c))
 
3
ENGINE = NDB
 
4
PARTITION BY KEY (a,b);
 
5
insert into t1 values (1,1,1,1);
 
6
select * from t1;
 
7
a       b       c       d
 
8
1       1       1       1
 
9
update t1 set d = 2 where a = 1 and b = 1 and c = 1;
 
10
select * from t1;
 
11
a       b       c       d
 
12
1       1       1       2
 
13
delete from t1;
 
14
select * from t1;
 
15
a       b       c       d
 
16
drop table t1;
 
17
CREATE TABLE t1 (a int, b int, c int, d int, PRIMARY KEY(a,b))
 
18
ENGINE = NDB
 
19
PARTITION BY KEY (c);
 
20
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
 
21
CREATE TABLE t1 (a int, b int, c int, PRIMARY KEY(a,b))
 
22
ENGINE = NDB
 
23
PARTITION BY KEY (a);
 
24
insert into t1 values 
 
25
(1,1,3),(1,2,3),(1,3,3),(1,4,3),(1,5,3),(1,6,3),
 
26
(1,7,3),(1,8,3),(1,9,3),(1,10,3),(1,11,3),(1,12,3);
 
27
select * from t1 order by b;
 
28
a       b       c
 
29
1       1       3
 
30
1       2       3
 
31
1       3       3
 
32
1       4       3
 
33
1       5       3
 
34
1       6       3
 
35
1       7       3
 
36
1       8       3
 
37
1       9       3
 
38
1       10      3
 
39
1       11      3
 
40
1       12      3
 
41
DROP TABLE t1;
 
42
CREATE TABLE t1 (a INT, b CHAR(10) COLLATE latin1_bin, c INT, d INT,
 
43
PRIMARY KEY (a,b,c) USING HASH)
 
44
ENGINE=NDB
 
45
DEFAULT CHARSET=latin1
 
46
PARTITION BY KEY (b);
 
47
insert into t1 values (1,"a",1,1),(2,"a",1,1),(3,"a",1,1);
 
48
-- t1 --
 
49
 
 
50
Fragment type: 5
 
51
K Value: 6
 
52
Min load factor: 78
 
53
Max load factor: 80
 
54
Temporary table: no
 
55
Number of attributes: 4
 
56
Number of primary keys: 3
 
57
Length of frm data: #
 
58
Row Checksum: 1
 
59
Row GCI: 1
 
60
SingleUserMode: 0
 
61
ForceVarPart: 1
 
62
TableStatus: Retrieved
 
63
-- Attributes -- 
 
64
a Int PRIMARY KEY AT=FIXED ST=MEMORY
 
65
b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
 
66
c Int PRIMARY KEY AT=FIXED ST=MEMORY
 
67
d Int NULL AT=FIXED ST=MEMORY
 
68
 
 
69
-- Indexes -- 
 
70
PRIMARY KEY(a, b, c) - UniqueHashIndex
 
71
 
 
72
 
 
73
NDBT_ProgramExit: 0 - OK
 
74
 
 
75
show create table t1;
 
76
Table   Create Table
 
77
t1      CREATE TABLE `t1` (
 
78
  `a` int(11) NOT NULL DEFAULT '0',
 
79
  `b` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
 
80
  `c` int(11) NOT NULL DEFAULT '0',
 
81
  `d` int(11) DEFAULT NULL,
 
82
  PRIMARY KEY (`a`,`b`,`c`) USING HASH
 
83
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b)  */
 
84
DROP TABLE t1;
 
85
CREATE TABLE t1 (a int not null primary key)
 
86
PARTITION BY KEY(a)
 
87
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
 
88
drop table t1;
 
89
CREATE TABLE t1 (a int not null primary key);
 
90
ALTER TABLE t1
 
91
ENGINE = NDB
 
92
PARTITION BY KEY(a)
 
93
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
 
94
drop table t1;
 
95
CREATE TABLE t1 (a int not null primary key) ENGINE = NDB;
 
96
ALTER TABLE t1
 
97
PARTITION BY KEY(a)
 
98
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
 
99
drop table t1;
 
100
create table t1 (a int)
 
101
engine=ndb
 
102
partition by key(a)
 
103
(partition p0, partition p1);
 
104
show create table t1;
 
105
Table   Create Table
 
106
t1      CREATE TABLE `t1` (
 
107
  `a` int(11) DEFAULT NULL
 
108
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
 
109
alter table t1 engine=heap;
 
110
show create table t1;
 
111
Table   Create Table
 
112
t1      CREATE TABLE `t1` (
 
113
  `a` int(11) DEFAULT NULL
 
114
) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
 
115
alter table t1 engine=ndb;
 
116
show create table t1;
 
117
Table   Create Table
 
118
t1      CREATE TABLE `t1` (
 
119
  `a` int(11) DEFAULT NULL
 
120
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
 
121
alter table t1 engine=heap remove partitioning;
 
122
show create table t1;
 
123
Table   Create Table
 
124
t1      CREATE TABLE `t1` (
 
125
  `a` int(11) DEFAULT NULL
 
126
) ENGINE=MEMORY DEFAULT CHARSET=latin1
 
127
alter table t1 engine=ndb
 
128
partition by key(a)
 
129
(partition p0, partition p1 engine = ndb);
 
130
show create table t1;
 
131
Table   Create Table
 
132
t1      CREATE TABLE `t1` (
 
133
  `a` int(11) DEFAULT NULL
 
134
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
 
135
alter table t1
 
136
partition by key (a)
 
137
(partition p0 engine=ndb, partition p1 engine=ndb);
 
138
show create table t1;
 
139
Table   Create Table
 
140
t1      CREATE TABLE `t1` (
 
141
  `a` int(11) DEFAULT NULL
 
142
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
 
143
alter table t1 remove partitioning;
 
144
show create table t1;
 
145
Table   Create Table
 
146
t1      CREATE TABLE `t1` (
 
147
  `a` int(11) DEFAULT NULL
 
148
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
 
149
alter table t1
 
150
partition by key(a)
 
151
(partition p0 engine=ndb, partition p1);
 
152
alter table t1
 
153
engine=ndb
 
154
partition by key(a)
 
155
(partition p0 engine=ndb, partition p1 engine = ndb);
 
156
show create table t1;
 
157
Table   Create Table
 
158
t1      CREATE TABLE `t1` (
 
159
  `a` int(11) DEFAULT NULL
 
160
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
 
161
drop table t1;
 
162
CREATE TABLE t1 (
 
163
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
 
164
c2 TEXT NOT NULL,
 
165
c3 INT NOT NULL,
 
166
c4 BIT NOT NULL,
 
167
c5 FLOAT,
 
168
c6 VARCHAR(255),
 
169
c7 TIMESTAMP,
 
170
PRIMARY KEY(c1,c3))
 
171
ENGINE=NDB
 
172
PARTITION BY KEY(c3) PARTITIONS 5;
 
173
ALTER TABLE t1 COALESCE PARTITION 4;
 
174
DROP TABLE t1;
 
175
CREATE TABLE t1 (a int primary key)
 
176
ENGINE=NDB
 
177
PARTITION BY KEY(a);
 
178
ALTER TABLE t1 OPTIMIZE PARTITION p0;
 
179
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
180
ALTER TABLE t1 CHECK PARTITION p0;
 
181
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
182
ALTER TABLE t1 REPAIR PARTITION p0;
 
183
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
184
ALTER TABLE t1 ANALYZE PARTITION p0;
 
185
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
186
ALTER TABLE t1 REBUILD PARTITION p0;
 
187
ERROR HY000: Table storage engine for 't1' doesn't have this option
 
188
DROP TABLE t1;
 
189
CREATE TABLE t1 (
 
190
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
 
191
c2 TEXT NOT NULL,
 
192
c3 INT NOT NULL,
 
193
PRIMARY KEY(c1,c3))
 
194
ENGINE=NDB
 
195
PARTITION BY KEY(c3) PARTITIONS 5;
 
196
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
 
197
DROP TABLE t1;
 
198
CREATE TABLE t1 (
 
199
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
 
200
c2 TEXT NOT NULL,
 
201
c3 INT NOT NULL,
 
202
PRIMARY KEY(c1,c3))
 
203
ENGINE=NDB
 
204
PARTITION BY KEY(c3);
 
205
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
 
206
DROP TABLE t1;