1 -- source include/have_ndb.inc
2 -- source include/ndb_default_cluster.inc
3 -- source include/not_embedded.inc
7 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9,t10;
13 ,a1 BIT(1), a2 BIT(5), a3 BIT(33), a4 BIT(63), a5 BIT(64)
14 ,b1 TINYINT, b2 TINYINT UNSIGNED
15 ,c1 SMALLINT, c2 SMALLINT UNSIGNED
16 ,d1 INT, d2 INT UNSIGNED
17 ,e1 BIGINT, e2 BIGINT UNSIGNED
18 ,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY
19 ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY
20 ,h1 BINARY(1), h2 BINARY(8), h3 BINARY(255)
21 ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
27 ,0x1, 0x17, 0x789a, 0x789abcde, 0xfedc0001
30 ,2147483647, 4294967295
31 ,9223372036854775807, 18446744073709551615
32 ,'1','12345678901234567890123456789012','123456789'
33 ,'1','12345678901234567890123456789012','123456789'
34 ,0x12,0x123456789abcdef0, 0x012345
35 ,0x12,0x123456789abcdef0, 0x00123450
45 ,-9223372036854775808, 0
55 ,NULL,NULL,NULL,NULL,NULL
68 ,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
75 ,hex(h1), hex(h2), hex(h3)
76 ,hex(i1), hex(i2), hex(i3)
79 alter table t1 engine ndb;
82 ,hex(a1), hex(a2), hex(a3), hex(a4), hex(a5)
89 ,hex(h1), hex(h2), hex(h3)
90 ,hex(i1), hex(i2), hex(i3)
94 --source include/ndb_backup.inc
96 --let ndb_restore_filter=test t1
97 --let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by=";"
98 --source include/ndb_backup_print.inc
100 --let ndb_restore_filter=test t1
101 --let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by="," --fields-optionally-enclosed-by="'"
102 --source include/ndb_backup_print.inc
107 # some binary char tests with trailing spaces
110 ,f1 CHAR(1) BINARY, f2 CHAR(32) BINARY, f3 CHAR(255) BINARY
111 ,g1 VARCHAR(32) BINARY, g2 VARCHAR(255) BINARY, g3 VARCHAR(1000) BINARY
112 ,h1 BINARY(1), h2 BINARY(9), h3 BINARY(255)
113 ,i1 VARBINARY(32), i2 VARBINARY(255), i3 VARBINARY(1000)
116 insert into t1 values
118 ,'1','12345678901234567890123456789012','123456789 '
119 ,'1 ','12345678901234567890123456789012 ','123456789 '
120 ,0x20,0x123456789abcdef020, 0x012345000020
121 ,0x1200000020,0x123456789abcdef000000020, 0x00123450000020
124 create table t2 (pk int key, a int) engine ndb;
125 create table t3 (pk int key, a int) engine ndb;
126 create table t4 (pk int key, a int) engine ndb;
128 insert into t2 values (1,11),(2,12),(3,13),(4,14),(5,15);
129 insert into t3 values (1,21),(2,22),(3,23),(4,24),(5,25);
130 insert into t4 values (1,31),(2,32),(3,33),(4,34),(5,35);
132 --source include/ndb_backup.inc
133 --let ndb_restore_opts=--verbose=0 --print_data --hex --fields-enclosed-by="'" --fields-optionally-enclosed-by="X"
134 --let ndb_restore_filter=test t1
135 --source include/ndb_backup_print.inc
138 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
140 --remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
142 --remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
144 --remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
146 --let ndb_restore_opts=--verbose=0 --print_data --hex --tab $MYSQLTEST_VARDIR/tmp --append
147 --let ndb_restore_filter=test
148 --source include/ndb_backup_print.inc
151 --source include/show_msg.inc
152 --exec sort $MYSQLTEST_VARDIR/tmp/t1.txt
154 --source include/show_msg.inc
155 --exec sort $MYSQLTEST_VARDIR/tmp/t2.txt
157 --source include/show_msg.inc
158 --exec sort $MYSQLTEST_VARDIR/tmp/t3.txt
160 --source include/show_msg.inc
161 --exec sort $MYSQLTEST_VARDIR/tmp/t4.txt
163 --remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
164 --remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
165 --remove_file $MYSQLTEST_VARDIR/tmp/t3.txt
166 --remove_file $MYSQLTEST_VARDIR/tmp/t4.txt
168 # now test some other datatypes
172 ,a1 MEDIUMINT, a2 MEDIUMINT UNSIGNED
176 insert into t1 values(1, 8388607, 16777215);
178 insert into t1 values(2, -8388608, 0);
180 insert into t1 values(3, -1, 1);
183 --source include/ndb_backup.inc
185 --let ndb_restore_filter=test t1
186 --let ndb_restore_opts=--verbose=0 --print_data --hex --fields-terminated-by=";"
187 --source include/ndb_backup_print.inc