rpl_drop_db.test 1.3 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
serg@sergbook.mysql.com's avatar
serg@sergbook.mysql.com committed
8
drop database if exists mysqltest1;
9
--enable_warnings
serg@sergbook.mysql.com's avatar
serg@sergbook.mysql.com 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
serg@sergbook.mysql.com's avatar
serg@sergbook.mysql.com 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

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

33
--replace_result \\ /
34
--error 1010
serg@sergbook.mysql.com's avatar
serg@sergbook.mysql.com 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;
serg@sergbook.mysql.com's avatar
serg@sergbook.mysql.com committed
44
use mysqltest1;
45 46 47 48 49 50 51
show tables;
use test;
select * from t1;

#cleanup
connection slave;
stop slave;
52
drop database mysqltest1;
53

54
connection master;
55
# Remove the "extra" file created above
msvensson@pilot.mysql.com's avatar
msvensson@pilot.mysql.com committed
56 57
let $MYSQLD_DATADIR= `select @@datadir`;
--remove_file $MYSQLD_DATADIR/mysqltest1/f1.txt
58
drop database mysqltest1;
59

60 61 62
use test;
drop table t1;