1
--source include/have_log_bin.inc
4
--source include/have_log_bin.inc
3
7
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
6
10
drop database if exists db2;
15
CREATE TABLE t1(a int, key (a)) key_block_size=1024;
16
INSERT INTO t1 VALUES (1), (2);
17
--exec $DRIZZLE_DUMP --skip-create --skip-comments -X test t1
34
CREATE TABLE t1 (`a"b"` char(2));
35
INSERT INTO t1 VALUES ("1\""), ("\"2");
36
--exec $DRIZZLE_DUMP --compact --skip-create -X test t1
44
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET koi8r;
45
INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5'), (NULL);
46
--exec $DRIZZLE_DUMP --skip-comments --skip-extended-insert test t1
53
CREATE TABLE t1 (a int) ENGINE=MYISAM;
54
INSERT INTO t1 VALUES (1), (2);
55
--exec $DRIZZLE_DUMP --skip-comments --compatible=mysql40 test t1
56
--exec $DRIZZLE_DUMP --skip-comments --compatible=mysql323 test t1
20
60
--echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
24
64
--exec $DRIZZLE_DUMP --compact test
68
#--echo # Bug #2705 'mysqldump --tab extra output'
71
#create table t1(a int);
72
#insert into t1 values (1),(2),(3);
73
#--exec $DRIZZLE_DUMP --skip-comments --tab=$MYSQLTEST_VARDIR/tmp/ test
74
#--cat_file $MYSQLTEST_VARDIR/tmp/t1.sql
75
#--cat_file $MYSQLTEST_VARDIR/tmp/t1.txt
76
#--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
77
#--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
78
#--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
79
#--remove_file $MYSQLTEST_VARDIR/tmp/t1.sql
80
#--remove_file $MYSQLTEST_VARDIR/tmp/t1.txt
28
84
--echo # Bug #6101: create database problem
31
87
--exec $DRIZZLE_DUMP --skip-comments --databases test
34
# @TODO Implement collation checking for UTF8 + collations
36
create database mysqldump_test_db collate utf8_esperanto_ci;
89
create database mysqldump_test_db character set latin2 collate latin2_bin;
37
90
--exec $DRIZZLE_DUMP --skip-comments --databases mysqldump_test_db
38
91
drop database mysqldump_test_db;
44
97
--echo # --default-character-set=xxx. However, we should dump in UTF8
45
98
--echo # if it is explicitely set.
100
CREATE TABLE t1 (a CHAR(10));
101
INSERT INTO t1 VALUES (_latin1 '����');
102
--exec $DRIZZLE_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1
105
--echo # Bug#8063: make test mysqldump [ fail ]
106
--echo # We cannot tes this command because its output depends
107
--echo # on --default-character-set incompiled into "mysqldump" program.
108
--echo # If the future we can move this command into a separate test with
109
--echo # checking that "mysqldump" is compiled with "latin1"
112
#--exec $DRIZZLE_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 test t1
113
--exec $DRIZZLE_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --compatible=mysql323 --default-character-set=cp850 test t1
114
--exec $DRIZZLE_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=cp850 --compatible=mysql323 test t1
115
--exec $DRIZZLE_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments --default-character-set=utf8 --compatible=mysql323 test t1
49
119
--echo # WL #2319: Exclude Tables from dump
64
134
CREATE TABLE t1 (`b` blob);
65
135
INSERT INTO `t1` VALUES (0x602010000280100005E71A);
66
--exec $DRIZZLE_DUMP --skip-extended-insert test --skip-comments t1
136
--exec $DRIZZLE_DUMP --skip-extended-insert --hex-blob test --skip-comments t1
74
144
INSERT INTO t1 VALUES (1),(2),(3);
75
145
INSERT INTO t1 VALUES (4),(5),(6);
76
146
--exec $DRIZZLE_DUMP --skip-comments --insert-ignore test t1
147
--exec $DRIZZLE_DUMP --skip-comments --insert-ignore --delayed-insert test t1
412
483
F_6faa8040da20ef399b63a72d0e4ab575 int,
413
484
F_fe73f687e5bc5280214e0486b273a5f9 int);
414
485
insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
415
--exec $DRIZZLE_DUMP --skip-comments test
486
--exec $DRIZZLE_DUMP --skip-comments -c test
436
507
INSERT INTO t2 VALUES (1), (2);
437
508
--exec $DRIZZLE_DUMP --skip-comments --no-data mysqldump_test_db
438
509
--exec $DRIZZLE_DUMP --skip-comments --no-data mysqldump_test_db t1 t2
510
--exec $DRIZZLE_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db
511
--exec $DRIZZLE_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2
439
512
DROP TABLE t1, t2;
440
513
DROP DATABASE mysqldump_test_db;
453
526
--disable_query_log
454
527
select '------ Testing with illegal table names ------' as test_sequence ;
455
528
--enable_query_log
456
--error EE_CANTCREATEFILE
457
530
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
459
--error EE_CANTCREATEFILE
460
533
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1
462
--error EE_CANTCREATEFILE
463
536
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
465
--error EE_CANTCREATEFILE
466
539
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1
468
--error EE_CANTCREATEFILE
469
542
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
471
--error EE_CANTCREATEFILE
472
545
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1
474
--error EE_CANTCREATEFILE
475
548
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1
477
--error EE_CANTCREATEFILE
478
551
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
480
--error EE_CANTCREATEFILE
481
554
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
483
--error EE_CANTCREATEFILE
484
557
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
486
--error EE_CANTCREATEFILE
487
560
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
489
--error EE_CANTCREATEFILE
490
563
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
492
565
--disable_query_log
493
566
select '------ Testing with illegal database names ------' as test_sequence ;
494
567
--enable_query_log
495
--error EE_CANTCREATEFILE
496
569
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_d 2>&1
498
--error EE_CANTCREATEFILE
499
572
--exec $DRIZZLE_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
501
574
drop table t1, t2, t3;
580
--echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
583
create table t1 (a int(10));
584
create table t2 (pk int primary key auto_increment,
585
a int(10), b varchar(30), c datetime, d blob, e text);
586
insert into t1 values (NULL), (10), (20);
587
insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty");
588
--exec $DRIZZLE_DUMP --skip-comments --xml --no-create-info test
595
create table t1 (a text character set utf8, b text character set latin1);
596
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
598
--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
599
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
600
--exec $DRIZZLE_IMPORT test $MYSQLTEST_VARDIR/tmp/t1.txt
606
--echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
609
--exec $DRIZZLE_MY_PRINT_DEFAULTS --config-file=$DRIZZLE_TEST_DIR/std_data/bug15328.cnf mysqldump
507
612
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
510
615
create table `t1` (
511
616
t1_name varchar(255) default null,
512
t1_id int not null auto_increment,
617
t1_id int(10) not null auto_increment,
514
619
primary key (t1_id)
515
) auto_increment = 1000;
620
) auto_increment = 1000 default charset=latin1;
517
622
insert into t1 (t1_name) values('bla');
518
623
insert into t1 (t1_name) values('bla');
523
628
show create table `t1`;
525
--exec $DRIZZLE_DUMP --skip-comments test t1 > $DRIZZLETEST_VARDIR/tmp/bug19025.sql
630
--exec $DRIZZLE_DUMP --skip-comments test t1 > $MYSQLTEST_VARDIR/tmp/bug19025.sql
528
--exec $DRIZZLE test < $DRIZZLETEST_VARDIR/tmp/bug19025.sql
633
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
530
635
select * from t1;
540
645
create table t1(a int);
541
646
create table t2(a int);
542
647
create table t3(a int);
543
649
--exec $DRIZZLE_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
544
650
drop table t1, t2, t3;
653
--echo # Bug #21288: mysqldump segmentation fault when using --where
656
create table t1 (a int);
658
--exec $DRIZZLE_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
547
662
--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
666
DROP TABLE IF EXISTS `t1`;
671
PRIMARY KEY (`a b`, `c"d`, `e``f`)
672
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
673
insert into t1 values (0815, 4711, 2006);
675
--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
676
--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
565
680
--echo End of 4.1 tests
572
687
--echo # --skip-dump-date:
573
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// /^-- DRI.*///
688
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*//
574
689
--exec $DRIZZLE_DUMP --skip-dump-date test
576
691
--echo # --dump-date:
577
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9a-zA-Z :-]+/ on DATE/ /^-- DRI.*///
578
--exec $DRIZZLE_DUMP test
692
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
693
--exec $DRIZZLE_DUMP --dump-date test
580
695
--echo # --dump-date (default):
581
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9a-zA-Z :-]+/ on DATE/ /^-- DRI.*///
696
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
582
697
--exec $DRIZZLE_DUMP test
613
728
insert t2 values ("a more perfect", "union");
614
729
select * from t1;
615
730
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
731
--exec $DRIZZLE_DUMP --tab=$MYSQLTEST_VARDIR/tmp/ test
732
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t1.sql
733
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/t2.sql
619
734
# 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
735
--exec $DRIZZLE_IMPORT --use-threads=1 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
621
736
# 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
737
--exec $DRIZZLE_IMPORT --silent --use-threads=5 test $MYSQLTEST_VARDIR/tmp/t1.txt $MYSQLTEST_VARDIR/tmp/t2.txt
623
738
select * from t1;
624
739
select * from t2;
625
740
# Now we test with multiple threads, but less threads than files.
626
741
create table words(a varchar(255));
627
742
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
743
--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
744
select * from t1;
630
745
select * from t2;
631
746
select * from words;
634
749
# Drop table "words" and run with threads, should fail
635
750
drop table words;
636
751
--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
753
--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
765
create database `test-database`;
651
766
use `test-database`;
652
767
create table test (a int);
653
--exec $DRIZZLE_DUMP --compact test-database
768
--exec $DRIZZLE_DUMP --compact --opt --quote-names test-database
654
769
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
772
###########################################################################
672
775
--echo # End of 5.1 tests