summaryrefslogtreecommitdiff
path: root/mysql-test/include/ndb_backup.inc
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/include/ndb_backup.inc')
-rw-r--r--mysql-test/include/ndb_backup.inc22
1 files changed, 10 insertions, 12 deletions
diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc
index f0a883d4e11..e6780788fe9 100644
--- a/mysql-test/include/ndb_backup.inc
+++ b/mysql-test/include/ndb_backup.inc
@@ -2,23 +2,21 @@
# By JBM 2006-02-16 So that the code is not repeated #
# in test cases and can be reused. #
######################################################
---exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
+--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
# there is no neat way to find the backupid, this is a hack to find it...
+let $dump_file= $MYSQLTEST_VARDIR/tmp/tmp.dat;
+--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $dump_file
---exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
+CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
-CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
+--replace_result $dump_file DUMP_FILE
+eval LOAD DATA INFILE '$dump_file' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-DELETE FROM test.backup_info;
-
-LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
-
---replace_column 1 <the_backup_id>
-
-SELECT @the_backup_id:=backup_id FROM test.backup_info;
+# Load backup id into environment variable
+let the_backup_id=`SELECT backup_id from test.backup_info`;
+DROP TABLE test.backup_info;
-let the_backup_id=`select @the_backup_id`;
+remove_file $dump_file;
-DROP TABLE test.backup_info;