diff options
author | unknown <jmiller@mysql.com> | 2006-02-16 14:24:47 +0100 |
---|---|---|
committer | unknown <jmiller@mysql.com> | 2006-02-16 14:24:47 +0100 |
commit | b4e7b365b5ebb95c20b2f737a86a4605d711e1cb (patch) | |
tree | ee50875dcb6188433642eda9903cd44fb1adc67a /mysql-test/include | |
parent | be4a1c2e94bbc8927033ea0219bc102c2fa46908 (diff) | |
download | mariadb-git-b4e7b365b5ebb95c20b2f737a86a4605d711e1cb.tar.gz |
Updates from review
mysql-test/include/ndb_backup.inc:
We are writting test cases that use the ndb backup. This new include contains all the code needed to start the backup and grab the backup ID for the test. By moving the code here it will be easy to reuse
mysql-test/include/ndb_restore_master.inc:
We are writting test cases that use the ndb backup and restore. This new include contains all the code needed to restore a master cluster from the backup done with ndb_backup.inc. By moving the code here it will be easy to reuse
mysql-test/t/ndb_dd_backuprestore.test:
Updated with suggestions from Jonas
Diffstat (limited to 'mysql-test/include')
-rw-r--r-- | mysql-test/include/ndb_backup.inc | 23 | ||||
-rw-r--r-- | mysql-test/include/ndb_restore_master.inc | 12 |
2 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/include/ndb_backup.inc b/mysql-test/include/ndb_backup.inc new file mode 100644 index 00000000000..f1ff79e3c32 --- /dev/null +++ b/mysql-test/include/ndb_backup.inc @@ -0,0 +1,23 @@ +###################################################### +# 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 "star +t backup" >> $NDB_TOOLS_OUTPUT + +# there is no neat way to find the backupid, this is a hack to find it... + +--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" - +d sys --delimiter=',' SYSTAB_0 | grep 520093696 > var/tmp.dat + +CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = +HEAP; +DELETE FROM test.backup_info; + +LOAD DATA INFILE '../../var/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; +let the_backup_id=`select @the_backup_id`; +DROP TABLE test.backup_info; + diff --git a/mysql-test/include/ndb_restore_master.inc b/mysql-test/include/ndb_restore_master.inc new file mode 100644 index 00000000000..dc7765e99d7 --- /dev/null +++ b/mysql-test/include/ndb_restore_master.inc @@ -0,0 +1,12 @@ +###################################################### +# By JBM 2006-02-16 So that the code is not repeated # +# in test cases and can be reused. # +###################################################### + +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUS +TER_PORT" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP +/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT + +--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUS +TER_PORT" -p 8 -b $the_backup_id -n 2 -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/B +ACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT |