source include/have_log_bin.inc; source include/not_embedded.inc; # Checking that the drop of a database does not replicate anything in # addition to the drop of the database reset master; create database testing_1; use testing_1; create table t1 (a int); create function sf1 (a int) returns int return a+1; create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a); create procedure sp1 (a int) insert into t1 values(a); drop database testing_1; source include/show_binlog_events.inc; # BUG#38773: DROP DATABASE cause switch to stmt-mode when there are # temporary tables open use test; reset master; create temporary table tt1 (a int); create table t1 (a int); insert into t1 values (1); disable_warnings; drop database if exists mysqltest1; enable_warnings; insert into t1 values (1); drop table tt1, t1; source include/show_binlog_events.inc; FLUSH STATUS; --echo --echo # 'DROP TABLE IF EXISTS <deleted tables>' is binlogged --echo # when 'DROP DATABASE' fails and at least one table is deleted --echo # from the database. RESET MASTER; CREATE DATABASE testing_1; USE testing_1; CREATE TABLE t1(c1 INT); CREATE TABLE t2(c1 INT); let $prefix= `SELECT UUID()`; --echo # Create a file in the database directory --replace_result $prefix FAKE_FILE eval SELECT 'hello' INTO OUTFILE 'fake_file.$prefix'; --echo --echo # 'DROP DATABASE' will fail if there is any other file in the the --echo # database directory # Use '/' instead of '\' in the error message. On windows platform, dir is # formed with '\'. --replace_regex /\\testing_1\\*/\/testing_1\// --error 1010 DROP DATABASE testing_1; let $wait_binlog_event= DROP TABLE IF EXIST; source include/wait_for_binlog_event.inc; let $MYSQLD_DATADIR= `SELECT @@datadir`; --echo --echo # Remove the fake file. --remove_file $MYSQLD_DATADIR/testing_1/fake_file.$prefix --echo # Now we can drop the database. DROP DATABASE testing_1; --echo # --echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT --echo # BASED REPLICATION --echo # USE test; --disable_warnings DROP DATABASE IF EXISTS db1; DROP TABLE IF EXISTS t3; --enable_warnings CREATE DATABASE db1; CREATE TABLE db1.t1 (a INT); CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb; CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b)) engine=innodb; RESET MASTER; --error ER_ROW_IS_REFERENCED DROP DATABASE db1; # Fails because of the fk SHOW TABLES FROM db1; # t1 was dropped, t2 remains --source include/show_binlog_events.inc # Check that the binlog drops t1 # Cleanup DROP TABLE t3; DROP DATABASE db1;
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
binlog.test | File | 10.68 KB | 0644 |
|
binlog_cache_stat.test | File | 13.09 KB | 0644 |
|
binlog_implicit_commit.inc | File | 1.6 KB | 0644 |
|
binlog_innodb.inc | File | 3.9 KB | 0644 |
|
binlog_insert_delayed.test | File | 2.38 KB | 0644 |
|
binlog_mysqlbinlog_fill.inc | File | 1.76 KB | 0644 |
|
binlog_mysqlbinlog_row.inc | File | 13.06 KB | 0644 |
|
binlog_mysqlbinlog_start_stop.inc | File | 1.81 KB | 0644 |
|
binlog_truncate.test | File | 1.6 KB | 0644 |
|
blackhole.test | File | 5.85 KB | 0644 |
|
ctype_cp932.test | File | 27.76 KB | 0644 |
|
ctype_cp932_binlog.test | File | 1.25 KB | 0644 |
|
ctype_ucs_binlog.test | File | 938 B | 0644 |
|
database.test | File | 2.57 KB | 0644 |
|
drop_table.test | File | 547 B | 0644 |
|
drop_temp_table.test | File | 4.84 KB | 0644 |
|
implicit.test | File | 567 B | 0644 |
|
insert_select-binlog.test | File | 1.03 KB | 0644 |
|
mix_innodb_myisam_binlog.test | File | 15.43 KB | 0644 |
|
mix_innodb_myisam_side_effects.test | File | 6.47 KB | 0644 |
|
mysqlbinlog_row_engine.inc | File | 46.03 KB | 0644 |
|
mysqlbinlog_start_stop_1.inc | File | 1.71 KB | 0644 |
|
mysqlbinlog_start_stop_2.inc | File | 1.27 KB | 0644 |
|