~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/mysqldump.test

  • Committer: Monty Taylor
  • Date: 2008-10-23 00:05:28 UTC
  • Revision ID: monty@inaugust.com-20081023000528-grdvrd8c4058nutm
Moved my_handler to myisam, which is where it actually belongs.

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 #
437
507
INSERT INTO t2 VALUES (1), (2);
438
508
--exec $DRIZZLE_DUMP --skip-comments --no-data mysqldump_test_db
439
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
440
512
DROP TABLE t1, t2;
441
513
DROP DATABASE mysqldump_test_db;
442
514
 
454
526
--disable_query_log
455
527
select '------ Testing with illegal table names ------' as test_sequence ;
456
528
--enable_query_log
457
 
--error 2
 
529
--error 6
458
530
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
459
531
 
460
 
--error 2
 
532
--error 6
461
533
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\t1" 2>&1
462
534
 
463
 
--error 2
 
535
--error 6
464
536
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\\t1" 2>&1
465
537
 
466
 
--error 2
 
538
--error 6
467
539
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\\\\t1" 2>&1
468
540
 
469
 
--error 2
 
541
--error 6
470
542
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "t\1" 2>&1
471
543
 
472
 
--error 2
 
544
--error 6
473
545
--exec $DRIZZLE_DUMP --compact --skip-comments  mysqldump_test_db  "t\\1" 2>&1
474
546
 
475
 
--error 2
 
547
--error 6
476
548
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "t/1" 2>&1
477
549
 
478
 
--error 2
 
550
--error 6
479
551
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
480
552
 
481
 
--error 2
 
553
--error 6
482
554
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
483
555
 
484
 
--error 2
 
556
--error 6
485
557
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
486
558
 
487
 
--error 2
 
559
--error 6
488
560
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
489
561
 
490
 
--error 2
 
562
--error 6
491
563
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
492
564
 
493
565
--disable_query_log
505
577
 
506
578
 
507
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 #
508
612
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
509
613
--echo #
510
614
 
511
615
create table `t1` (
512
616
    t1_name varchar(255) default null,
513
 
    t1_id int not null auto_increment,
 
617
    t1_id int(10) not null auto_increment,
514
618
    key (t1_name),
515
619
    primary key (t1_id)
516
 
) auto_increment = 1000;
 
620
) auto_increment = 1000 default charset=latin1;
517
621
 
518
622
insert into t1 (t1_name) values('bla');
519
623
insert into t1 (t1_name) values('bla');
541
645
create table t1(a int);
542
646
create table t2(a int);
543
647
create table t3(a int);
544
 
--error 2
 
648
--error 6
545
649
--exec $DRIZZLE_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
546
650
drop table t1, t2, t3;
547
651
 
548
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 #
549
662
--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
550
663
--echo #
551
664
 
552
 
#--disable_warnings
553
 
#DROP TABLE IF EXISTS `t1`;
554
 
#CREATE TABLE `t1` (
555
 
#  `a b` INT,
556
 
#  `c"d` INT,
557
 
#  `e``f` INT,
558
 
#  PRIMARY KEY (`a b`, `c"d`, `e``f`)
559
 
#);
560
 
#insert into t1 values (0815, 4711, 2006);
561
 
#
562
 
#--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
563
 
#--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
564
 
#DROP TABLE `t1`;
565
 
#--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
566
679
 
567
680
--echo End of 4.1 tests
568
681
 
572
685
--echo #
573
686
 
574
687
--echo # --skip-dump-date:
575
 
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// /^-- DRI.*///
 
688
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*//
576
689
--exec $DRIZZLE_DUMP --skip-dump-date test
577
690
 
578
691
--echo # --dump-date:
579
 
--replace_regex /^[^-][^-].*$// /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9a-zA-Z :-]+/ on DATE/ /^-- DRI.*///
580
 
--exec $DRIZZLE_DUMP test 
 
692
--replace_regex /-- [^D][^u][^m][^p].*// /\/\*!.*// / on [0-9 :-]+/ on DATE/
 
693
--exec $DRIZZLE_DUMP --dump-date test
581
694
 
582
695
--echo # --dump-date (default):
583
 
--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/
584
697
--exec $DRIZZLE_DUMP test
585
698
 
586
699
--echo #
652
765
create database `test-database`;
653
766
use `test-database`;
654
767
create table test (a int);
655
 
--exec $DRIZZLE_DUMP --compact --opt test-database
 
768
--exec $DRIZZLE_DUMP --compact --opt --quote-names test-database
656
769
drop database `test-database`;
657
770
use test;
658
771
 
659
 
#
660
 
# Bug #30126: semicolon before closing */ in /*!... CREATE DATABASE ;*/
661
 
#
662
 
 
663
 
CREATE DATABASE mysqldump_30126;
664
 
USE mysqldump_30126;
665
 
CREATE TABLE t1 (c1 int);
666
 
--exec $DRIZZLE_DUMP --add-drop-database mysqldump_30126 > $MYSQLTEST_VARDIR/tmp/bug30126.sql
667
 
--exec $DRIZZLE mysqldump_30126 < $MYSQLTEST_VARDIR/tmp/bug30126.sql
668
 
DROP DATABASE mysqldump_30126;
669
 
 
670
 
 
671
772
###########################################################################
672
773
 
673
774
--echo #
674
775
--echo # End of 5.1 tests
675
776
--echo #
676