Debian Codegraph @

mysql-test/suite/ndb/r/ndb_alter_table.result

raw
1 CREATE TABLE t1 (
2 a INT NOT NULL,
3 b INT NOT NULL
4 ) ENGINE=ndbcluster;
5 INSERT INTO t1 VALUES (9410,9412);
6 ALTER TABLE t1 ADD COLUMN c int not null;
7 SELECT * FROM t1;
8 a b c
9 9410 9412 0
10 DROP TABLE t1;
11 CREATE DATABASE mysqltest;
12 USE mysqltest;
13 CREATE TABLE t1 (
14 a INT NOT NULL,
15 b INT NOT NULL
16 ) ENGINE=ndbcluster;
17 RENAME TABLE t1 TO test.t1;
18 SHOW TABLES;
19 Tables_in_mysqltest
20 DROP DATABASE mysqltest;
21 USE test;
22 SHOW TABLES;
23 Tables_in_test
24 t1
25 DROP TABLE t1;
26 create table t1 (
27 col1 int not null auto_increment primary key,
28 col2 varchar(30) not null,
29 col3 varchar (20) not null,
30 col4 varchar(4) not null,
31 col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
32 col6 int not null, to_be_deleted int) ENGINE=ndbcluster charset=latin1;
33 show table status;
34 Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
35 t1 ndbcluster 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
36 SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
37 insert into t1 values
38 (0,4,3,5,"PENDING",1,7),(NULL,4,3,5,"PENDING",1,7),(31,4,3,5,"PENDING",1,7), (7,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7), (100,4,3,5,"PENDING",1,7), (99,4,3,5,"PENDING",1,7), (8,4,3,5,"PENDING",1,7), (NULL,4,3,5,"PENDING",1,7);
39 show table status;
40 Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
41 t1 ndbcluster 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
42 select * from t1 order by col1;
43 col1 col2 col3 col4 col5 col6 to_be_deleted
44 0 4 3 5 PENDING 1 7
45 1 4 3 5 PENDING 1 7
46 7 4 3 5 PENDING 1 7
47 8 4 3 5 PENDING 1 7
48 31 4 3 5 PENDING 1 7
49 32 4 3 5 PENDING 1 7
50 99 4 3 5 PENDING 1 7
51 100 4 3 5 PENDING 1 7
52 101 4 3 5 PENDING 1 7
53 alter table t1
54 add column col4_5 varchar(20) not null after col4,
55 add column col7 varchar(30) not null after col5,
56 add column col8 datetime not null, drop column to_be_deleted,
57 change column col2 fourth varchar(30) not null after col3,
58 modify column col6 int not null first;
59 show table status;
60 Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
61 t1 ndbcluster 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
62 select * from t1 order by col1;
63 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
64 1 0 3 4 5 PENDING 0000-00-00 00:00:00
65 1 1 3 4 5 PENDING 0000-00-00 00:00:00
66 1 7 3 4 5 PENDING 0000-00-00 00:00:00
67 1 8 3 4 5 PENDING 0000-00-00 00:00:00
68 1 31 3 4 5 PENDING 0000-00-00 00:00:00
69 1 32 3 4 5 PENDING 0000-00-00 00:00:00
70 1 99 3 4 5 PENDING 0000-00-00 00:00:00
71 1 100 3 4 5 PENDING 0000-00-00 00:00:00
72 1 101 3 4 5 PENDING 0000-00-00 00:00:00
73 insert into t1 values (2, NULL,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
74 show table status;
75 Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
76 t1 ndbcluster 10 Dynamic 0 # # # 0 # 1 # # # latin1_swedish_ci NULL #
77 select * from t1 order by col1;
78 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
79 1 0 3 4 5 PENDING 0000-00-00 00:00:00
80 1 1 3 4 5 PENDING 0000-00-00 00:00:00
81 1 7 3 4 5 PENDING 0000-00-00 00:00:00
82 1 8 3 4 5 PENDING 0000-00-00 00:00:00
83 1 31 3 4 5 PENDING 0000-00-00 00:00:00
84 1 32 3 4 5 PENDING 0000-00-00 00:00:00
85 1 99 3 4 5 PENDING 0000-00-00 00:00:00
86 1 100 3 4 5 PENDING 0000-00-00 00:00:00
87 1 101 3 4 5 PENDING 0000-00-00 00:00:00
88 2 102 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
89 delete from t1;
90 insert into t1 values (0,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
91 SET SQL_MODE='';
92 insert into t1 values (1,0,4,3,5,99,"PENDING","EXTRA",'2004-01-01 00:00:00');
93 select * from t1 order by col1;
94 col6 col1 col3 fourth col4 col4_5 col5 col7 col8
95 0 0 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
96 1 103 4 3 5 99 PENDING EXTRA 2004-01-01 00:00:00
97 alter table t1 drop column col4_5;
98 insert into t1 values (2,0,4,3,5,"PENDING","EXTRA",'2004-01-01 00:00:00');
99 select * from t1 order by col1;
100 col6 col1 col3 fourth col4 col5 col7 col8
101 0 0 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
102 1 103 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
103 2 104 4 3 5 PENDING EXTRA 2004-01-01 00:00:00
104 drop table t1;
105 CREATE TABLE t1 (
106 a INT NOT NULL,
107 b INT NOT NULL
108 ) ENGINE=ndbcluster;
109 INSERT INTO t1 VALUES (9410,9412);
110 ALTER TABLE t1 ADD COLUMN c int not null;
111 select * from t1 order by a;
112 a b c
113 9410 9412 0
114 select * from t1 order by a;
115 a b c
116 9410 9412 0
117 alter table t1 drop c;
118 select * from t1 order by a;
119 a b
120 9410 9412
121 drop table t1;
122 select * from t1 order by a;
123 ERROR 42S02: Table 'test.t1' doesn't exist
124 CREATE TABLE t1 (
125 a INT NOT NULL PRIMARY KEY,
126 b INT NOT NULL
127 ) ENGINE=ndbcluster;
128 INSERT INTO t1 VALUES (0,1),(17,18);
129 select * from t1 order by a;
130 a b
131 0 1
132 17 18
133 SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
134 alter table t1 modify column a int not null auto_increment;
135 SET SQL_MODE='';
136 select * from t1 order by a;
137 a b
138 0 1
139 17 18
140 INSERT INTO t1 VALUES (0,19),(20,21);
141 select * from t1 order by a;
142 a b
143 0 1
144 17 18
145 18 19
146 20 21
147 drop table t1;
148 CREATE TABLE t1 (
149 a INT NOT NULL PRIMARY KEY,
150 b INT NOT NULL
151 ) ENGINE=ndbcluster;
152 INSERT INTO t1 VALUES (0,1),(17,18);
153 select * from t1 order by a;
154 a b
155 0 1
156 17 18
157 alter table t1 add c int not null unique auto_increment;
158 select c from t1 order by c;
159 c
160 1
161 2
162 INSERT INTO t1 VALUES (1,2,0),(18,19,4),(20,21,0);
163 select c from t1 order by c;
164 c
165 1
166 2
167 3
168 4
169 5
170 drop table t1;
171 create table t1 (
172 ai bigint auto_increment,
173 c001 int(11) not null,
174 c002 int(11) not null,
175 c003 int(11) not null,
176 c004 int(11) not null,
177 c005 int(11) not null,
178 c006 int(11) not null,
179 c007 int(11) not null,
180 c008 int(11) not null,
181 c009 int(11) not null,
182 c010 int(11) not null,
183 c011 int(11) not null,
184 c012 int(11) not null,
185 c013 int(11) not null,
186 c014 int(11) not null,
187 c015 int(11) not null,
188 c016 int(11) not null,
189 c017 int(11) not null,
190 c018 int(11) not null,
191 c019 int(11) not null,
192 c020 int(11) not null,
193 c021 int(11) not null,
194 c022 int(11) not null,
195 c023 int(11) not null,
196 c024 int(11) not null,
197 c025 int(11) not null,
198 c026 int(11) not null,
199 c027 int(11) not null,
200 c028 int(11) not null,
201 c029 int(11) not null,
202 c030 int(11) not null,
203 c031 int(11) not null,
204 c032 int(11) not null,
205 c033 int(11) not null,
206 c034 int(11) not null,
207 c035 int(11) not null,
208 c036 int(11) not null,
209 c037 int(11) not null,
210 c038 int(11) not null,
211 c039 int(11) not null,
212 c040 int(11) not null,
213 c041 int(11) not null,
214 c042 int(11) not null,
215 c043 int(11) not null,
216 c044 int(11) not null,
217 c045 int(11) not null,
218 c046 int(11) not null,
219 c047 int(11) not null,
220 c048 int(11) not null,
221 c049 int(11) not null,
222 c050 int(11) not null,
223 c051 int(11) not null,
224 c052 int(11) not null,
225 c053 int(11) not null,
226 c054 int(11) not null,
227 c055 int(11) not null,
228 c056 int(11) not null,
229 c057 int(11) not null,
230 c058 int(11) not null,
231 c059 int(11) not null,
232 c060 int(11) not null,
233 c061 int(11) not null,
234 c062 int(11) not null,
235 c063 int(11) not null,
236 c064 int(11) not null,
237 c065 int(11) not null,
238 c066 int(11) not null,
239 c067 int(11) not null,
240 c068 int(11) not null,
241 c069 int(11) not null,
242 c070 int(11) not null,
243 c071 int(11) not null,
244 c072 int(11) not null,
245 c073 int(11) not null,
246 c074 int(11) not null,
247 c075 int(11) not null,
248 c076 int(11) not null,
249 c077 int(11) not null,
250 c078 int(11) not null,
251 c079 int(11) not null,
252 c080 int(11) not null,
253 c081 int(11) not null,
254 c082 int(11) not null,
255 c083 int(11) not null,
256 c084 int(11) not null,
257 c085 int(11) not null,
258 c086 int(11) not null,
259 c087 int(11) not null,
260 c088 int(11) not null,
261 c089 int(11) not null,
262 c090 int(11) not null,
263 c091 int(11) not null,
264 c092 int(11) not null,
265 c093 int(11) not null,
266 c094 int(11) not null,
267 c095 int(11) not null,
268 c096 int(11) not null,
269 c097 int(11) not null,
270 c098 int(11) not null,
271 c099 int(11) not null,
272 c100 int(11) not null,
273 c101 int(11) not null,
274 c102 int(11) not null,
275 c103 int(11) not null,
276 c104 int(11) not null,
277 c105 int(11) not null,
278 c106 int(11) not null,
279 c107 int(11) not null,
280 c108 int(11) not null,
281 c109 int(11) not null,
282 primary key (ai),
283 unique key tx1 (c002, c003, c004, c005)) engine=ndb;
284 Warnings:
285 Warning 1681 Integer display width is deprecated and will be removed in a future release.
286 Warning 1681 Integer display width is deprecated and will be removed in a future release.
287 Warning 1681 Integer display width is deprecated and will be removed in a future release.
288 Warning 1681 Integer display width is deprecated and will be removed in a future release.
289 Warning 1681 Integer display width is deprecated and will be removed in a future release.
290 Warning 1681 Integer display width is deprecated and will be removed in a future release.
291 Warning 1681 Integer display width is deprecated and will be removed in a future release.
292 Warning 1681 Integer display width is deprecated and will be removed in a future release.
293 Warning 1681 Integer display width is deprecated and will be removed in a future release.
294 Warning 1681 Integer display width is deprecated and will be removed in a future release.
295 Warning 1681 Integer display width is deprecated and will be removed in a future release.
296 Warning 1681 Integer display width is deprecated and will be removed in a future release.
297 Warning 1681 Integer display width is deprecated and will be removed in a future release.
298 Warning 1681 Integer display width is deprecated and will be removed in a future release.
299 Warning 1681 Integer display width is deprecated and will be removed in a future release.
300 Warning 1681 Integer display width is deprecated and will be removed in a future release.
301 Warning 1681 Integer display width is deprecated and will be removed in a future release.
302 Warning 1681 Integer display width is deprecated and will be removed in a future release.
303 Warning 1681 Integer display width is deprecated and will be removed in a future release.
304 Warning 1681 Integer display width is deprecated and will be removed in a future release.
305 Warning 1681 Integer display width is deprecated and will be removed in a future release.
306 Warning 1681 Integer display width is deprecated and will be removed in a future release.
307 Warning 1681 Integer display width is deprecated and will be removed in a future release.
308 Warning 1681 Integer display width is deprecated and will be removed in a future release.
309 Warning 1681 Integer display width is deprecated and will be removed in a future release.
310 Warning 1681 Integer display width is deprecated and will be removed in a future release.
311 Warning 1681 Integer display width is deprecated and will be removed in a future release.
312 Warning 1681 Integer display width is deprecated and will be removed in a future release.
313 Warning 1681 Integer display width is deprecated and will be removed in a future release.
314 Warning 1681 Integer display width is deprecated and will be removed in a future release.
315 Warning 1681 Integer display width is deprecated and will be removed in a future release.
316 Warning 1681 Integer display width is deprecated and will be removed in a future release.
317 Warning 1681 Integer display width is deprecated and will be removed in a future release.
318 Warning 1681 Integer display width is deprecated and will be removed in a future release.
319 Warning 1681 Integer display width is deprecated and will be removed in a future release.
320 Warning 1681 Integer display width is deprecated and will be removed in a future release.
321 Warning 1681 Integer display width is deprecated and will be removed in a future release.
322 Warning 1681 Integer display width is deprecated and will be removed in a future release.
323 Warning 1681 Integer display width is deprecated and will be removed in a future release.
324 Warning 1681 Integer display width is deprecated and will be removed in a future release.
325 Warning 1681 Integer display width is deprecated and will be removed in a future release.
326 Warning 1681 Integer display width is deprecated and will be removed in a future release.
327 Warning 1681 Integer display width is deprecated and will be removed in a future release.
328 Warning 1681 Integer display width is deprecated and will be removed in a future release.
329 Warning 1681 Integer display width is deprecated and will be removed in a future release.
330 Warning 1681 Integer display width is deprecated and will be removed in a future release.
331 Warning 1681 Integer display width is deprecated and will be removed in a future release.
332 Warning 1681 Integer display width is deprecated and will be removed in a future release.
333 Warning 1681 Integer display width is deprecated and will be removed in a future release.
334 Warning 1681 Integer display width is deprecated and will be removed in a future release.
335 Warning 1681 Integer display width is deprecated and will be removed in a future release.
336 Warning 1681 Integer display width is deprecated and will be removed in a future release.
337 Warning 1681 Integer display width is deprecated and will be removed in a future release.
338 Warning 1681 Integer display width is deprecated and will be removed in a future release.
339 Warning 1681 Integer display width is deprecated and will be removed in a future release.
340 Warning 1681 Integer display width is deprecated and will be removed in a future release.
341 Warning 1681 Integer display width is deprecated and will be removed in a future release.
342 Warning 1681 Integer display width is deprecated and will be removed in a future release.
343 Warning 1681 Integer display width is deprecated and will be removed in a future release.
344 Warning 1681 Integer display width is deprecated and will be removed in a future release.
345 Warning 1681 Integer display width is deprecated and will be removed in a future release.
346 Warning 1681 Integer display width is deprecated and will be removed in a future release.
347 Warning 1681 Integer display width is deprecated and will be removed in a future release.
348 Warning 1681 Integer display width is deprecated and will be removed in a future release.
349 Warning 1681 Integer display width is deprecated and will be removed in a future release.
350 Warning 1681 Integer display width is deprecated and will be removed in a future release.
351 Warning 1681 Integer display width is deprecated and will be removed in a future release.
352 Warning 1681 Integer display width is deprecated and will be removed in a future release.
353 Warning 1681 Integer display width is deprecated and will be removed in a future release.
354 Warning 1681 Integer display width is deprecated and will be removed in a future release.
355 Warning 1681 Integer display width is deprecated and will be removed in a future release.
356 Warning 1681 Integer display width is deprecated and will be removed in a future release.
357 Warning 1681 Integer display width is deprecated and will be removed in a future release.
358 Warning 1681 Integer display width is deprecated and will be removed in a future release.
359 Warning 1681 Integer display width is deprecated and will be removed in a future release.
360 Warning 1681 Integer display width is deprecated and will be removed in a future release.
361 Warning 1681 Integer display width is deprecated and will be removed in a future release.
362 Warning 1681 Integer display width is deprecated and will be removed in a future release.
363 Warning 1681 Integer display width is deprecated and will be removed in a future release.
364 Warning 1681 Integer display width is deprecated and will be removed in a future release.
365 Warning 1681 Integer display width is deprecated and will be removed in a future release.
366 Warning 1681 Integer display width is deprecated and will be removed in a future release.
367 Warning 1681 Integer display width is deprecated and will be removed in a future release.
368 Warning 1681 Integer display width is deprecated and will be removed in a future release.
369 Warning 1681 Integer display width is deprecated and will be removed in a future release.
370 Warning 1681 Integer display width is deprecated and will be removed in a future release.
371 Warning 1681 Integer display width is deprecated and will be removed in a future release.
372 Warning 1681 Integer display width is deprecated and will be removed in a future release.
373 Warning 1681 Integer display width is deprecated and will be removed in a future release.
374 Warning 1681 Integer display width is deprecated and will be removed in a future release.
375 Warning 1681 Integer display width is deprecated and will be removed in a future release.
376 Warning 1681 Integer display width is deprecated and will be removed in a future release.
377 Warning 1681 Integer display width is deprecated and will be removed in a future release.
378 Warning 1681 Integer display width is deprecated and will be removed in a future release.
379 Warning 1681 Integer display width is deprecated and will be removed in a future release.
380 Warning 1681 Integer display width is deprecated and will be removed in a future release.
381 Warning 1681 Integer display width is deprecated and will be removed in a future release.
382 Warning 1681 Integer display width is deprecated and will be removed in a future release.
383 Warning 1681 Integer display width is deprecated and will be removed in a future release.
384 Warning 1681 Integer display width is deprecated and will be removed in a future release.
385 Warning 1681 Integer display width is deprecated and will be removed in a future release.
386 Warning 1681 Integer display width is deprecated and will be removed in a future release.
387 Warning 1681 Integer display width is deprecated and will be removed in a future release.
388 Warning 1681 Integer display width is deprecated and will be removed in a future release.
389 Warning 1681 Integer display width is deprecated and will be removed in a future release.
390 Warning 1681 Integer display width is deprecated and will be removed in a future release.
391 Warning 1681 Integer display width is deprecated and will be removed in a future release.
392 Warning 1681 Integer display width is deprecated and will be removed in a future release.
393 Warning 1681 Integer display width is deprecated and will be removed in a future release.
394 create index tx2
395 on t1 (c010, c011, c012, c013);
396 drop table t1;
397 create table t1 (a int primary key auto_increment, b int) engine=ndb;
398 insert into t1 (b) values (101),(102),(103);
399 select * from t1 where a = 3;
400 a b
401 3 103
402 alter table t1 rename t2;
403 insert into t2 (b) values (201),(202),(203);
404 select * from t2 where a = 6;
405 a b
406 6 203
407 alter table t2 add c int;
408 Warnings:
409 Warning 1478 Converted FIXED field 'c' to DYNAMIC to enable online ADD COLUMN
410 insert into t2 (b) values (301),(302),(303);
411 select * from t2 where a = 9;
412 a b c
413 9 303 NULL
414 alter table t2 rename t1;
415 insert into t1 (b) values (401),(402),(403);
416 select * from t1 where a = 12;
417 a b c
418 12 403 NULL
419 drop table t1;
420 create table t1(a int not null) engine=ndb;
421 Primary keys:
422 Number of primary keys: 1
423 $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
424 PRIMARY KEY($PK) - UniqueHashIndex
425 insert into t1 values (1),(2),(3);
426 alter table t1 add primary key (a);
427 Primary keys:
428 Number of primary keys: 1
429 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
430 PRIMARY KEY(a) - UniqueHashIndex
431 PRIMARY(a) - OrderedIndex
432 update t1 set a = 17 where a = 1;
433 select * from t1 order by a;
434 a
435 2
436 3
437 17
438 alter table t1 drop primary key;
439 Primary keys:
440 Number of primary keys: 1
441 $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
442 PRIMARY KEY($PK) - UniqueHashIndex
443 update t1 set a = 1 where a = 17;
444 select * from t1 order by a;
445 a
446 1
447 2
448 3
449 drop table t1;
450 create table t1(a int not null) engine=ndb;
451 Primary keys:
452 Number of primary keys: 1
453 $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
454 PRIMARY KEY($PK) - UniqueHashIndex
455 insert into t1 values (1),(2),(3);
456 create unique index pk on t1(a);
457 Primary keys:
458 Number of primary keys: 1
459 a Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY
460 PRIMARY KEY(a) - UniqueHashIndex
461 update t1 set a = 17 where a = 1;
462 select * from t1 order by a;
463 a
464 2
465 3
466 17
467 alter table t1 drop index pk;
468 Primary keys:
469 Number of primary keys: 1
470 $PK Bigunsigned PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY AUTO_INCR
471 PRIMARY KEY($PK) - UniqueHashIndex
472 update t1 set a = 1 where a = 17;
473 select * from t1 order by a;
474 a
475 1
476 2
477 3
478 drop table t1;
479 create table t1 (a int not null primary key, b int not null default 0, c varchar(254)) engine=ndb;
480 show create table t1;
481 Table Create Table
482 t1 CREATE TABLE `t1` (
483 `a` int NOT NULL,
484 `b` int NOT NULL DEFAULT '0',
485 `c` varchar(254) DEFAULT NULL,
486 PRIMARY KEY (`a`)
487 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
488 alter table t1 alter b set default 1;
489 show create table t1;
490 Table Create Table
491 t1 CREATE TABLE `t1` (
492 `a` int NOT NULL,
493 `b` int NOT NULL DEFAULT '1',
494 `c` varchar(254) DEFAULT NULL,
495 PRIMARY KEY (`a`)
496 ) ENGINE=ndbcluster DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
497 drop table t1;
498 create table t1 (a int not null, b int not null) engine=ndb;
499 insert into t1 values (1, 300), (2, 200), (3, 100);
500 select * from t1 order by a;
501 a b
502 1 300
503 2 200
504 3 100
505 alter table t1 order by b;
506 select * from t1 order by b;
507 a b
508 3 100
509 2 200
510 1 300
511 drop table t1;
512 CREATE LOGFILE GROUP lg1
513 ADD UNDOFILE 'undofile.dat'
514 ENGINE = ndb;
515 CREATE TABLESPACE ts1
516 ADD DATAFILE 'datafile.dat'
517 USE LOGFILE GROUP lg1
518 ENGINE = ndb;
519 CREATE TABLE t1
520 (a INT NOT NULL PRIMARY KEY, b VARCHAR(20), c VARCHAR(20))
521 ENGINE = ndb;
522 ALTER TABLE t1 TABLESPACE ts1, MODIFY c CHAR(20) STORAGE DISK;
523 DROP TABLE t1;
524 ALTER TABLESPACE ts1
525 DROP DATAFILE 'datafile.dat';
526 DROP TABLESPACE ts1;
527 DROP LOGFILE GROUP lg1
528 ENGINE = ndb;
529 #test alter table add column with partion by and comment clause
530 CREATE TABLE t1(id INT, PRIMARY KEY(id)) ENGINE=NDB CHARSET=latin1;
531 ALTER TABLE t1 ADD value INT NULL, COMMENT='comment1' PARTITION BY KEY(id);
532 SHOW CREATE TABLE t1;
533 Table Create Table
534 t1 CREATE TABLE `t1` (
535 `id` int NOT NULL,
536 `value` int DEFAULT NULL,
537 PRIMARY KEY (`id`)
538 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1 COMMENT='comment1'
539 /*!50100 PARTITION BY KEY (id) */
540 DROP TABLE t1;
541 #test alter table with and without ENGINE clause
542 CREATE TABLE t1(id INT, PRIMARY KEY(id)) ENGINE=NDB CHARSET=latin1;
543 ALTER TABLE t1 ENGINE=NDB PARTITION BY KEY(id);
544 SHOW CREATE TABLE t1;
545 Table Create Table
546 t1 CREATE TABLE `t1` (
547 `id` int NOT NULL,
548 PRIMARY KEY (`id`)
549 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
550 /*!50100 PARTITION BY KEY (id) */
551 DROP TABLE t1;
552 CREATE TABLE t1(id INT, PRIMARY KEY(id)) ENGINE=NDB CHARSET=latin1;
553 ALTER TABLE t1 PARTITION BY KEY(id);
554 SHOW CREATE TABLE t1;
555 Table Create Table
556 t1 CREATE TABLE `t1` (
557 `id` int NOT NULL,
558 PRIMARY KEY (`id`)
559 ) ENGINE=ndbcluster DEFAULT CHARSET=latin1
560 /*!50100 PARTITION BY KEY (id) */
561 DROP TABLE t1;
562 bug#24577931 table comment is case sensitive
563 create table tbasic(
564 id int not null,
565 name varchar(20), age int
566 ) engine=ndb charset=latin1;
567 SELECT read_backup, fully_replicated from ndbinfo.dictionary_tables
568 WHERE table_name = 'tbasic';
569 read_backup fully_replicated
570 1 0
571 alter table tbasic algorithm=copy, comment="NDB_TABLE=FULLY_REPLICATEd=1";
572 SELECT read_backup, fully_replicated from ndbinfo.dictionary_tables
573 WHERE table_name = 'tbasic';
574 read_backup fully_replicated
575 1 1
576 drop table tbasic;