~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/mysqldump.test

Merged vcol stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--source include/have_log_bin.inc
 
2
 
 
3
# Binlog is required
 
4
--source include/have_log_bin.inc
1
5
 
2
6
--disable_warnings
3
7
DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa, t3;
6
10
drop database if exists db2;
7
11
--enable_warnings
8
12
 
 
13
# XML output
 
14
 
 
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
 
18
DROP TABLE t1;
 
19
 
9
20
--echo #
10
21
--echo # Bug #2005
11
22
--echo #
17
28
DROP TABLE t1;
18
29
 
19
30
--echo #
 
31
--echo # Bug #1707
 
32
--echo #
 
33
 
 
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
 
37
DROP TABLE t1;
 
38
 
 
39
--echo #
 
40
--echo # Bug #1994
 
41
--echo # Bug #4261
 
42
--echo #
 
43
 
 
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
 
47
DROP TABLE t1;
 
48
 
 
49
--echo #
 
50
--echo # Bug #2634
 
51
--echo #
 
52
 
 
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
 
57
DROP TABLE t1;
 
58
 
 
59
--echo #
20
60
--echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
21
61
--echo #
22
62
 
24
64
--exec $DRIZZLE_DUMP --compact test
25
65
drop table ```a`;
26
66
 
 
67
#--echo #
 
68
#--echo # Bug #2705 'mysqldump --tab extra output'
 
69
#--echo #
 
70
#
 
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
 
81
#drop table t1;
 
82
#
27
83
--echo #
28
84
--echo # Bug #6101: create database problem
29
85
--echo #
30
86
 
31
87
--exec $DRIZZLE_DUMP --skip-comments --databases test
32
88
 
33
 
#
34
 
# @TODO Implement collation checking for UTF8 + collations
35
 
#
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;
39
92
 
44
97
--echo # --default-character-set=xxx. However, we should dump in UTF8
45
98
--echo # if it is explicitely set.
46
99
 
 
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
 
103
 
 
104
--echo #
 
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"
 
110
--echo #
 
111
 
 
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
 
116
DROP TABLE t1;
47
117
 
48
118
--echo #
49
119
--echo # WL #2319: Exclude Tables from dump
63
133
 
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
67
137
DROP TABLE t1;
68
138
 
69
139
--echo #
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
77
148
DROP TABLE t1;
78
149
 
79
150
--echo #
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
416
487
drop table t1;
417
488
 
418
489
--echo #
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;
441
514
 
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
 
529
--error 6
457
530
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
458
531
 
459
 
--error EE_CANTCREATEFILE
 
532
--error 6
460
533
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\t1" 2>&1
461
534
 
462
 
--error EE_CANTCREATEFILE
 
535
--error 6
463
536
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\\t1" 2>&1
464
537
 
465
 
--error EE_CANTCREATEFILE
 
538
--error 6
466
539
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\\\\t1" 2>&1
467
540
 
468
 
--error EE_CANTCREATEFILE
 
541
--error 6
469
542
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "t\1" 2>&1
470
543
 
471
 
--error EE_CANTCREATEFILE
 
544
--error 6
472
545
--exec $DRIZZLE_DUMP --compact --skip-comments  mysqldump_test_db  "t\\1" 2>&1
473
546
 
474
 
--error EE_CANTCREATEFILE
 
547
--error 6
475
548
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "t/1" 2>&1
476
549
 
477
 
--error EE_CANTCREATEFILE
 
550
--error 6
478
551
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
479
552
 
480
 
--error EE_CANTCREATEFILE
 
553
--error 6
481
554
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
482
555
 
483
 
--error EE_CANTCREATEFILE
 
556
--error 6
484
557
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
485
558
 
486
 
--error EE_CANTCREATEFILE
 
559
--error 6
487
560
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
488
561
 
489
 
--error EE_CANTCREATEFILE
 
562
--error 6
490
563
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
491
564
 
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
 
568
--error 2
496
569
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_d 2>&1
497
570
 
498
 
