Debian Codegraph @

mysql-test/suite/ndb/t/ndb_import_resume.test

raw
1 --source include/have_ndb.inc
2
3
4 #
5 # Bug#31107858
6 # Test ndb_import --resume
7
8 CREATE TABLE mt
9 (i int not null primary key, j mediumint unsigned) engine=ndb;
10
11 --write_file $MYSQL_TMP_DIR/mt.data
12 1,1
13 2,2
14 3,-1
15 4,-1
16 5,-1
17 6,-1
18 7,-1
19 8,-1
20 9,-1
21 10,-1
22 11,-1
23 12,3
24 13,4
25 14,5
26 15,6
27 EOF
28
29 # This data file contains 9 bad rows and 6 good rows.
30 # The first run with --rejects=5 should insert a few rows and then fail.
31 # The --resume option allows a user to resume a failed load.
32 # The second run with --resume and --rejects=5 should succeed.
33 # At the end, the table should contain 6 rows of data.
34
35 --error 1
36 exec $NDB_IMPORT --state-dir=$MYSQL_TMP_DIR --rejects=5 --csvopt=cn
37 test $MYSQL_TMP_DIR/mt.data;
38
39 exec $NDB_IMPORT --state-dir=$MYSQL_TMP_DIR --rejects=5 --csvopt=cn
40 --resume test $MYSQL_TMP_DIR/mt.data;
41
42 --let $n= `SELECT count(*) FROM mt`
43 --assert($n == 6)
44
45 DROP TABLE mt;
46
47 --remove_file $MYSQL_TMP_DIR/mt.data
48 --remove_file $MYSQL_TMP_DIR/mt.rej
49
50
51