mirror of
https://github.com/MariaDB/server.git
synced 2025-10-25 18:38:00 +03:00
We binlog the DROP TABLE for each table that was actually dropped. Per Sergei's suggestion a fixed buffer for the DROP TABLE query is pre-allocated from THD pool, and logging now is done in batches - new batch is started if the buffer becomes full. Reduced memory usage by reusing the table list instead of accumulating a list of dropped table names. Also fixed the problem if the table was not actually dropped, eg due to permissions. Extended the test case to make sure batched query logging does work. mysql-test/r/rpl_drop_db.result: test for query buffer overrun mysql-test/t/rpl_drop_db.test: test for query buffer overrun sql/mysql_priv.h: updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication) BitKeeper/etc/ignore: Added support-files/MacOSX/postflight support-files/MacOSX/preflight to the ignore list sql/sql_db.cc: updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication) sql/sql_table.cc: updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication) sql/table.h: updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication)
53 lines
976 B
Plaintext
53 lines
976 B
Plaintext
# 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
|
|
drop database if exists d1;
|
|
--enable_warnings
|
|
create database d1;
|
|
create table d1.t1 (n int);
|
|
insert into d1.t1 values (1);
|
|
select * from d1.t1 into outfile 'd1/f1.txt';
|
|
create table d1.t2 (n int);
|
|
create table d1.t3 (n int);
|
|
--error 1010
|
|
drop database d1;
|
|
use d1;
|
|
show tables;
|
|
|
|
# test the branch of the code that deals with the query buffer overflow
|
|
|
|
let $1=1000;
|
|
while ($1)
|
|
{
|
|
eval create table d1.t$1(n int);
|
|
dec $1;
|
|
}
|
|
--error 1010
|
|
drop database d1;
|
|
use d1;
|
|
show tables;
|
|
use test;
|
|
create table t1 (n int);
|
|
insert into t1 values (1234);
|
|
sync_slave_with_master;
|
|
|
|
connection slave;
|
|
use d1;
|
|
show tables;
|
|
use test;
|
|
select * from t1;
|
|
|
|
connection master;
|
|
drop table t1;
|
|
sync_slave_with_master;
|
|
|
|
#cleanup
|
|
connection slave;
|
|
stop slave;
|
|
system rm -rf var/master-data/d1;
|
|
|