~jlukas79/+junk/mysql-server

« back to all changes in this revision

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

manual merge 6.0-main --> 6.0-bka-review

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
 
 
49
 
Fragment type: 5
50
 
K Value: 6
51
 
Min load factor: 78
52
 
Max load factor: 80
53
 
Temporary table: no
54
 
Number of attributes: 4
55
 
Number of primary keys: 3
56
 
Length of frm data: #
57
 
Row Checksum: 1
58
 
Row GCI: 1
59
 
SingleUserMode: 0
60
 
ForceVarPart: 1
61
 
TableStatus: Retrieved
62
 
a Int PRIMARY KEY AT=FIXED ST=MEMORY
63
 
b Char(10;latin1_bin) PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
64
 
c Int PRIMARY KEY AT=FIXED ST=MEMORY
65
 
d Int NULL AT=FIXED ST=MEMORY
66
 
 
67
 
PRIMARY KEY(a, b, c) - UniqueHashIndex
68
 
 
69
 
 
70
 
NDBT_ProgramExit: 0 - OK
71
 
 
72
 
show create table t1;
73
 
Table   Create Table
74
 
t1      CREATE TABLE `t1` (
75
 
  `a` int(11) NOT NULL DEFAULT '0',
76
 
  `b` char(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
77
 
  `c` int(11) NOT NULL DEFAULT '0',
78
 
  `d` int(11) DEFAULT NULL,
79
 
  PRIMARY KEY (`a`,`b`,`c`) USING HASH
80
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (b)  */
81
 
DROP TABLE t1;
82
 
CREATE TABLE t1 (a int not null primary key)
83
 
PARTITION BY KEY(a)
84
 
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
85
 
drop table t1;
86
 
CREATE TABLE t1 (a int not null primary key);
87
 
ALTER TABLE t1
88
 
ENGINE = NDB
89
 
PARTITION BY KEY(a)
90
 
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
91
 
drop table t1;
92
 
CREATE TABLE t1 (a int not null primary key) ENGINE = NDB;
93
 
ALTER TABLE t1
94
 
PARTITION BY KEY(a)
95
 
(PARTITION p0 ENGINE = NDB, PARTITION p1 ENGINE = NDB);
96
 
drop table t1;
97
 
create table t1 (a int)
98
 
engine=ndb
99
 
partition by key(a)
100
 
(partition p0, partition p1);
101
 
show create table t1;
102
 
Table   Create Table
103
 
t1      CREATE TABLE `t1` (
104
 
  `a` int(11) DEFAULT NULL
105
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
106
 
alter table t1 engine=heap;
107
 
show create table t1;
108
 
Table   Create Table
109
 
t1      CREATE TABLE `t1` (
110
 
  `a` int(11) DEFAULT NULL
111
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = MEMORY, PARTITION p1 ENGINE = MEMORY) */
112
 
alter table t1 engine=ndb;
113
 
show create table t1;
114
 
Table   Create Table
115
 
t1      CREATE TABLE `t1` (
116
 
  `a` int(11) DEFAULT NULL
117
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
118
 
alter table t1 engine=heap remove partitioning;
119
 
show create table t1;
120
 
Table   Create Table
121
 
t1      CREATE TABLE `t1` (
122
 
  `a` int(11) DEFAULT NULL
123
 
) ENGINE=MEMORY DEFAULT CHARSET=latin1
124
 
alter table t1 engine=ndb
125
 
partition by key(a)
126
 
(partition p0, partition p1 engine = ndb);
127
 
show create table t1;
128
 
Table   Create Table
129
 
t1      CREATE TABLE `t1` (
130
 
  `a` int(11) DEFAULT NULL
131
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
132
 
alter table t1
133
 
partition by key (a)
134
 
(partition p0 engine=ndb, partition p1 engine=ndb);
135
 
show create table t1;
136
 
Table   Create Table
137
 
t1      CREATE TABLE `t1` (
138
 
  `a` int(11) DEFAULT NULL
139
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
140
 
alter table t1 remove partitioning;
141
 
show create table t1;
142
 
Table   Create Table
143
 
t1      CREATE TABLE `t1` (
144
 
  `a` int(11) DEFAULT NULL
145
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1
146
 
alter table t1
147
 
partition by key(a)
148
 
(partition p0 engine=ndb, partition p1);
149
 
alter table t1
150
 
engine=ndb
151
 
partition by key(a)
152
 
(partition p0 engine=ndb, partition p1 engine = ndb);
153
 
show create table t1;
154
 
Table   Create Table
155
 
t1      CREATE TABLE `t1` (
156
 
  `a` int(11) DEFAULT NULL
157
 
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY (a) (PARTITION p0 ENGINE = ndbcluster, PARTITION p1 ENGINE = ndbcluster) */
158
 
drop table t1;
159
 
CREATE TABLE t1 (
160
 
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
161
 
c2 TEXT NOT NULL,
162
 
c3 INT NOT NULL,
163
 
c4 BIT NOT NULL,
164
 
c5 FLOAT,
165
 
c6 VARCHAR(255),
166
 
c7 TIMESTAMP,
167
 
PRIMARY KEY(c1,c3))
168
 
ENGINE=NDB
169
 
PARTITION BY KEY(c3) PARTITIONS 5;
170
 
ALTER TABLE t1 COALESCE PARTITION 4;
171
 
DROP TABLE t1;
172
 
CREATE TABLE t1 (a int primary key)
173
 
ENGINE=NDB
174
 
PARTITION BY KEY(a);
175
 
ALTER TABLE t1 OPTIMIZE PARTITION p0;
176
 
ERROR HY000: Table storage engine for 't1' doesn't have this option
177
 
ALTER TABLE t1 CHECK PARTITION p0;
178
 
ERROR HY000: Table storage engine for 't1' doesn't have this option
179
 
ALTER TABLE t1 REPAIR PARTITION p0;
180
 
ERROR HY000: Table storage engine for 't1' doesn't have this option
181
 
ALTER TABLE t1 ANALYZE PARTITION p0;
182
 
ERROR HY000: Table storage engine for 't1' doesn't have this option
183
 
ALTER TABLE t1 REBUILD PARTITION p0;
184
 
ERROR HY000: Table storage engine for 't1' doesn't have this option
185
 
DROP TABLE t1;
186
 
CREATE TABLE t1 (
187
 
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
188
 
c2 TEXT NOT NULL,
189
 
c3 INT NOT NULL,
190
 
PRIMARY KEY(c1,c3))
191
 
ENGINE=NDB
192
 
PARTITION BY KEY(c3) PARTITIONS 5;
193
 
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
194
 
DROP TABLE t1;
195
 
CREATE TABLE t1 (
196
 
c1 MEDIUMINT NOT NULL AUTO_INCREMENT,
197
 
c2 TEXT NOT NULL,
198
 
c3 INT NOT NULL,
199
 
PRIMARY KEY(c1,c3))
200
 
ENGINE=NDB
201
 
PARTITION BY KEY(c3);
202
 
ALTER TABLE t1 ADD COLUMN c4 INT AFTER c1;
203
 
DROP TABLE t1;