Debian Codegraph @

mysql-test/suite/rpl/t/rpl_drop_db.test

raw
1 # test case for BUG#4680 -- if there are extra files in the db directory
2 # dropping the db on the master causes replication problems
3
4 -- source include/master-slave.inc
5 connection master;
6
7 create database mysqltest1;
8 create table mysqltest1.t1 (n int);
9 insert into mysqltest1.t1 values (1);
10 --enable_prepare_warnings
11 select * from mysqltest1.t1 into outfile 'mysqltest1/f1.txt';
12 --disable_prepare_warnings
13 create table mysqltest1.t2 (n int);
14 create table mysqltest1.t3 (n int);
15 --replace_result \\ / 66 39 93 39 17 39 247 39 41 39 "File exists" "Directory not empty"
16 --error ER_DB_DROP_RMDIR
17 drop database mysqltest1;
18 use mysqltest1;
19 show tables;
20
21 # test the branch of the code that deals with the query buffer overflow
22
23 --disable_query_log
24 let $1=50;
25 while ($1)
26 {
27 eval create table mysqltest1.mysqltest_long_table_name$1 (n int);
28 dec $1;
29 }
30 --enable_query_log
31
32 --replace_result \\ / 66 39 93 39 17 39 247 39 41 39 "File exists" "Directory not empty"
33 --error ER_DB_DROP_RMDIR
34 drop database mysqltest1;
35 use mysqltest1;
36 show tables;
37 use test;
38 create table t1 (n int);
39 insert into t1 values (1234);
40 sync_slave_with_master;
41
42 connection slave;
43 use mysqltest1;
44 show tables;
45 use test;
46 select * from t1;
47
48 #cleanup
49 connection master;
50
51 # Remove the "extra" file created above
52 let $MYSQLD_DATADIR= `select @@datadir`;
53 remove_file $MYSQLD_DATADIR/mysqltest1/f1.txt;
54
55 use test;
56 drop table t1;
57 drop database mysqltest1;
58
59 sync_slave_with_master;
60
61 --source include/rpl_end.inc