From 9a2f243dce9bd6ab09dbe5da67309cb1c320d2c3 Mon Sep 17 00:00:00 2001 From: "jonas@perch.ndb.mysql.com" <> Date: Fri, 10 Mar 2006 21:43:50 +0100 Subject: [PATCH] ndb - Remove test dependancy of table order in backup --- mysql-test/r/ndb_restore.result | 11 +++++++++-- mysql-test/t/ndb_restore.test | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/ndb_restore.result b/mysql-test/r/ndb_restore.result index 01ab286aad8..7dc4057e615 100644 --- a/mysql-test/r/ndb_restore.result +++ b/mysql-test/r/ndb_restore.result @@ -455,8 +455,15 @@ from (select * from t9 union select * from t9_c) a; count(*) 3 -drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP; +DELETE FROM test.backup_info; +LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ','; +SELECT @the_backup_id:=backup_id FROM test.backup_info; +@the_backup_id:=backup_id + +DROP TABLE test.backup_info; Create table test/def/t2_c failed: Translate frm error drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +drop table if exists t2_c; 520093696, diff --git a/mysql-test/t/ndb_restore.test b/mysql-test/t/ndb_restore.test index dc28a9f5408..f11324492c2 100644 --- a/mysql-test/t/ndb_restore.test +++ b/mysql-test/t/ndb_restore.test @@ -347,7 +347,14 @@ select count(*) from (select * from t9 union select * from t9_c) a; -drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +# +# Drop all table except t2_c +# This to make sure that error returned from ndb_restore above is +# guaranteed to be from t2_c, this since order of tables in backup +# is none deterministic +# +drop table t1_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +--source include/ndb_backup.inc --exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --core=0 -b $the_backup_id -n 1 -m -r --ndb-nodegroup_map '(0,1)' $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id 2>&1 | grep Translate || true # @@ -356,7 +363,7 @@ drop table t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; -drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c; +drop table if exists t2_c; --enable_warnings #