rpl_drop_db.test 1.4 KB
Newer Older
1 2 3 4 5 6 7
# test case for BUG#4680 -- if there are extra files in the db directory
# dropping the db on the master causes replication problems

-- source include/master-slave.inc
connection master;

--disable_warnings
unknown's avatar
unknown committed
8
drop database if exists mysqltest1;
9
--enable_warnings
unknown's avatar
unknown committed
10 11 12 13 14 15
create database mysqltest1;
create table mysqltest1.t1 (n int);
insert into mysqltest1.t1 values (1);
select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
create table mysqltest1.t2 (n int);
create table mysqltest1.t3 (n int);
16
--replace_result \\ /
17
--error 1010
unknown's avatar
unknown committed
18 19
drop database mysqltest1;
use mysqltest1;
20
show tables;
21 22 23

# test the branch of the code that deals with the query buffer overflow

unknown's avatar
unknown committed
24
--disable_query_log
unknown's avatar
unknown committed
25
let $1=50;
26 27
while ($1)
{
unknown's avatar
unknown committed
28
  eval create table mysqltest1.mysqltest_long_table_name$1 (n int);
29 30
  dec $1;
}
unknown's avatar
unknown committed
31 32
--enable_query_log

33
--replace_result \\ /
34
--error 1010
unknown's avatar
unknown committed
35 36
drop database mysqltest1;
use mysqltest1;
37
show tables;
38 39 40 41 42 43
use test;
create table t1 (n int);
insert into t1 values (1234);
sync_slave_with_master;

connection slave;
unknown's avatar
unknown committed
44
use mysqltest1;
45 46 47 48
show tables;
use test;
select * from t1;

49
system rm  $MYSQLTEST_VARDIR/master-data/mysqltest1/f1.txt;
50
connection master;
51
DROP DATABASE mysqltest1;
52 53 54 55 56
sync_slave_with_master;

#cleanup
connection slave;
stop slave;
unknown's avatar
unknown committed
57
drop database mysqltest1;
58

unknown's avatar
unknown committed
59
connection master;
unknown's avatar
unknown committed
60 61 62
# Remove the "extra" file created above
--remove_file $MYSQLTEST_VARDIR/master-data/mysqltest1/f1.txt
drop database mysqltest1;
63

unknown's avatar
unknown committed
64 65 66
use test;
drop table t1;