1
# Embedded server doesn't support external clients
2
--source include/not_embedded.inc
3
--source include/have_log_bin.inc
6
--source include/have_log_bin.inc
3
9
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
11
17
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
12
18
INSERT INTO t1 VALUES (1), (2);
13
--exec $DRIZZLE_DUMP --skip-create --skip-comments -X test t1
19
--exec $MYSQL_DUMP --skip-create --skip-comments -X test t1
20
26
CREATE TABLE t1 (a decimal(64, 20));
21
27
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
22
28
("0987654321098765432109876543210987654321");
23
--exec $DRIZZLE_DUMP --compact test t1
29
--exec $MYSQL_DUMP --compact test t1
30
36
CREATE TABLE t1 (`a"b"` char(2));
31
37
INSERT INTO t1 VALUES ("1\""), ("\"2");
32
--exec $DRIZZLE_DUMP --compact --skip-create -X test t1
38
--exec $MYSQL_DUMP --compact --skip-create -X test t1
46
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
47
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
48
--exec $MYSQL_DUMP --skip-comments --skip-extended-insert test t1
39
CREATE TABLE t1 (a int);
55
CREATE TABLE t1 (a int) ENGINE=MYISAM;
40
56
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
57
--exec $MYSQL_DUMP --skip-comments --compatible=mysql40 test t1
58
--exec $MYSQL_DUMP --skip-comments --compatible=mysql323 test t1
57
73
create table t1(a int);
58
74
insert into t1 values (1),(2),(3);
59
--exec $DRIZZLE_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
75
--exec $MYSQL_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
60
76
--cat_file $MYSQLTEST_VARDIR/tmp/t1.sql
61
77
--cat_file $MYSQLTEST_VARDIR/tmp/t1.txt
62
78
--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
63
79
--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
64
--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
80
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
65
81
--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
66
82
--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
70
86
--echo # Bug #6101: create database problem
73
--exec $DRIZZLE_DUMP --skip-comments --databases test
89
--exec $MYSQL_DUMP --skip-comments --databases test
76
# @TODO Implement collation checking for UTF8 + collations
78
create database mysqldump_test_db collate utf8_esperanto_ci;
79
--exec $DRIZZLE_DUMP --skip-comments --databases mysqldump_test_db
91
create database mysqldump_test_db character set latin2 collate latin2_bin;
92
--exec $MYSQL_DUMP --skip-comments --databases mysqldump_test_db
80
93
drop database mysqldump_test_db;
86
99
--echo # --default-character-set=xxx. However, we should dump in UTF8
87
100
--echo # if it is explicitely set.
102
CREATE TABLE t1 (a CHAR(10));
103
INSERT INTO t1 VALUES (_latin1 '����');
104
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
107
--echo # Bug#8063: make test mysqldump [ fail ]
108
--echo # We cannot tes this command because its output depends
109
--echo # on --default-character-set incompiled into "mysqldump" program.
110
--echo # If the future we can move this command into a separate test with
111
--echo # checking that "mysqldump" is compiled with "latin1"
114
#--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1
115
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
116
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
117
--exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
91
121
--echo # WL #2319: Exclude Tables from dump
95
125
CREATE TABLE t2 (a int);
96
126
INSERT INTO t1 VALUES (1),(2),(3);
97
127
INSERT INTO t2 VALUES (4),(5),(6);
98
--exec $DRIZZLE_DUMP --skip-comments --ignore-table=test.t1 test
128
--exec $MYSQL_DUMP --skip-comments --ignore-table=test.t1 test
106
136
CREATE TABLE t1 (`b` blob);
107
137
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
108
--exec $DRIZZLE_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
138
--exec $MYSQL_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
115
145
CREATE TABLE t1 (a int);
116
146
INSERT INTO t1 VALUES (1),(2),(3);
117
147
INSERT INTO t1 VALUES (4),(5),(6);
118
--exec $DRIZZLE_DUMP --skip-comments --insert-ignore test t1
119
--exec $DRIZZLE_DUMP --skip-comments --insert-ignore --delayed-insert test t1
148
--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1
149
--exec $MYSQL_DUMP --skip-comments --insert-ignore --delayed-insert test t1
455
485
F_6faa8040da20ef399b63a72d0e4ab575 int,
456
486
F_fe73f687e5bc5280214e0486b273a5f9 int);
457
487
insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
458
--exec $DRIZZLE_DUMP --skip-comments -c test
488
--exec $MYSQL_DUMP --skip-comments -c test
477
507
CREATE TABLE t2 ( a INT );
478
508
INSERT INTO t1 VALUES (1), (2);
479
509
INSERT INTO t2 VALUES (1), (2);
480
--exec $DRIZZLE_DUMP --skip-comments --no-data mysqldump_test_db
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
510
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db
511
--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
512
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db
513
--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2
484
514
DROP TABLE t1, t2;
485
515
DROP DATABASE mysqldump_test_db;
499
529
select '------ Testing with illegal table names ------' as test_sequence ;
500
530
--enable_query_log
502
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
505
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
508
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
532
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
535
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
538
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
511
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
514
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
517
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
520
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
523
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
526
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
529
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
532
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
535
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
541
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
544
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
547
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
550
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
553
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
556
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
559
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
562
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
565
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
537
567
--disable_query_log
538
568
select '------ Testing with illegal database names ------' as test_sequence ;
539
569
--enable_query_log
541
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_d 2>&1
571
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_d 2>&1
544
--exec $DRIZZLE_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
574
--exec $MYSQL_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
546
576
drop table t1, t2, t3;
547
577
drop database mysqldump_test_db;
552
582
--echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
555
create table t1 (a int);
585
create table t1 (a int(10));
556
586
create table t2 (pk int primary key auto_increment,
557
a int, b varchar(30), c datetime, d blob, e text);
587
a int(10), b varchar(30), c datetime, d blob, e text);
558
588
insert into t1 values (NULL), (10), (20);
559
589
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
590
--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test
561
591
drop table t1, t2;
597
create table t1 (a text character set utf8, b text character set latin1);
598
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
600
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
601
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
602
--exec $MYSQL_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
564
608
--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
611
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
570
614
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
573
617
create table `t1` (
574
618
t1_name varchar(255) default null,
575
t1_id int not null auto_increment,
619
t1_id int(10) unsigned not null auto_increment,
577
621
primary key (t1_id)
578
) auto_increment = 1000;
622
) auto_increment = 1000 default charset=latin1;
580
624
insert into t1 (t1_name) values('bla');
581
625
insert into t1 (t1_name) values('bla');
629
673
PRIMARY KEY (`a b`, `c"d`, `e``f`)
674
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
631
675
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
677
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
678
--exec $MYSQL_DUMP --skip-comments --order-by-primary test t1
636
680
--enable_warnings
645
689
--echo # --skip-dump-date:
646
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// /^-- DRI.*///
647
--exec $DRIZZLE_DUMP --skip-dump-date test
690
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*//
691
--exec $MYSQL_DUMP --skip-dump-date test
649
693
--echo # --dump-date:
650
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/ /^-- DRI.*///
651
--exec $DRIZZLE_DUMP --dump-date test
694
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
695
--exec $MYSQL_DUMP --dump-date test
653
697
--echo # --dump-date (default):
654
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/ /^-- DRI.*///
655
--exec $DRIZZLE_DUMP test
698
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
699
--exec $MYSQL_DUMP test
658
702
--echo # End of 5.0 tests
668
712
INSERT INTO t1 VALUES (1,1);
669
713
INSERT INTO t1 VALUES (2,3);
670
714
INSERT INTO t1 VALUES (3,4), (4,5);
671
--exec $DRIZZLE_DUMP --replace --skip-comments test t1
715
--exec $MYSQL_DUMP --replace --skip-comments test t1
686
730
insert t2 values ("a more perfect", "union");
687
731
select * from t1;
688
732
select * from t2;
689
--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
733
--exec $MYSQL_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
690
734
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
691
735
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t2.sql
692
736
# The first load tests the pausing code
693
--exec $DRIZZLE_IMPORT --use-threads=1 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
737
--exec $MYSQL_IMPORT --use-threads=1 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
694
738
# Now we test with multiple threads!
695
--exec $DRIZZLE_IMPORT --silent --use-threads=5 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
739
--exec $MYSQL_IMPORT --silent --use-threads=5 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
696
740
select * from t1;
697
741
select * from t2;
698
742
# Now we test with multiple threads, but less threads than files.
699
743
create table words(a varchar(255));
700
744
create table words2(b varchar(255));
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
745
--exec $MYSQL_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
702
746
select * from t1;
703
747
select * from t2;
704
748
select * from words;
708
752
drop table words;
709
753
--replace_regex /.*mysqlimport(\.exe)*/mysql-import/
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
755
--exec $MYSQL_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
723
767
create database `test-database`;
724
768
use `test-database`;
725
769
create table test (a int);
726
--exec $DRIZZLE_DUMP --compact --opt --quote-names test-database
770
--exec $MYSQL_DUMP --compact --opt --quote-names test-database
727
771
drop database `test-database`;