Current Path : /home/usr.opt/mysql57/mysql-test/suite/ndb/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/suite/ndb/r/ndb_restore_schema_rewrites.result |
************************************************************ * Creating multiple databases with identical tables * (have blobs and indexes to cover the hidden tables) ************************************************************ CREATE DATABASE db0; CREATE DATABASE db1; CREATE DATABASE db2; USE db0; CREATE TABLE t0 ( id INT PRIMARY KEY, cint INT, cvarchar VARCHAR(5), cblob BLOB(1000004), UNIQUE INDEX UNIQUE_t0_0 USING BTREE (cint ASC), UNIQUE INDEX UNIQUE_t0_2 USING BTREE (cvarchar ASC) ) ENGINE=NDB; USE db1; CREATE TABLE t0 ( id INT PRIMARY KEY, cint INT, cvarchar VARCHAR(5), cblob BLOB(1000004), UNIQUE INDEX UNIQUE_t0_0 USING BTREE (cint ASC), UNIQUE INDEX UNIQUE_t0_2 USING BTREE (cvarchar ASC) ) ENGINE=NDB; USE db2; CREATE TABLE t0 ( id INT PRIMARY KEY, cint INT, cvarchar VARCHAR(5), cblob BLOB(1000004), UNIQUE INDEX UNIQUE_t0_0 USING BTREE (cint ASC), UNIQUE INDEX UNIQUE_t0_2 USING BTREE (cvarchar ASC) ) ENGINE=NDB; ************************************************************ * Inserting data * (create disjunct sets of rows to merge without conflicts; * at this time, ndb_restore does not offer any detection * of data conflicts between databases in the backup or in * memory; databases are restored in an unspecified order) * (make blob data long enough to be held in extra table) ************************************************************ USE db0; INSERT INTO t0 VALUES (0, 0, '00000', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); INSERT INTO t0 VALUES (1, 1, '11111', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); INSERT INTO t0 VALUES (2, 2, '22222', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); USE db1; INSERT INTO t0 VALUES (3, 3, '33333', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); INSERT INTO t0 VALUES (4, 4, '44444', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); INSERT INTO t0 VALUES (5, 5, '55555', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); USE db2; INSERT INTO t0 VALUES (6, 6, '66666', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); INSERT INTO t0 VALUES (7, 7, '77777', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); INSERT INTO t0 VALUES (8, 8, '88888', '123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890'); ************************************************************ * Creating in-memory copies of the NDB tables ************************************************************ CREATE TABLE db0.t0_data ENGINE=MYISAM AS SELECT * FROM db0.t0; CREATE TABLE db1.t0_data ENGINE=MYISAM AS SELECT * FROM db1.t0; CREATE TABLE db2.t0_data ENGINE=MYISAM AS SELECT * FROM db2.t0; ************************************************************ * Backing up databases ************************************************************ ************************************************************ * Restoring databases with no rewrite (sanity check) ************************************************************ CREATE TABLE db0.t0_temp ENGINE=MYISAM AS SELECT * FROM db0.t0_data; CREATE TABLE db1.t0_temp ENGINE=MYISAM AS SELECT * FROM db1.t0_data; CREATE TABLE db2.t0_temp ENGINE=MYISAM AS SELECT * FROM db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0; COUNT(*) 3 SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 3 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Negative testing: check wrong usage of command-line option * (expected exit code for usage errors: NDBT_WRONGARGS = 2) ************************************************************ ************************************************************ * Restoring databases with redundant/self-rewrite options ************************************************************ CREATE TABLE db0.t0_temp ENGINE=MYISAM AS SELECT * FROM db0.t0_data; CREATE TABLE db1.t0_temp ENGINE=MYISAM AS SELECT * FROM db1.t0_data; CREATE TABLE db2.t0_temp ENGINE=MYISAM AS SELECT * FROM db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0; COUNT(*) 3 SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 3 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Restoring databases with overriding rewrite options ************************************************************ CREATE TABLE db0.t0_temp ENGINE=MYISAM AS SELECT * FROM db0.t0_data; CREATE TABLE db1.t0_temp ENGINE=MYISAM AS SELECT * FROM db1.t0_data; CREATE TABLE db2.t0_temp ENGINE=MYISAM AS SELECT * FROM db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0; COUNT(*) 3 SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 3 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Restoring databases with a single rewrite ************************************************************ CREATE TABLE db0.t0_temp LIKE db0.t0_data; CREATE TABLE db1.t0_temp LIKE db1.t0_data; CREATE TABLE db2.t0_temp LIKE db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 0 SELECT COUNT(*) FROM db1.t0; COUNT(*) 6 SELECT COUNT(*) FROM db2.t0; COUNT(*) 3 INSERT db1.t0_temp SELECT * FROM db0.t0_data; INSERT db1.t0_temp SELECT * FROM db1.t0_data; INSERT db2.t0_temp SELECT * FROM db2.t0_data; SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 0 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 6 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 3 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Restoring databases with multiple rewrites ************************************************************ CREATE TABLE db0.t0_temp LIKE db0.t0_data; CREATE TABLE db1.t0_temp LIKE db1.t0_data; CREATE TABLE db2.t0_temp LIKE db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 0 SELECT COUNT(*) FROM db1.t0; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0; COUNT(*) 6 INSERT db1.t0_temp SELECT * FROM db0.t0_data; INSERT db2.t0_temp SELECT * FROM db1.t0_data; INSERT db2.t0_temp SELECT * FROM db2.t0_data; SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 0 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 6 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Restoring databases with multiple rewrites into same target ************************************************************ CREATE TABLE db0.t0_temp LIKE db0.t0_data; CREATE TABLE db1.t0_temp LIKE db1.t0_data; CREATE TABLE db2.t0_temp LIKE db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 0 SELECT COUNT(*) FROM db1.t0; COUNT(*) 0 SELECT COUNT(*) FROM db2.t0; COUNT(*) 9 INSERT db2.t0_temp SELECT * FROM db0.t0_data; INSERT db2.t0_temp SELECT * FROM db1.t0_data; INSERT db2.t0_temp SELECT * FROM db2.t0_data; SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 0 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 0 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 9 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Restoring databases with swapping rewrites ************************************************************ CREATE TABLE db0.t0_temp LIKE db0.t0_data; CREATE TABLE db1.t0_temp LIKE db1.t0_data; CREATE TABLE db2.t0_temp LIKE db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0; COUNT(*) 3 INSERT db1.t0_temp SELECT * FROM db0.t0_data; INSERT db0.t0_temp SELECT * FROM db1.t0_data; INSERT db2.t0_temp SELECT * FROM db2.t0_data; SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 3 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Restoring databases with permutating rewrites ************************************************************ CREATE TABLE db0.t0_temp LIKE db0.t0_data; CREATE TABLE db1.t0_temp LIKE db1.t0_data; CREATE TABLE db2.t0_temp LIKE db2.t0_data; DELETE FROM db0.t0; DELETE FROM db1.t0; DELETE FROM db2.t0; SELECT COUNT(*) FROM db0.t0; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0; COUNT(*) 3 INSERT db1.t0_temp SELECT * FROM db0.t0_data; INSERT db2.t0_temp SELECT * FROM db1.t0_data; INSERT db0.t0_temp SELECT * FROM db2.t0_data; SELECT COUNT(*) FROM db0.t0 NATURAL JOIN db0.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db1.t0 NATURAL JOIN db1.t0_temp; COUNT(*) 3 SELECT COUNT(*) FROM db2.t0 NATURAL JOIN db2.t0_temp; COUNT(*) 3 DROP TABLE db0.t0_temp; DROP TABLE db1.t0_temp; DROP TABLE db2.t0_temp; ************************************************************ * Deleting tables and databases ************************************************************ DROP DATABASE db0; DROP DATABASE db1; DROP DATABASE db2;