| 1 |
# test a - all data types, csv default format |
| 2 |
create table t1a ( |
| 3 |
a bigint unsigned not null , |
| 4 |
b bigint , |
| 5 |
c int unsigned , |
| 6 |
d int , |
| 7 |
e mediumint unsigned , |
| 8 |
f mediumint , |
| 9 |
g smallint unsigned , |
| 10 |
h smallint , |
| 11 |
i tinyint unsigned , |
| 12 |
j tinyint , |
| 13 |
k double , |
| 14 |
l float , |
| 15 |
primary key (a) |
| 16 |
) engine ndb; |
| 17 |
create table t2a ( |
| 18 |
a char (10) not null , |
| 19 |
b char (255) , |
| 20 |
c varchar (10) , |
| 21 |
d varchar (1000) , |
| 22 |
primary key (a) |
| 23 |
) engine ndb; |
| 24 |
create table t3a ( |
| 25 |
a binary (10) not null , |
| 26 |
b binary (255) , |
| 27 |
c varbinary (10) , |
| 28 |
d varbinary (1000) , |
| 29 |
primary key (a) |
| 30 |
) engine ndb; |
| 31 |
create table t4a ( |
| 32 |
a decimal (10, 0) , |
| 33 |
b decimal (20, 0) , |
| 34 |
c decimal (10, 5) , |
| 35 |
d decimal (20, 5) , |
| 36 |
e decimal (10, 10) , |
| 37 |
f decimal (20, 10) , |
| 38 |
g int not null , |
| 39 |
primary key (g) |
| 40 |
) engine ndb; |
| 41 |
create table t5a ( |
| 42 |
a bit (1) , |
| 43 |
b bit (8) , |
| 44 |
c bit (16) , |
| 45 |
d bit (32) , |
| 46 |
e bit (64) , |
| 47 |
f int not null , |
| 48 |
primary key (f) |
| 49 |
) engine ndb; |
| 50 |
create table t6a ( |
| 51 |
a year , |
| 52 |
b date , |
| 53 |
c time (6) , |
| 54 |
d datetime (3) , |
| 55 |
e timestamp (6) not null , |
| 56 |
f int not null , |
| 57 |
primary key (f) |
| 58 |
) engine ndb; |
| 59 |
create table t7a ( |
| 60 |
a text (10) , |
| 61 |
b text (255) , |
| 62 |
c text (65536) , |
| 63 |
d int not null , |
| 64 |
e blob (10) , |
| 65 |
f blob (256) , |
| 66 |
g blob (65535) , |
| 67 |
primary key (d) |
| 68 |
) engine ndb; |
| 69 |
select count(*) from t1a; |
| 70 |
count(*) |
| 71 |
1000 |
| 72 |
select count(*) from t2a; |
| 73 |
count(*) |
| 74 |
1000 |
| 75 |
select count(*) from t3a; |
| 76 |
count(*) |
| 77 |
1000 |
| 78 |
select count(*) from t4a; |
| 79 |
count(*) |
| 80 |
1000 |
| 81 |
select count(*) from t5a; |
| 82 |
count(*) |
| 83 |
1000 |
| 84 |
select count(*) from t6a; |
| 85 |
count(*) |
| 86 |
1000 |
| 87 |
select count(*) from t7a; |
| 88 |
count(*) |
| 89 |
20 |
| 90 |
create table t1aver ( |
| 91 |
a bigint unsigned not null , |
| 92 |
b bigint , |
| 93 |
c int unsigned , |
| 94 |
d int , |
| 95 |
e mediumint unsigned , |
| 96 |
f mediumint , |
| 97 |
g smallint unsigned , |
| 98 |
h smallint , |
| 99 |
i tinyint unsigned , |
| 100 |
j tinyint , |
| 101 |
k double , |
| 102 |
l float , |
| 103 |
primary key (a) |
| 104 |
) engine ndb; |
| 105 |
create table t2aver ( |
| 106 |
a char (10) not null , |
| 107 |
b char (255) , |
| 108 |
c varchar (10) , |
| 109 |
d varchar (1000) , |
| 110 |
primary key (a) |
| 111 |
) engine ndb; |
| 112 |
create table t3aver ( |
| 113 |
a binary (10) not null , |
| 114 |
b binary (255) , |
| 115 |
c varbinary (10) , |
| 116 |
d varbinary (1000) , |
| 117 |
primary key (a) |
| 118 |
) engine ndb; |
| 119 |
create table t4aver ( |
| 120 |
a decimal (10, 0) , |
| 121 |
b decimal (20, 0) , |
| 122 |
c decimal (10, 5) , |
| 123 |
d decimal (20, 5) , |
| 124 |
e decimal (10, 10) , |
| 125 |
f decimal (20, 10) , |
| 126 |
g int not null , |
| 127 |
primary key (g) |
| 128 |
) engine ndb; |
| 129 |
create table t5aver ( |
| 130 |
a bit (1) , |
| 131 |
b bit (8) , |
| 132 |
c bit (16) , |
| 133 |
d bit (32) , |
| 134 |
e bit (64) , |
| 135 |
f int not null , |
| 136 |
primary key (f) |
| 137 |
) engine ndb; |
| 138 |
create table t6aver ( |
| 139 |
a year , |
| 140 |
b date , |
| 141 |
c time (6) , |
| 142 |
d datetime (3) , |
| 143 |
e timestamp (6) not null , |
| 144 |
f int not null , |
| 145 |
primary key (f) |
| 146 |
) engine ndb; |
| 147 |
create table t7aver ( |
| 148 |
a text (10) , |
| 149 |
b text (255) , |
| 150 |
c text (65536) , |
| 151 |
d int not null , |
| 152 |
e blob (10) , |
| 153 |
f blob (256) , |
| 154 |
g blob (65535) , |
| 155 |
primary key (d) |
| 156 |
) engine ndb; |
| 157 |
select count(*) from t1aver; |
| 158 |
count(*) |
| 159 |
1000 |
| 160 |
select count(*) from t2aver; |
| 161 |
count(*) |
| 162 |
1000 |
| 163 |
select count(*) from t3aver; |
| 164 |
count(*) |
| 165 |
1000 |
| 166 |
select count(*) from t4aver; |
| 167 |
count(*) |
| 168 |
1000 |
| 169 |
select count(*) from t5aver; |
| 170 |
count(*) |
| 171 |
1000 |
| 172 |
select count(*) from t6aver; |
| 173 |
count(*) |
| 174 |
1000 |
| 175 |
select count(*) from t7aver; |
| 176 |
count(*) |
| 177 |
20 |
| 178 |
select count(*) from t1a x, t1aver y |
| 179 |
where x.a = y.a and |
| 180 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 181 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 182 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 183 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 184 |
(x.f = y.f or (x.f is null and y.f is null)) and |
| 185 |
(x.g = y.g or (x.g is null and y.g is null)) and |
| 186 |
(x.h = y.h or (x.h is null and y.h is null)) and |
| 187 |
(x.i = y.i or (x.i is null and y.i is null)) and |
| 188 |
(x.j = y.j or (x.j is null and y.j is null)) and |
| 189 |
(x.k = y.k or (x.k is null and y.k is null)) and |
| 190 |
(x.l = y.l or (x.l is null and y.l is null)) ; |
| 191 |
count(*) |
| 192 |
1000 |
| 193 |
select count(*) from t2a x, t2aver y |
| 194 |
where x.a = y.a and |
| 195 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 196 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 197 |
(x.d = y.d or (x.d is null and y.d is null)) ; |
| 198 |
count(*) |
| 199 |
1000 |
| 200 |
select count(*) from t3a x, t3aver y |
| 201 |
where x.a = y.a and |
| 202 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 203 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 204 |
(x.d = y.d or (x.d is null and y.d is null)) ; |
| 205 |
count(*) |
| 206 |
1000 |
| 207 |
select count(*) from t4a x, t4aver y |
| 208 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 209 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 210 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 211 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 212 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 213 |
(x.f = y.f or (x.f is null and y.f is null)) and |
| 214 |
x.g = y.g ; |
| 215 |
count(*) |
| 216 |
1000 |
| 217 |
select count(*) from t5a x, t5aver y |
| 218 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 219 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 220 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 221 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 222 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 223 |
x.f = y.f ; |
| 224 |
count(*) |
| 225 |
1000 |
| 226 |
select count(*) from t6a x, t6aver y |
| 227 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 228 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 229 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 230 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 231 |
x.e = y.e and |
| 232 |
x.f = y.f ; |
| 233 |
count(*) |
| 234 |
1000 |
| 235 |
select count(*) from t7a x, t7aver y |
| 236 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 237 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 238 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 239 |
x.d = y.d and |
| 240 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 241 |
(x.f = y.f or (x.f is null and y.f is null)) and |
| 242 |
(x.g = y.g or (x.g is null and y.g is null)) ; |
| 243 |
count(*) |
| 244 |
20 |
| 245 |
drop table t1aver; |
| 246 |
drop table t2aver; |
| 247 |
drop table t3aver; |
| 248 |
drop table t4aver; |
| 249 |
drop table t5aver; |
| 250 |
drop table t6aver; |
| 251 |
drop table t7aver; |
| 252 |
drop table t1a; |
| 253 |
drop table t2a; |
| 254 |
drop table t3a; |
| 255 |
drop table t4a; |
| 256 |
drop table t5a; |
| 257 |
drop table t6a; |
| 258 |
drop table t7a; |
| 259 |
# test b - all data types, csv complex format |
| 260 |
create table t1b ( |
| 261 |
a bigint unsigned not null , |
| 262 |
b bigint , |
| 263 |
c int unsigned , |
| 264 |
d int , |
| 265 |
e mediumint unsigned , |
| 266 |
f mediumint , |
| 267 |
g smallint unsigned , |
| 268 |
h smallint , |
| 269 |
i tinyint unsigned , |
| 270 |
j tinyint , |
| 271 |
k double , |
| 272 |
l float , |
| 273 |
primary key (a) |
| 274 |
) engine ndb; |
| 275 |
create table t2b ( |
| 276 |
a char (10) not null , |
| 277 |
b char (255) , |
| 278 |
c varchar (10) , |
| 279 |
d varchar (1000) , |
| 280 |
primary key (a) |
| 281 |
) engine ndb; |
| 282 |
create table t3b ( |
| 283 |
a binary (10) not null , |
| 284 |
b binary (255) , |
| 285 |
c varbinary (10) , |
| 286 |
d varbinary (1000) , |
| 287 |
primary key (a) |
| 288 |
) engine ndb; |
| 289 |
create table t4b ( |
| 290 |
a decimal (10, 0) , |
| 291 |
b decimal (20, 0) , |
| 292 |
c decimal (10, 5) , |
| 293 |
d decimal (20, 5) , |
| 294 |
e decimal (10, 10) , |
| 295 |
f decimal (20, 10) , |
| 296 |
g int not null , |
| 297 |
primary key (g) |
| 298 |
) engine ndb; |
| 299 |
create table t5b ( |
| 300 |
a bit (1) , |
| 301 |
b bit (8) , |
| 302 |
c bit (16) , |
| 303 |
d bit (32) , |
| 304 |
e bit (64) , |
| 305 |
f int not null , |
| 306 |
primary key (f) |
| 307 |
) engine ndb; |
| 308 |
create table t6b ( |
| 309 |
a year , |
| 310 |
b date , |
| 311 |
c time (6) , |
| 312 |
d datetime (3) , |
| 313 |
e timestamp (6) not null , |
| 314 |
f int not null , |
| 315 |
primary key (f) |
| 316 |
) engine ndb; |
| 317 |
create table t7b ( |
| 318 |
a text (10) , |
| 319 |
b text (255) , |
| 320 |
c text (65536) , |
| 321 |
d int not null , |
| 322 |
e blob (10) , |
| 323 |
f blob (256) , |
| 324 |
g blob (65535) , |
| 325 |
primary key (d) |
| 326 |
) engine ndb; |
| 327 |
select count(*) from t1b; |
| 328 |
count(*) |
| 329 |
1000 |
| 330 |
select count(*) from t2b; |
| 331 |
count(*) |
| 332 |
1000 |
| 333 |
select count(*) from t3b; |
| 334 |
count(*) |
| 335 |
1000 |
| 336 |
select count(*) from t4b; |
| 337 |
count(*) |
| 338 |
1000 |
| 339 |
select count(*) from t5b; |
| 340 |
count(*) |
| 341 |
1000 |
| 342 |
select count(*) from t6b; |
| 343 |
count(*) |
| 344 |
1000 |
| 345 |
select count(*) from t7b; |
| 346 |
count(*) |
| 347 |
20 |
| 348 |
create table t1bver ( |
| 349 |
a bigint unsigned not null , |
| 350 |
b bigint , |
| 351 |
c int unsigned , |
| 352 |
d int , |
| 353 |
e mediumint unsigned , |
| 354 |
f mediumint , |
| 355 |
g smallint unsigned , |
| 356 |
h smallint , |
| 357 |
i tinyint unsigned , |
| 358 |
j tinyint , |
| 359 |
k double , |
| 360 |
l float , |
| 361 |
primary key (a) |
| 362 |
) engine ndb; |
| 363 |
create table t2bver ( |
| 364 |
a char (10) not null , |
| 365 |
b char (255) , |
| 366 |
c varchar (10) , |
| 367 |
d varchar (1000) , |
| 368 |
primary key (a) |
| 369 |
) engine ndb; |
| 370 |
create table t3bver ( |
| 371 |
a binary (10) not null , |
| 372 |
b binary (255) , |
| 373 |
c varbinary (10) , |
| 374 |
d varbinary (1000) , |
| 375 |
primary key (a) |
| 376 |
) engine ndb; |
| 377 |
create table t4bver ( |
| 378 |
a decimal (10, 0) , |
| 379 |
b decimal (20, 0) , |
| 380 |
c decimal (10, 5) , |
| 381 |
d decimal (20, 5) , |
| 382 |
e decimal (10, 10) , |
| 383 |
f decimal (20, 10) , |
| 384 |
g int not null , |
| 385 |
primary key (g) |
| 386 |
) engine ndb; |
| 387 |
create table t5bver ( |
| 388 |
a bit (1) , |
| 389 |
b bit (8) , |
| 390 |
c bit (16) , |
| 391 |
d bit (32) , |
| 392 |
e bit (64) , |
| 393 |
f int not null , |
| 394 |
primary key (f) |
| 395 |
) engine ndb; |
| 396 |
create table t6bver ( |
| 397 |
a year , |
| 398 |
b date , |
| 399 |
c time (6) , |
| 400 |
d datetime (3) , |
| 401 |
e timestamp (6) not null , |
| 402 |
f int not null , |
| 403 |
primary key (f) |
| 404 |
) engine ndb; |
| 405 |
create table t7bver ( |
| 406 |
a text (10) , |
| 407 |
b text (255) , |
| 408 |
c text (65536) , |
| 409 |
d int not null , |
| 410 |
e blob (10) , |
| 411 |
f blob (256) , |
| 412 |
g blob (65535) , |
| 413 |
primary key (d) |
| 414 |
) engine ndb; |
| 415 |
select count(*) from t1bver; |
| 416 |
count(*) |
| 417 |
1000 |
| 418 |
select count(*) from t2bver; |
| 419 |
count(*) |
| 420 |
1000 |
| 421 |
select count(*) from t3bver; |
| 422 |
count(*) |
| 423 |
1000 |
| 424 |
select count(*) from t4bver; |
| 425 |
count(*) |
| 426 |
1000 |
| 427 |
select count(*) from t5bver; |
| 428 |
count(*) |
| 429 |
1000 |
| 430 |
select count(*) from t6bver; |
| 431 |
count(*) |
| 432 |
1000 |
| 433 |
select count(*) from t7bver; |
| 434 |
count(*) |
| 435 |
20 |
| 436 |
select count(*) from t1b x, t1bver y |
| 437 |
where x.a = y.a and |
| 438 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 439 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 440 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 441 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 442 |
(x.f = y.f or (x.f is null and y.f is null)) and |
| 443 |
(x.g = y.g or (x.g is null and y.g is null)) and |
| 444 |
(x.h = y.h or (x.h is null and y.h is null)) and |
| 445 |
(x.i = y.i or (x.i is null and y.i is null)) and |
| 446 |
(x.j = y.j or (x.j is null and y.j is null)) and |
| 447 |
(x.k = y.k or (x.k is null and y.k is null)) and |
| 448 |
(x.l = y.l or (x.l is null and y.l is null)) ; |
| 449 |
count(*) |
| 450 |
1000 |
| 451 |
select count(*) from t2b x, t2bver y |
| 452 |
where x.a = y.a and |
| 453 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 454 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 455 |
(x.d = y.d or (x.d is null and y.d is null)) ; |
| 456 |
count(*) |
| 457 |
1000 |
| 458 |
select count(*) from t3b x, t3bver y |
| 459 |
where x.a = y.a and |
| 460 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 461 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 462 |
(x.d = y.d or (x.d is null and y.d is null)) ; |
| 463 |
count(*) |
| 464 |
1000 |
| 465 |
select count(*) from t4b x, t4bver y |
| 466 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 467 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 468 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 469 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 470 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 471 |
(x.f = y.f or (x.f is null and y.f is null)) and |
| 472 |
x.g = y.g ; |
| 473 |
count(*) |
| 474 |
1000 |
| 475 |
select count(*) from t5b x, t5bver y |
| 476 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 477 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 478 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 479 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 480 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 481 |
x.f = y.f ; |
| 482 |
count(*) |
| 483 |
1000 |
| 484 |
select count(*) from t6b x, t6bver y |
| 485 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 486 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 487 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 488 |
(x.d = y.d or (x.d is null and y.d is null)) and |
| 489 |
x.e = y.e and |
| 490 |
x.f = y.f ; |
| 491 |
count(*) |
| 492 |
1000 |
| 493 |
select count(*) from t7b x, t7bver y |
| 494 |
where (x.a = y.a or (x.a is null and y.a is null)) and |
| 495 |
(x.b = y.b or (x.b is null and y.b is null)) and |
| 496 |
(x.c = y.c or (x.c is null and y.c is null)) and |
| 497 |
x.d = y.d and |
| 498 |
(x.e = y.e or (x.e is null and y.e is null)) and |
| 499 |
(x.f = y.f or (x.f is null and y.f is null)) and |
| 500 |
(x.g = y.g or (x.g is null and y.g is null)) ; |
| 501 |
count(*) |
| 502 |
20 |
| 503 |
drop table t1bver; |
| 504 |
drop table t2bver; |
| 505 |
drop table t3bver; |
| 506 |
drop table t4bver; |
| 507 |
drop table t5bver; |
| 508 |
drop table t6bver; |
| 509 |
drop table t7bver; |
| 510 |
drop table t1b; |
| 511 |
drop table t2b; |
| 512 |
drop table t3b; |
| 513 |
drop table t4b; |
| 514 |
drop table t5b; |
| 515 |
drop table t6b; |
| 516 |
drop table t7b; |
| 517 |
# test c - success, with rejected rows |
| 518 |
create table t8c ( |
| 519 |
a int unsigned not null , |
| 520 |
b smallint not null , |
| 521 |
c float not null , |
| 522 |
d char (10) not null , |
| 523 |
primary key (a) |
| 524 |
) engine ndb; |
| 525 |
select count(*) from t8c; |
| 526 |
count(*) |
| 527 |
900 |
| 528 |
create table t8cver ( |
| 529 |
a int unsigned not null , |
| 530 |
b smallint not null , |
| 531 |
c float not null , |
| 532 |
d char (10) not null , |
| 533 |
primary key (a) |
| 534 |
) engine ndb; |
| 535 |
select count(*) from t8cver; |
| 536 |
count(*) |
| 537 |
900 |
| 538 |
select count(*) from t8c x, t8cver y |
| 539 |
where x.a = y.a ; |
| 540 |
count(*) |
| 541 |
900 |
| 542 |
drop table t8cver; |
| 543 |
drop table t8c; |
| 544 |
# test d - success, with rejected rows and resume |
| 545 |
create table t8d ( |
| 546 |
a int unsigned not null , |
| 547 |
b smallint not null , |
| 548 |
c float not null , |
| 549 |
d char (10) not null , |
| 550 |
primary key (a) |
| 551 |
) engine ndb; |
| 552 |
select count(*) from t8d; |
| 553 |
count(*) |
| 554 |
990 |
| 555 |
create table t8dver ( |
| 556 |
a int unsigned not null , |
| 557 |
b smallint not null , |
| 558 |
c float not null , |
| 559 |
d char (10) not null , |
| 560 |
primary key (a) |
| 561 |
) engine ndb; |
| 562 |
select count(*) from t8dver; |
| 563 |
count(*) |
| 564 |
990 |
| 565 |
select count(*) from t8d x, t8dver y |
| 566 |
where x.a = y.a ; |
| 567 |
count(*) |
| 568 |
990 |
| 569 |
drop table t8dver; |
| 570 |
drop table t8d; |