--source include/have_ndb.inc --source have_ndb_error_insert.inc --echo # large ndb_import tests --echo # node failure test perl; use strict; use Symbol; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "need MYSQLTEST_VARDIR"; my $file = "$vardir/tmp/t1.csv"; my $fh = gensym(); open($fh, ">:raw", $file) or die "$file: open for write failed: $!"; for (my $i = 0; $i < 400000; $i++) { print $fh $i, "\t", int(rand(1000)), "\n"; } close($fh) or "$file: close after write failed: $!"; exit(0); EOF perl; use strict; use Symbol; my $vardir = $ENV{MYSQLTEST_VARDIR} or die "need MYSQLTEST_VARDIR"; my $file = "$vardir/tmp/t2.csv"; my $fh = gensym(); open($fh, ">:raw", $file) or die "$file: open for write failed: $!"; for (my $i = 0; $i < 400000; $i++) { print $fh 10*$i, "\n"; } close($fh) or "$file: close after write failed: $!"; exit(0); EOF create table t1 ( a int not null, b int not null, primary key using hash (a) ) engine ndb; create table t1ver like t1; create table t2 ( b int not null, # unique key would turn into pk key (b) ) engine ndb; create table t2ver like t2; --echo # load t1ver, t2ver # load first to avoid testing LOAD DATA node failure --disable_query_log eval load data infile '$MYSQLTEST_VARDIR/tmp/t1.csv' into table t1ver lines terminated by '\n'; --enable_query_log --disable_query_log eval load data infile '$MYSQLTEST_VARDIR/tmp/t2.csv' into table t2ver lines terminated by '\n'; --enable_query_log # crash node 2 in 5-15 seconds, may hit t1 or t2 exec $NDB_MGM -e "2 dump 9999 5000 15000" >> $NDB_TOOLS_OUTPUT 2>&1; --echo # import t1, t2 exec $NDB_IMPORT --state-dir=$MYSQLTEST_VARDIR/tmp --keep-state --log-level=1 --temperrors=1000 --csvopt=n test $MYSQLTEST_VARDIR/tmp/t1.csv $MYSQLTEST_VARDIR/tmp/t2.csv >> $NDB_TOOLS_OUTPUT 2>&1; # Before moving to the next stage we need to ensure that the restart has # started and that we wait for it to complete. Otherwise we can get # random errors in all parts of this test including tests after this one. --source ndb_wait_started.inc --source include/ndb_not_readonly.inc --echo # verify t1, t2 select count(*) from t1; select count(*) from t1ver; select count(*) from t1 x, t1ver y where x.a = y.a and x.b = y.b; select count(*) from t2; select count(*) from t2ver; select count(*) from t2 x, t2ver y where x.b = y.b; drop table t1, t1ver, t2, t2ver; --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.csv --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.map --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.rej --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.res --remove_file $NDB_TOOLS_OUTPUT