From 5a98e2a0d05fb9c2b626350d80ffe9161e2726c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 10 Jun 2005 16:26:23 +0200 Subject: Bug #9558 mysqldump --no-data db t1 t2 format still dumps data - Added testcases according to spec in bug report. mysql-test/r/mysqldump.result: Update results mysql-test/t/mysqldump.test: Add tests for --no-data --- mysql-test/t/mysqldump.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 9f3b412b814..5a35c328314 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -543,3 +543,18 @@ CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (1),(2),(3); --exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test DROP TABLE t1; + +# +# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data +# + +CREATE DATABASE mysqldump_test_db; +USE mysqldump_test_db; +CREATE TABLE t1 ( a INT ); +CREATE TABLE t2 ( a INT ); +INSERT INTO t1 VALUES (1), (2); +INSERT INTO t2 VALUES (1), (2); +--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db +--exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2 +DROP TABLE t1, t2; +DROP DATABASE mysqldump_test_db; -- cgit v1.2.1 From c2a84d5fd2e3d86ab5dd75b13d6dac7a8a06256f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 21 Jun 2005 14:19:56 +0200 Subject: patch client/mysqldump.c: Add description of quote_for_like Add quoting of \ to \\\\ in quote_for_like Add DBUG_* Rearranged code in dump_selected_tables so the first thing it will do is to check that the tables to dump are available Unless --force is used, program will exit if not all specified tables can be found Add files to dump to HASH table for easy iteration Simpler handling of ignore_table list. Add new error code used when table user selected to dump can not be found in db client/mysqltest.c: Make it possible to exec a command that fails by setting --error before the command to exec. Check that the error returned from executed program matches the expected error. Add DBUG_* printouts mysql-test/mysql-test-run.sh: export MYSQL_DUMP_DIR used in "--replace_result" mysql-test/r/mysqldump.result: Added test for illegal / nonexisting table and database names mysql-test/t/mysqldump.test: Added test for illegal / nonexisting table and database names --- mysql-test/t/mysqldump.test | 78 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 5a35c328314..349b1e96239 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -558,3 +558,81 @@ INSERT INTO t2 VALUES (1), (2); --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2 DROP TABLE t1, t2; DROP DATABASE mysqldump_test_db; + +# +# Testing with tables and databases that don't exists +# or contains illegal characters +# (Bug #9358 mysqldump crashes if tablename starts with \) +# +create database mysqldump_test_db; +use mysqldump_test_db; +create table t1(a varchar(30) primary key, b int not null); +create table t2(a varchar(30) primary key, b int not null); +create table t3(a varchar(30) primary key, b int not null); + +--disable_query_log +select '------ Testing with illegal table names ------' as test_sequence ; +--enable_query_log +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1" + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T%1" + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T'1" + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1" + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 6 +--exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_" + +--disable_query_log +select '------ Testing with illegal database names ------' as test_sequence ; +--enable_query_log +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 2 +--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_d 2>&1 + +--replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR +--error 2 +--exec $MYSQL_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1 + +drop table t1, t2, t3; +drop database mysqldump_test_db; + + -- cgit v1.2.1 From e5d0e337f8cabe2824dd324888bca22fd628b350 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 20:22:54 +0200 Subject: BUG#9657 mysqldump xml ( -x ) does not format NULL fields correctly - Importing the bug fixes by patch due to merge problems. client/mysqldump.c: Import patch patch mysql-test/r/mysqldump.result: Import patch patch mysql-test/t/mysqldump.test: Import patch patch --- mysql-test/t/mysqldump.test | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 349b1e96239..2ee7fee2802 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -636,3 +636,16 @@ drop table t1, t2, t3; drop database mysqldump_test_db; + +# +# Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly +# + +create table t1 (a int(10)); +create table t2 (pk int primary key auto_increment, +a int(10), b varchar(30), c datetime, d blob, e text); +insert into t1 values (NULL), (10), (20); +insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thirty"); +--exec $MYSQL_DUMP --skip-comments --xml --no-create-info test +drop table t1, t2; + -- cgit v1.2.1 From 406673b0b320d66562e2778323c59034c22be225 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 20:37:14 +0200 Subject: Fix so that my_progname is set to "mysqldump" client/mysqldump.c: Fix progname of mysqldump mysql-test/r/mysqldump.result: Update test results mysql-test/t/mysqldump.test: Update tests, no need for results --- mysql-test/t/mysqldump.test | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 2ee7fee2802..7f3d3adebbc 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -573,68 +573,54 @@ create table t3(a varchar(30) primary key, b int not null); --disable_query_log select '------ Testing with illegal table names ------' as test_sequence ; --enable_query_log ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\\1" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t/1" 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1" ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T%1" ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T'1" ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_1" ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 6 --exec $MYSQL_DUMP --compact --skip-comments "mysqldump_test_db" "T_" --disable_query_log select '------ Testing with illegal database names ------' as test_sequence ; --enable_query_log ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 2 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_d 2>&1 ---replace_result $MYSQL_DUMP_DIR MYSQL_DUMP_DIR --error 2 --exec $MYSQL_DUMP --compact --skip-comments "mysqld\ump_test_db" 2>&1 drop table t1, t2, t3; drop database mysqldump_test_db; - +use test; # -- cgit v1.2.1 From 572d3e990ae304724477ec32bcd5fc5044196347 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 20:44:32 +0200 Subject: Will do cset -x on this. mysql-test/t/mysqldump.test: Once again. This change should not be here. Every time mysqldump.test has been edited in two different clones this problem appears. --- mysql-test/t/mysqldump.test | 67 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 55 insertions(+), 12 deletions(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 7f3d3adebbc..6400afff610 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2,7 +2,10 @@ --source include/not_embedded.inc --disable_warnings -DROP TABLE IF EXISTS t1, `"t"1`; +DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa; +drop database if exists mysqldump_test_db; +drop database if exists db1; +drop view if exists v1, v2; --enable_warnings # XML output @@ -16,7 +19,7 @@ DROP TABLE t1; # Bug #2005 # -CREATE TABLE t1 (a decimal(240, 20)); +CREATE TABLE t1 (a decimal(64, 20)); INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), ("0987654321098765432109876543210987654321"); --exec $MYSQL_DUMP --compact test t1 @@ -27,7 +30,7 @@ DROP TABLE t1; # CREATE TABLE t1 (a double); -INSERT INTO t1 VALUES (-9e999999); +INSERT INTO t1 VALUES ('-9e999999'); # The following replaces is here because some systems replaces the above # double with '-inf' and others with MAX_DOUBLE --replace_result (-1.79769313486232e+308) (RES) (NULL) (RES) @@ -131,6 +134,15 @@ insert into t1 values (1),(2),(3); --exec rm $MYSQL_TEST_DIR/var/tmp/t1.txt drop table t1; +# +# dump of view +# +create table t1(a int); +create view v1 as select * from t1; +--exec $MYSQL_DUMP --skip-comments test +drop view v1; +drop table t1; + # # Bug #6101: create database problem # @@ -149,7 +161,7 @@ drop database mysqldump_test_db; # if it is explicitely set. CREATE TABLE t1 (a CHAR(10)); -INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 # # Bug#8063: make test mysqldump [ fail ] @@ -185,15 +197,24 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A); --exec $MYSQL_DUMP --skip-extended-insert --hex-blob test --skip-comments t1 DROP TABLE t1; +# +# Bug #9756 +# + +CREATE TABLE t1 (a char(10)); +INSERT INTO t1 VALUES ('\''); +--exec $MYSQL_DUMP --skip-comments test t1 +DROP TABLE t1; + # # Test for --insert-ignore # -CREATE TABLE t1 (a decimal(240, 20)); -INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), -("0987654321098765432109876543210987654321"); ---exec $MYSQL_DUMP --insert-ignore --skip-comments test t1 ---exec $MYSQL_DUMP --insert-ignore --skip-comments --delayed-insert test t1 +CREATE TABLE t1 (a int); +INSERT INTO t1 VALUES (1),(2),(3); +INSERT INTO t1 VALUES (4),(5),(6); +--exec $MYSQL_DUMP --skip-comments --insert-ignore test t1 +--exec $MYSQL_DUMP --skip-comments --insert-ignore --delayed-insert test t1 DROP TABLE t1; # @@ -544,6 +565,28 @@ INSERT INTO t1 VALUES (1),(2),(3); --exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test DROP TABLE t1; +# +# Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X) +# + +create database db1; +use db1; + +CREATE TABLE t2 ( + a varchar(30) default NULL, + KEY a (a(5)) +); + +INSERT INTO t2 VALUES ('alfred'); +INSERT INTO t2 VALUES ('angie'); +INSERT INTO t2 VALUES ('bingo'); +INSERT INTO t2 VALUES ('waffle'); +INSERT INTO t2 VALUES ('lemon'); +create view v2 as select * from t2 where a like 'a%' with check option; +--exec $MYSQL_DUMP --skip-comments db1 +drop table t2; +drop view v2; +drop database db1; # # Bug #9558 mysqldump --no-data db t1 t2 format still dumps data # @@ -556,6 +599,8 @@ INSERT INTO t1 VALUES (1), (2); INSERT INTO t2 VALUES (1), (2); --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db --exec $MYSQL_DUMP --skip-comments --no-data mysqldump_test_db t1 t2 +--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db +--exec $MYSQL_DUMP --skip-comments --skip-create --xml --no-data mysqldump_test_db t1 t2 DROP TABLE t1, t2; DROP DATABASE mysqldump_test_db; @@ -575,13 +620,12 @@ select '------ Testing with illegal table names ------' as test_sequence ; --enable_query_log --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\d-2-1.sql" 2>&1 - --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\t1" 2>&1 --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1 - + --error 6 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1 @@ -620,7 +664,6 @@ select '------ Testing with illegal database names ------' as test_sequence ; drop table t1, t2, t3; drop database mysqldump_test_db; -use test; # -- cgit v1.2.1 From 051e30a45ca90a4c0ced745039b0753eeb92b1c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 20:45:20 +0200 Subject: Cset exclude: msvensson@neptunus.(none)|ChangeSet|20050622184432|37770 mysql-test/t/mysqldump.test: Exclude --- mysql-test/t/mysqldump.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 6400afff610..97711de7072 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -161,7 +161,7 @@ drop database mysqldump_test_db; # if it is explicitely set. CREATE TABLE t1 (a CHAR(10)); -INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 # # Bug#8063: make test mysqldump [ fail ] -- cgit v1.2.1 From 297bc30c4590c8047ec28130bec53cc727ba9b40 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 22 Jun 2005 20:49:58 +0200 Subject: Merge fixes mysql-test/r/mysqldump.result: Update test results mysql-test/t/mysqldump.test: Add "use test" removed by the cset -x --- mysql-test/t/mysqldump.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 97711de7072..ec49eec8b46 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -664,7 +664,7 @@ select '------ Testing with illegal database names ------' as test_sequence ; drop table t1, t2, t3; drop database mysqldump_test_db; - +use test; # # Bug #9657 mysqldump xml ( -x ) does not format NULL fields correctly -- cgit v1.2.1 From d10debf667075033ed400553d5ac5b33a592cce6 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Jun 2005 19:22:41 +0200 Subject: Should not be here, same procedure every time.. mysql-test/r/mysqldump.result: Will be removed mysql-test/t/mysqldump.test: Will be removed --- mysql-test/t/mysqldump.test | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index ec49eec8b46..8b6b45870f9 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa; drop database if exists mysqldump_test_db; drop database if exists db1; -drop view if exists v1, v2; +drop view if exists v1, v2, v3; --enable_warnings # XML output @@ -161,7 +161,7 @@ drop database mysqldump_test_db; # if it is explicitely set. CREATE TABLE t1 (a CHAR(10)); -INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 # # Bug#8063: make test mysqldump [ fail ] @@ -565,6 +565,39 @@ INSERT INTO t1 VALUES (1),(2),(3); --exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test DROP TABLE t1; + +# +# Bug #10927 mysqldump: Can't reload dump with view that consist of other view +# + +create table t1(a int, b int, c varchar(30)); + +insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three"); + +create view v3 as +select * from t1; + +create view v1 as +select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); + +create view v2 as +select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; + +--exec $MYSQL_DUMP test > var/tmp/bug10927.sql +drop view v1, v2, v3; +drop table t1; +--exec $MYSQL test < var/tmp/bug10927.sql + +# Without dropping the original tables in between +--exec $MYSQL_DUMP test > var/tmp/bug10927.sql +--exec $MYSQL test < var/tmp/bug10927.sql +show full tables; +show create view v1; +select * from v1; + +drop view v1, v2, v3; +drop table t1; + # # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X) # -- cgit v1.2.1 From 0aecf3f26e272bc9aa117f116d3d21e5bf5df4ea Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Jun 2005 19:24:34 +0200 Subject: Cset exclude: msvensson@neptunus.(none)|ChangeSet|20050630172241|15421 mysql-test/r/mysqldump.result: Exclude mysql-test/t/mysqldump.test: Exclude --- mysql-test/t/mysqldump.test | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 8b6b45870f9..ec49eec8b46 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa; drop database if exists mysqldump_test_db; drop database if exists db1; -drop view if exists v1, v2, v3; +drop view if exists v1, v2; --enable_warnings # XML output @@ -161,7 +161,7 @@ drop database mysqldump_test_db; # if it is explicitely set. CREATE TABLE t1 (a CHAR(10)); -INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); +INSERT INTO t1 VALUES (_latin1 'ÄÖÜß'); --exec $MYSQL_DUMP --character-sets-dir=$CHARSETSDIR --skip-comments test t1 # # Bug#8063: make test mysqldump [ fail ] @@ -565,39 +565,6 @@ INSERT INTO t1 VALUES (1),(2),(3); --exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test DROP TABLE t1; - -# -# Bug #10927 mysqldump: Can't reload dump with view that consist of other view -# - -create table t1(a int, b int, c varchar(30)); - -insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three"); - -create view v3 as -select * from t1; - -create view v1 as -select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); - -create view v2 as -select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; - ---exec $MYSQL_DUMP test > var/tmp/bug10927.sql -drop view v1, v2, v3; -drop table t1; ---exec $MYSQL test < var/tmp/bug10927.sql - -# Without dropping the original tables in between ---exec $MYSQL_DUMP test > var/tmp/bug10927.sql ---exec $MYSQL test < var/tmp/bug10927.sql -show full tables; -show create view v1; -select * from v1; - -drop view v1, v2, v3; -drop table t1; - # # Bug #10213 mysqldump crashes when dumping VIEWs(on MacOS X) # -- cgit v1.2.1 From 77532a6f578fb5fd3e48ded3ac0e05e2f8c7c44d Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Jun 2005 20:44:31 +0200 Subject: Tests readded for bug 10927 mysql-test/r/mysqldump.result: Add tests for bug#10927 mysql-test/t/mysqldump.test: Add tests for bug#10927 --- mysql-test/t/mysqldump.test | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'mysql-test/t/mysqldump.test') diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index ec49eec8b46..811875a36f5 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -5,7 +5,7 @@ DROP TABLE IF EXISTS t1, `"t"1`, t1aa, t2, t2aa; drop database if exists mysqldump_test_db; drop database if exists db1; -drop view if exists v1, v2; +drop view if exists v1, v2, v3; --enable_warnings # XML output @@ -678,3 +678,34 @@ insert into t2 (a, b) values (NULL, NULL),(10, NULL),(NULL, "twenty"),(30, "thir --exec $MYSQL_DUMP --skip-comments --xml --no-create-info test drop table t1, t2; +# +# Bug #10927 mysqldump: Can't reload dump with view that consist of other view +# + +create table t1(a int, b int, c varchar(30)); + +insert into t1 values(1, 2, "one"), (2, 4, "two"), (3, 6, "three"); + +create view v3 as +select * from t1; + +create view v1 as +select * from v3 where b in (1, 2, 3, 4, 5, 6, 7); + +create view v2 as +select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1; + +--exec $MYSQL_DUMP test > var/tmp/bug10927.sql +drop view v1, v2, v3; +drop table t1; +--exec $MYSQL test < var/tmp/bug10927.sql + +# Without dropping the original tables in between +--exec $MYSQL_DUMP test > var/tmp/bug10927.sql +--exec $MYSQL test < var/tmp/bug10927.sql +show full tables; +show create view v1; +select * from v1; + +drop view v1, v2, v3; +drop table t1; -- cgit v1.2.1