polardbxengine/mysql-test/suite/ndb/t/ndb_restore_bug17916243.test

37 lines
1.3 KiB
Plaintext

-- source include/have_ndb.inc
# Test is using error insert, check that binaries support it
--source have_ndb_error_insert.inc
-- source suite/ndb/include/backup_restore_setup.inc
--disable_warnings
drop table if exists t1,t2;
--enable_warnings
create table t1 (a1 int primary key, b1 int) engine ndb;
create table t2 (a2 int primary key, b2 text) engine ndb;
insert into t1 values (1,11),(2,22);
insert into t2 values (1,repeat('x',10000)),(2,repeat('y',20000));
select a1,crc32(b2) from t1,t2 where a1=a2 order by a1;
--echo # run backup
--source include/ndb_backup.inc
drop table t1,t2;
--echo # error insert 6215
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 6215" >> $NDB_TOOLS_OUTPUT
--echo # run restore
--exec $NDB_RESTORE -b $the_backup_id -n 1 -m $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_RESTORE -b $the_backup_id -n 1 -r $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
--exec $NDB_RESTORE -b $the_backup_id -n 2 -r $NDB_BACKUPS-$the_backup_id >> $NDB_TOOLS_OUTPUT
--echo # error insert clear
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "all error 0" >> $NDB_TOOLS_OUTPUT
select a1,crc32(b2) from t1,t2 where a1=a2 order by a1;
drop table t1,t2;
--source suite/ndb/include/backup_restore_cleanup.inc
--remove_file $NDB_TOOLS_OUTPUT