--error EE_CANTCREATEFILE
 
571
--error 2
499
572
--exec $DRIZZLE_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1
500
573
 
501
574
drop table t1, t2, t3;
504
577
 
505
578
 
506
579
--echo #
 
580
--echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
 
581
--echo #
 
582
 
 
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
 
589
drop table t1, t2;
 
590
 
 
591
--echo #
 
592
--echo # BUG #12123
 
593
--echo #
 
594
 
 
595
create table t1 (a text character set utf8, b text character set latin1);
 
596
insert t1 values (0x4F736E616272C3BC636B, 0x4BF66C6E);
 
597
select * from t1;
 
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
 
601
select * from t1;
 
602
 
 
603
drop table t1;
 
604
 
 
605
--echo #
 
606
--echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
 
607
--echo #
 
608
 
 
609
--exec $DRIZZLE_MY_PRINT_DEFAULTS --config-file=$DRIZZLE_TEST_DIR/std_data/bug15328.cnf mysqldump
 
610
 
 
611
--echo #
507
612
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
508
613
--echo #
509
614
 
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,
513
618
    key (t1_name),
514
619
    primary key (t1_id)
515
 
) auto_increment = 1000;
 
620
) auto_increment = 1000 default charset=latin1;
516
621
 
517
622
insert into t1 (t1_name) values('bla');
518
623
insert into t1 (t1_name) values('bla');
522
627
 
523
628
show create table `t1`;
524
629
 
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
526
631
DROP TABLE `t1`;
527
632
 
528
 
--exec $DRIZZLE test < $DRIZZLETEST_VARDIR/tmp/bug19025.sql
 
633
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
529
634
 
530
635
select * from t1;
531
636
 
540
645
create table t1(a int);
541
646
create table t2(a int);
542
647
create table t3(a int);
 
648
--error 6
543
649
--exec $DRIZZLE_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
544
650
drop table t1, t2, t3;
545
651
 
546
652
--echo #
 
653
--echo # Bug #21288: mysqldump segmentation fault when using --where
 
654
--echo #
 
655
 
 
656
create table t1 (a int);
 
657
--error 2
 
658
--exec $DRIZZLE_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
 
659
drop table t1;
 
660
 
 
661
--echo #
547
662
--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
548
663
--echo #
549
664
 
550
 
#--disable_warnings
551
 
#DROP TABLE IF EXISTS `t1`;
552
 
#CREATE TABLE `t1` (
553
 
#  `a b` INT,
554
 
#  `c"d` INT,
555
 
#  `e``f` INT,
556
 
#  PRIMARY KEY (`a b`, `c"d`, `e``f`)
557
 
#);
558
 
#insert into t1 values (0815, 4711, 2006);
559
 
#
560
 
#--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
561
 
#--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
562
 
#DROP TABLE `t1`;
563
 
#--enable_warnings
 
665
--disable_warnings
 
666
DROP TABLE IF EXISTS `t1`;
 
667
CREATE TABLE `t1` (
 
668
  `a b` INT,
 
669
  `c"d` INT,
 
670
  `e``f` INT,
 
671
  PRIMARY KEY (`a b`, `c"d`, `e``f`)
 
672
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
 
673
insert into t1 values (0815, 4711, 2006);
 
674
 
 
675
--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
 
676
--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
 
677
DROP TABLE `t1`;
 
678
--enable_warnings
564
679
 
565
680
--echo End of 4.1 tests
566
681
 
570
685
--echo #
571
686
 
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
575
690
 
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
579
694
 
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
583
698
 
584
699
--echo #
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
 
752
--error 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
639
754
 
640
755
drop table t1;
641
756
drop table t2;
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`;
655
770
use test;
656
771
 
657
 
#
658
 
# Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
659
 
#
660
 
 
661
 
CREATE DATABASE mysqldump_30126;
662
 
USE 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;
667
 
 
668
 
 
669
772
###########################################################################
670
773
 
671
774
--echo #
672
775
--echo # End of 5.1 tests
673
776
--echo #
674