@@ -435,6 +435,7 @@ func TestCopy(t *testing.T) {
435
435
436
436
testCases := []struct {
437
437
dbName string
438
+ testCase string
438
439
setupQueries []setupQuery
439
440
src string
440
441
dest string
@@ -449,7 +450,8 @@ func TestCopy(t *testing.T) {
449
450
dest : "staff_copy" ,
450
451
},
451
452
{
452
- dbName : "pgsql" ,
453
+ dbName : "pgsql" ,
454
+ testCase : "schemaInDest" ,
453
455
setupQueries : []setupQuery {
454
456
{query : "DROP TABLE staff_copy" },
455
457
{query : "CREATE TABLE staff_copy AS SELECT * FROM staff WHERE 0=1" , check : true },
@@ -467,7 +469,8 @@ func TestCopy(t *testing.T) {
467
469
dest : "staff_copy" ,
468
470
},
469
471
{
470
- dbName : "pgx" ,
472
+ dbName : "pgx" ,
473
+ testCase : "schemaInDest" ,
471
474
setupQueries : []setupQuery {
472
475
{query : "DROP TABLE staff_copy" },
473
476
{query : "CREATE TABLE staff_copy AS SELECT * FROM staff WHERE 0=1" , check : true },
@@ -484,6 +487,17 @@ func TestCopy(t *testing.T) {
484
487
src : "select staff_id, first_name, last_name, address_id, picture, email, store_id, active, username, password, last_update from staff" ,
485
488
dest : "staff_copy(staff_id, first_name, last_name, address_id, picture, email, store_id, active, username, password, last_update)" ,
486
489
},
490
+ {
491
+ dbName : "mysql" ,
492
+ testCase : "bulkCopy" ,
493
+ setupQueries : []setupQuery {
494
+ {query : "SET GLOBAL local_infile = ON" },
495
+ {query : "DROP TABLE staff_copy" },
496
+ {query : "CREATE TABLE staff_copy AS SELECT * FROM staff WHERE 0=1" , check : true },
497
+ },
498
+ src : "select staff_id, first_name, last_name, address_id, email, store_id, active, username, password, last_update from staff" ,
499
+ dest : "staff_copy(staff_id, first_name, last_name, address_id, email, store_id, active, username, password, last_update)" ,
500
+ },
487
501
{
488
502
dbName : "sqlserver" ,
489
503
setupQueries : []setupQuery {
@@ -508,7 +522,11 @@ func TestCopy(t *testing.T) {
508
522
continue
509
523
}
510
524
511
- t .Run (test .dbName , func (t * testing.T ) {
525
+ testName := test .dbName
526
+ if test .testCase != "" {
527
+ testName += "-" + test .testCase
528
+ }
529
+ t .Run (testName , func (t * testing.T ) {
512
530
513
531
// TODO test copy from a different DB, maybe csvq?
514
532
// TODO test copy from same DB
0 commit comments