Debian Codegraph @

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

raw
1 --source include/have_ndb.inc
2
3 --echo --echo ndb_import tests with missing-ai-column option
4
5 SET @session_ai_prefetch_sz = @@session.ndb_autoincrement_prefetch_sz;
6 set session ndb_autoincrement_prefetch_sz=16;
7
8 --write_file $MYSQLTEST_VARDIR/tmp/t1.csv
9 1288::10000
10 2288::20000
11 3288::30000
12 4288::40000
13 5288::50000
14 6288::60000
15 7288::70000
16 8288::80000
17 9288::90000
18 10288::100000
19 EOF
20
21 --echo Test the auto inc column type with tinyint
22 --let col_type = tinyint
23 --source suite/ndb/t/ndb_import_util.inc
24
25 --echo Test the auto inc column type with tinyint unsigned
26 --let col_type = tinyint unsigned
27 --source suite/ndb/t/ndb_import_util.inc
28
29 --echo Test the auto inc column type with smallint
30 --let col_type = smallint
31 --source suite/ndb/t/ndb_import_util.inc
32
33 --echo Test the auto inc column type with smallint unsigned
34 --let col_type = smallint unsigned
35 --source suite/ndb/t/ndb_import_util.inc
36
37 set session ndb_autoincrement_prefetch_sz=@session_ai_prefetch_sz;
38
39 --echo Test the auto inc column type with mediumint
40 --let col_type = mediumint
41 --source suite/ndb/t/ndb_import_util.inc
42
43 --echo Test the auto inc column type with mediumint unsigned
44 --let col_type = mediumint unsigned
45 --source suite/ndb/t/ndb_import_util.inc
46
47 --echo Test the auto inc column type with int
48 --let col_type = int
49 --source suite/ndb/t/ndb_import_util.inc
50
51 --echo Test the auto inc column type with int unsigned
52 --let col_type = int unsigned
53 --source suite/ndb/t/ndb_import_util.inc
54
55 --echo Test the auto inc column type with bigint
56 --let col_type = bigint
57 --source suite/ndb/t/ndb_import_util.inc
58
59 --echo Test the auto inc column type with bigint unsigned
60 --let col_type = bigint unsigned
61 --source suite/ndb/t/ndb_import_util.inc
62
63 --echo Test that missing-ai-column option requires an explicit auto increment column
64 create table t1 (a int not null primary key, b int, c bigint) engine ndb;
65
66 --error 1
67 exec $NDB_IMPORT --state-dir=$MYSQLTEST_VARDIR/tmp
68 --keep-state --log-level=1 --missing-ai-column
69 --fields-terminated-by="::" --csvopt=n
70 test
71 $MYSQLTEST_VARDIR/tmp/t1.csv >> $NDB_TOOLS_OUTPUT 2>&1;
72
73 drop table t1;
74
75 --echo Test that missing-ai-column option works with multiple tables
76
77 --write_file $MYSQLTEST_VARDIR/tmp/t2.csv
78 1288::10000
79 2288::20000
80 EOF
81
82 create table t1 (a int not null auto_increment primary key, b int, c bigint) engine ndb;
83 create table t2 (a int not null auto_increment primary key, b int, c bigint) engine ndb;
84
85 exec $NDB_IMPORT --state-dir=$MYSQLTEST_VARDIR/tmp
86 --keep-state --log-level=1 --missing-ai-column
87 --fields-terminated-by="::" --csvopt=n
88 test
89 $MYSQLTEST_VARDIR/tmp/t1.csv $MYSQLTEST_VARDIR/tmp/t2.csv >> $NDB_TOOLS_OUTPUT 2>&1;
90
91 select count(*) from t1;
92 select count(*) from t2;
93
94 drop table t1;
95 drop table t2;
96
97 --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.csv
98 --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.map
99 --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.rej
100 --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.res
101 --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.sto
102 --remove_files_wildcard $MYSQLTEST_VARDIR/tmp t*.stt
103 --remove_file $NDB_TOOLS_OUTPUT