| 1 |
DROP TABLE IF EXISTS t1,t2; |
| 2 |
drop database if exists mysqltest; |
| 3 |
CREATE TABLE t1 ( |
| 4 |
pk1 INT NOT NULL PRIMARY KEY, |
| 5 |
attr1 INT NOT NULL, |
| 6 |
attr2 INT, |
| 7 |
attr3 VARCHAR(10), |
| 8 |
INDEX i1(attr1) |
| 9 |
) ENGINE=ndbcluster; |
| 10 |
INSERT INTO t1 VALUES (0,0,0,"zero"),(1,1,1,"one"),(2,2,2,"two"); |
| 11 |
SELECT * FROM t1 WHERE attr1 = 1; |
| 12 |
pk1 attr1 attr2 attr3 |
| 13 |
1 1 1 one |
| 14 |
alter table t1 rename t2; |
| 15 |
SELECT * FROM t2 WHERE attr1 = 1; |
| 16 |
pk1 attr1 attr2 attr3 |
| 17 |
1 1 1 one |
| 18 |
alter table t2 rename t1, add attr4 int; |
| 19 |
ERROR 42000: This version of MySQL doesn't yet support 'alter table t2 rename t1, add attr4 int' |
| 20 |
create database ndbtest; |
| 21 |
alter table t2 rename ndbtest.t2; |
| 22 |
SELECT * FROM ndbtest.t2 WHERE attr1 = 1; |
| 23 |
pk1 attr1 attr2 attr3 |
| 24 |
1 1 1 one |
| 25 |
drop table ndbtest.t2; |
| 26 |
create table t1 ( |
| 27 |
pk1 INT NOT NULL PRIMARY KEY, |
| 28 |
b blob |
| 29 |
) engine = ndbcluster; |
| 30 |
alter table t1 rename ndbtest.t1; |
| 31 |
alter table ndbtest.t1 rename test.t1; |
| 32 |
drop table test.t1; |
| 33 |
drop database ndbtest; |