mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 20:42:30 +01:00
24 lines
601 B
Text
24 lines
601 B
Text
DROP TABLE IF EXISTS t1,t2;
|
|
drop database if exists mysqltest;
|
|
CREATE TABLE t1 (
|
|
pk1 INT NOT NULL PRIMARY KEY,
|
|
attr1 INT NOT NULL,
|
|
attr2 INT,
|
|
attr3 VARCHAR(10),
|
|
INDEX i1(attr1)
|
|
) ENGINE=ndbcluster;
|
|
INSERT INTO t1 VALUES (0,0,0,"zero"),(1,1,1,"one"),(2,2,2,"two");
|
|
SELECT * FROM t1 WHERE attr1 = 1;
|
|
pk1 attr1 attr2 attr3
|
|
1 1 1 one
|
|
alter table t1 rename t2;
|
|
SELECT * FROM t2 WHERE attr1 = 1;
|
|
pk1 attr1 attr2 attr3
|
|
1 1 1 one
|
|
create database ndbtest;
|
|
alter table t2 rename ndbtest.t2;
|
|
SELECT * FROM ndbtest.t2 WHERE attr1 = 1;
|
|
pk1 attr1 attr2 attr3
|
|
1 1 1 one
|
|
drop table ndbtest.t2;
|
|
drop database ndbtest;
|