Commit 55c61a6e authored by unknown's avatar unknown

Restore bug fix lost in merge of client/mysqldump.c, and clean up mysqldump.test

so that 4.1 and 5.0 tests are all in the right place and no tests are duplicated.


client/mysqldump.c:
  Restore fix for bug 21215 accidently removed during merge
mysql-test/r/mysqldump.result:
  Update results
mysql-test/t/mysqldump.test:
  Fix order of tests so that all the tests new to the 5.0 tree come after
  "End of 4.1 tests", and so that each leaves things in the state it found
  them (particularly by returning to the 'test' database. Also remove some
  tests that were duplicated.
parent cf749a7a
......@@ -882,6 +882,7 @@ static int mysql_query_with_error_report(MYSQL *mysql_con, MYSQL_RES **res,
fprintf(stderr, "%s: Couldn't execute '%s': %s (%d)\n",
my_progname, query,
mysql_error(mysql_con), mysql_errno(mysql_con));
safe_exit(EX_MYSQLERR);
return 1;
}
return 0;
......
This diff is collapsed.
......@@ -548,121 +548,6 @@ 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 10713 mysqldump includes database in create view and referenced tables
#
# create table and views in db2
create database db2;
use db2;
create table t1 (a int);
create table t2 (a int, b varchar(10), primary key(a));
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
insert into t1 values (289), (298), (234), (456), (789);
create view v1 as select * from t2;
create view v2 as select * from t1;
# dump tables and view from db2
--exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
# drop the db, tables and views
drop table t1, t2;
drop view v1, v2;
drop database db2;
# create db1 and reload dump
create database db1;
use db1;
--exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
# check that all tables and views could be created
show tables;
select * from t2 order by a;
drop table t1, t2;
drop database db1;
#
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
#
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
#
# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
#
create table `t1` (
t1_name varchar(255) default null,
t1_id int(10) unsigned not null auto_increment,
key (t1_name),
primary key (t1_id)
) auto_increment = 1000 default charset=latin1;
insert into t1 (t1_name) values('bla');
insert into t1 (t1_name) values('bla');
insert into t1 (t1_name) values('bla');
select * from t1;
show create table `t1`;
--exec $MYSQL_DUMP --skip-comments test t1 > $MYSQLTEST_VARDIR/tmp/bug19025.sql
DROP TABLE `t1`;
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
select * from t1;
show create table `t1`;
drop table `t1`;
#
# Bug #18536: wrong table order
#
create table t1(a int);
create table t2(a int);
create table t3(a int);
--error 6
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
drop table t1, t2, t3;
#
# Bug #21288: mysqldump segmentation fault when using --where
#
create table t1 (a int);
--error 2
--exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1
drop table t1;
--echo End of 4.1 tests
#
# Bug #9558 mysqldump --no-data db t1 t2 format still dumps data
#
......@@ -769,6 +654,12 @@ select * from t1;
drop table t1;
#
# BUG#15328 Segmentation fault occured if my.cnf is invalid for escape sequence
#
--exec $MYSQL_MY_PRINT_DEFAULTS --config-file=$MYSQL_TEST_DIR/std_data/bug15328.cnf mysqldump
#
# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
#
......@@ -798,8 +689,87 @@ show create table `t1`;
drop table `t1`;
#
# Bug #18536: wrong table order
#
create table t1(a int);
create table t2(a int);
create table t3(a int);
--error 6
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
drop table t1, t2, t3;
#
# Bug #21288: mysqldump segmentation fault when using --where
#
create table t1 (a int);
--error 2
--exec $MYSQL_DUMP --skip-comments --force test t1 --where='xx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' 2>&1
drop table t1;
--echo End of 4.1 tests
#
# 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;
use test;
#
# Bug 10713 mysqldump includes database in create view and referenced tables
#
# create table and views in db2
create database db2;
use db2;
create table t1 (a int);
create table t2 (a int, b varchar(10), primary key(a));
insert into t2 values (1, "on"), (2, "off"), (10, "pol"), (12, "meg");
insert into t1 values (289), (298), (234), (456), (789);
create view v1 as select * from t2;
create view v2 as select * from t1;
# dump tables and view from db2
--exec $MYSQL_DUMP db2 > $MYSQLTEST_VARDIR/tmp/bug10713.sql
# drop the db, tables and views
drop table t1, t2;
drop view v1, v2;
drop database db2;
use test;
# create db1 and reload dump
create database db1;
use db1;
--exec $MYSQL db1 < $MYSQLTEST_VARDIR/tmp/bug10713.sql
# check that all tables and views could be created
show tables;
select * from t2 order by a;
drop table t1, t2;
drop database db1;
use test;
#
# dump of view
#
......@@ -863,6 +833,7 @@ select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
drop view v1, v2, v3;
drop table t1;
#
# Test for dumping triggers
#
......@@ -1122,19 +1093,6 @@ insert into t1 values ('','');
--exec $MYSQL_DUMP --skip-comments --hex-blob test t1
drop table t1;
#
# Bug #18536: wrong table order
#
create table t1(a int);
create table t2(a int);
create table t3(a int);
--error 6
--exec $MYSQL_DUMP --skip-comments --force --no-data test t3 t1 non_existing t2
drop table t1, t2, t3;
--echo End of 4.1 tests
#
# Bug 14871 Invalid view dump output
#
......@@ -1316,11 +1274,11 @@ use mysqldump_dbb;
drop view v1;
drop table t1;
drop database mysqldump_dbb;
use test;
#
# Bug#21215 mysqldump creating incomplete backups without warning
#
use test;
# Create user without sufficient privs to perform the requested operation
create user mysqltest_1@localhost;
......@@ -1389,3 +1347,6 @@ drop table t1;
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User;
drop database mysqldump_myDB;
use test;
--echo End of 5.0 tests
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment