6
6
drop database if exists db2;
11
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
12
INSERT INTO t1 VALUES (1), (2);
13
--exec $DRIZZLE_DUMP --skip-create --skip-comments -X test t1
30
CREATE TABLE t1 (`a"b"` char(2));
31
INSERT INTO t1 VALUES ("1\""), ("\"2");
32
--exec $DRIZZLE_DUMP --compact --skip-create -X test t1
39
CREATE TABLE t1 (a int);
40
INSERT INTO t1 VALUES (1), (2);
41
--exec $DRIZZLE_DUMP --skip-comments --compatible=mysql40 test t1
42
--exec $DRIZZLE_DUMP --skip-comments --compatible=mysql323 test t1
20
46
--echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
54
--echo # Bug #2705 'mysqldump --tab extra output'
57
create table t1(a int);
58
insert into t1 values (1),(2),(3);
59
--exec $DRIZZLE_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
60
--cat_file $MYSQLTEST_VARDIR/tmp/t1.sql
61
--cat_file $MYSQLTEST_VARDIR/tmp/t1.txt
62
--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
63
--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
64
--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
65
--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
66
--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
28
70
--echo # Bug #6101: create database problem
64
106
CREATE TABLE t1 (`b` blob);
65
107
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
66
--exec $DRIZZLE_DUMP --skip-extended-insert test --skip-comments t1
108
--exec $DRIZZLE_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
74
116
INSERT INTO t1 VALUES (1),(2),(3);
75
117
INSERT INTO t1 VALUES (4),(5),(6);
76
118
--exec $DRIZZLE_DUMP --skip-comments --insert-ignore test t1
119
--exec $DRIZZLE_DUMP --skip-comments --insert-ignore --delayed-insert test t1
412
455
F_6faa8040da20ef399b63a72d0e4ab575 int,
413
456
F_fe73f687e5bc5280214e0486b273a5f9 int);
414
457
insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
415
--exec $DRIZZLE_DUMP --skip-comments test
458
--exec $DRIZZLE_DUMP --skip-comments -c test
436
479
INSERT INTO t2 VALUES (1), (2);
437
480
--exec $DRIZZLE_DUMP --skip-comments --no-data mysqldump_test_db
438
481
--exec $DRIZZLE_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
482
--exec $DRIZZLE_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db
483
--exec $DRIZZLE_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2
439
484
DROP TABLE t1, t2;
440
485
DROP DATABASE mysqldump_test_db;
453
498
--disable_query_log
454
499
select '------ Testing with illegal table names ------' as test_sequence ;
455
500
--enable_query_log
456
--error EE_CANTCREATEFILE
457
502
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
459
--error EE_CANTCREATEFILE
460
505
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
462
--error EE_CANTCREATEFILE
463
508
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
465
--error EE_CANTCREATEFILE
466
511
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
468
--error EE_CANTCREATEFILE
469
514
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
471
--error EE_CANTCREATEFILE
472
517
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
474
--error EE_CANTCREATEFILE
475
520
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
477
--error EE_CANTCREATEFILE
478
523
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
480
--error EE_CANTCREATEFILE
481
526
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
483
--error EE_CANTCREATEFILE
484
529
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
486
--error EE_CANTCREATEFILE
487
532
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
489
--error EE_CANTCREATEFILE
490
535
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
492
537
--disable_query_log
493
538
select '------ Testing with illegal database names ------' as test_sequence ;
494
539
--enable_query_log
495
--error EE_CANTCREATEFILE
496
541
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_d 2>&1
498
--error EE_CANTCREATEFILE
499
544
--exec $DRIZZLE_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
501
546
drop table t1, t2, t3;
552
--echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
555
create table t1 (a int);
556
create table t2 (pk int primary key auto_increment,
557
a int, b varchar(30), c datetime, d blob, e text);
558
insert into t1 values (NULL), (10), (20);
559
insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
560
--exec $DRIZZLE_DUMP --skip-comments --xml --no-create-info test
564
--echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
567
--exec $DRIZZLE_MY_PRINT_DEFAULTS --config-file=$DRIZZLE_TEST_DIR/std_data/bug15328.cnf mysqldump
507
570
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
523
586
show create table `t1`;
525
--exec $DRIZZLE_DUMP --skip-comments test t1 > $DRIZZLETEST_VARDIR/tmp/bug19025.sql
588
--exec $DRIZZLE_DUMP --skip-comments test t1 > $MYSQLTEST_VARDIR/tmp/bug19025.sql
528
--exec $DRIZZLE test < $DRIZZLETEST_VARDIR/tmp/bug19025.sql
591
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
530
593
select * from t1;
540
603
create table t1(a int);
541
604
create table t2(a int);
542
605
create table t3(a int);
543
607
--exec $DRIZZLE_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
544
608
drop table t1, t2, t3;
611
--echo # Bug #21288: mysqldump segmentation fault when using --where
614
create table t1 (a int);
616
--exec $DRIZZLE_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
547
620
--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
551
#DROP TABLE IF EXISTS `t1`;
556
# PRIMARY KEY (`a b`, `c"d`, `e``f`)
558
#insert into t1 values (0815, 4711, 2006);
560
#--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
561
#--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
624
DROP TABLE IF EXISTS `t1`;
629
PRIMARY KEY (`a b`, `c"d`, `e``f`)
631
insert into t1 values (0815, 4711, 2006);
633
--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
634
--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
565
638
--echo End of 4.1 tests
574
647
--exec $DRIZZLE_DUMP --skip-dump-date test
576
649
--echo # --dump-date:
577
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9a-zA-Z :-]+/ on DATE/ /^-- DRI.*///
578
--exec $DRIZZLE_DUMP test
650
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/ /^-- DRI.*///
651
--exec $DRIZZLE_DUMP --dump-date test
580
653
--echo # --dump-date (default):
581
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9a-zA-Z :-]+/ on DATE/ /^-- DRI.*///
654
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/ /^-- DRI.*///
582
655
--exec $DRIZZLE_DUMP test
613
686
insert t2 values ("a more perfect", "union");
614
687
select * from t1;
615
688
select * from t2;
616
--exec $DRIZZLE_DUMP --tab=$DRIZZLETEST_VARDIR/tmp/ test
617
--exec $DRIZZLE test < $DRIZZLETEST_VARDIR/tmp/t1.sql
618
--exec $DRIZZLE test < $DRIZZLETEST_VARDIR/tmp/t2.sql
689
--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
690
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
691
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t2.sql
619
692
# The first load tests the pausing code
620
--exec $DRIZZLE_IMPORT --use-threads=1 test $DRIZZLETEST_VARDIR/tmp/t1.txt $DRIZZLETEST_VARDIR/tmp/t2.txt
693
--exec $DRIZZLE_IMPORT --use-threads=1 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
621
694
# Now we test with multiple threads!
622
--exec $DRIZZLE_IMPORT --silent --use-threads=5 test $DRIZZLETEST_VARDIR/tmp/t1.txt $DRIZZLETEST_VARDIR/tmp/t2.txt
695
--exec $DRIZZLE_IMPORT --silent --use-threads=5 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
623
696
select * from t1;
624
697
select * from t2;
625
698
# Now we test with multiple threads, but less threads than files.
626
699
create table words(a varchar(255));
627
700
create table words2(b varchar(255));
628
--exec $DRIZZLE_IMPORT --silent --use-threads=2 test $DRIZZLETEST_VARDIR/tmp/t1.txt $DRIZZLETEST_VARDIR/tmp/t2.txt $DRIZZLETEST_VARDIR/std_data_ln/words.dat $DRIZZLETEST_VARDIR/std_data_ln/words2.dat
701
--exec $DRIZZLE_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat
629
702
select * from t1;
630
703
select * from t2;
631
704
select * from words;
634
707
# Drop table "words" and run with threads, should fail
635
708
drop table words;
636
709
--replace_regex /.*mysqlimport(\.exe)*/mysql-import/
637
--error EE_ERROR_FIRST
638
--exec $DRIZZLE_IMPORT --silent --use-threads=2 test $DRIZZLETEST_VARDIR/tmp/t1.txt $DRIZZLETEST_VARDIR/tmp/t2.txt $DRIZZLETEST_VARDIR/std_data_ln/words.dat $DRIZZLETEST_VARDIR/std_data_ln/words2.dat 2>&1
711
--exec $DRIZZLE_IMPORT --silent --use-threads=2 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt $MYSQLTEST_VARDIR/std_data_ln/words.dat $MYSQLTEST_VARDIR/std_data_ln/words2.dat 2>&1
650
723
create database `test-database`;
651
724
use `test-database`;
652
725
create table test (a int);
653
--exec $DRIZZLE_DUMP --compact test-database
726
--exec $DRIZZLE_DUMP --compact --opt --quote-names test-database
654
727
drop database `test-database`;
658
# Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
661
CREATE DATABASE mysqldump_30126;
663
CREATE TABLE t1 (c1 int);
664
--exec $DRIZZLE_DUMP --add-drop-database mysqldump_30126 > $DRIZZLETEST_VARDIR/tmp/bug30126.sql
665
--exec $DRIZZLE mysqldump_30126 < $DRIZZLETEST_VARDIR/tmp/bug30126.sql
666
DROP DATABASE mysqldump_30126;
669
730
###########################################################################
672
733
--echo # End of 5.1 tests