~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/drizzledump.test

  • Committer: Brian Aker
  • Date: 2009-10-15 00:22:33 UTC
  • mto: (1183.1.11 merge)
  • mto: This revision was merged to the branch mainline in revision 1198.
  • Revision ID: brian@gaz-20091015002233-fa4ao2mbc67wls91
First pass of information engine. OMG, ponies... is it so much easier to
deal with creating and engine.

The list table iterator though... its ass, needs to go. We should also
abstract out share. Very few engines need a custom one. Just say'in

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
drop database if exists db2;
7
7
--enable_warnings
8
8
 
 
9
# XML output
 
10
 
 
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
 
14
DROP TABLE t1;
 
15
 
9
16
--echo #
10
17
--echo # Bug #2005
11
18
--echo #
17
24
DROP TABLE t1;
18
25
 
19
26
--echo #
 
27
--echo # Bug #1707
 
28
--echo #
 
29
 
 
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
 
33
DROP TABLE t1;
 
34
 
 
35
--echo #
 
36
--echo # Bug #2634
 
37
--echo #
 
38
 
 
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
 
43
DROP TABLE t1;
 
44
 
 
45
--echo #
20
46
--echo # Bug #2592 'mysqldump doesn't quote "tricky" names correctly'
21
47
--echo #
22
48
 
25
51
drop table ```a`;
26
52
 
27
53
--echo #
 
54
--echo # Bug #2705 'mysqldump --tab extra output'
 
55
--echo #
 
56
 
 
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
 
67
drop table t1;
 
68
 
 
69
--echo #
28
70
--echo # Bug #6101: create database problem
29
71
--echo #
30
72
 
63
105
 
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
67
109
DROP TABLE t1;
68
110
 
69
111
--echo #
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
77
120
DROP TABLE t1;
78
121
 
79
122
--echo #
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
416
459
drop table t1;
417
460
 
418
461
--echo #
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;
441
486
 
453
498
--disable_query_log
454
499
select '------ Testing with illegal table names ------' as test_sequence ;
455
500
--enable_query_log
456
 
--error 2
 
501
--error 6
457
502
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1
458
503
 
459
 
--error 2
 
504
--error 6
460
505
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\t1" 2>&1
461
506
 
462
 
--error 2
 
507
--error 6
463
508
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\\t1" 2>&1
464
509
 
465
 
--error 2
 
510
--error 6
466
511
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "\\\\t1" 2>&1
467
512
 
468
 
--error 2
 
513
--error 6
469
514
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "t\1" 2>&1
470
515
 
471
 
--error 2
 
516
--error 6
472
517
--exec $DRIZZLE_DUMP --compact --skip-comments  mysqldump_test_db  "t\\1" 2>&1
473
518
 
474
 
--error 2
 
519
--error 6
475
520
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db  "t/1" 2>&1
476
521
 
477
 
--error 2
 
522
--error 6
478
523
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
479
524
 
480
 
--error 2
 
525
--error 6
481
526
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T%1" 2>&1
482
527
 
483
 
--error 2
 
528
--error 6
484
529
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T'1" 2>&1
485
530
 
486
 
--error 2
 
531
--error 6
487
532
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_1" 2>&1
488
533
 
489
 
--error 2
 
534
--error 6
490
535
--exec $DRIZZLE_DUMP --compact --skip-comments mysqldump_test_db "T_" 2>&1
491
536
 
492
537
--disable_query_log
504
549
 
505
550
 
506
551
--echo #
 
552
--echo # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly
 
553
--echo #
 
554
 
 
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
 
561
drop table t1, t2;
 
562
 
 
563
--echo #
 
564
--echo # BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
 
565
--echo #
 
566
 
 
567
--exec $DRIZZLE_MY_PRINT_DEFAULTS --config-file=$DRIZZLE_TEST_DIR/std_data/bug15328.cnf mysqldump
 
568
 
 
569
--echo #
507
570
--echo # BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
508
571
--echo #
509
572
 
522
585
 
523
586
show create table `t1`;
524
587
 
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
526
589
DROP TABLE `t1`;
527
590
 
528
 
--exec $DRIZZLE test < $DRIZZLETEST_VARDIR/tmp/bug19025.sql
 
591
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
529
592
 
530
593
select * from t1;
531
594
 
540
603
create table t1(a int);
541
604
create table t2(a int);
542
605
create table t3(a int);
 
606
--error 6
543
607
--exec $DRIZZLE_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
544
608
drop table t1, t2, t3;
545
609
 
546
610
--echo #
 
611
--echo # Bug #21288: mysqldump segmentation fault when using --where
 
612
--echo #
 
613
 
 
614
create table t1 (a int);
 
615
--error 2
 
616
--exec $DRIZZLE_DUMP --skip-comments --force test t1 --where="xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 2>&1
 
617
drop table t1;
 
618
 
 
619
--echo #
547
620
--echo # BUG#13926: --order-by-primary fails if PKEY contains quote character
548
621
--echo #
549
622
 
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
 
623
--disable_warnings
 
624
DROP TABLE IF EXISTS `t1`;
 
625
CREATE TABLE `t1` (
 
626
  `a b` INT,
 
627
  `c"d` INT,
 
628
  `e``f` INT,
 
629
  PRIMARY KEY (`a b`, `c"d`, `e``f`)
 
630
);
 
631
insert into t1 values (0815, 4711, 2006);
 
632
 
 
633
--exec $DRIZZLE_DUMP --skip-comments --compatible=ansi --order-by-primary test t1
 
634
--exec $DRIZZLE_DUMP --skip-comments --order-by-primary test t1
 
635
DROP TABLE `t1`;
 
636
--enable_warnings
564
637
 
565
638
--echo End of 4.1 tests
566
639
 
574
647
--exec $DRIZZLE_DUMP --skip-dump-date test
575
648
 
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 
579
652
 
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
583
656
 
584
657
--echo #
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;
635
708
drop table words;
636
709
--replace_regex /.*mysqlimport(\.exe)*/mysql-import/
637
710
--error 1
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
639
712
 
640
713
drop table t1;
641
714
drop table t2;
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`;
655
728
use test;
656
729
 
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
730
###########################################################################
670
731
 
671
732
--echo #
672
733
--echo # End of 5.1 tests
673
734
--echo #
674