97 lines
3.3 KiB
Plaintext
97 lines
3.3 KiB
Plaintext
set binlog_format='row';
|
|
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;
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
binlog.000001 # Query # # create database testing_1
|
|
binlog.000001 # Query # # use `testing_1`; create table t1 (a int)
|
|
binlog.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` FUNCTION `sf1`(a int) RETURNS int(11)
|
|
return a+1
|
|
binlog.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a)
|
|
binlog.000001 # Query # # use `testing_1`; CREATE DEFINER=`root`@`localhost` PROCEDURE `sp1`(a int)
|
|
insert into t1 values(a)
|
|
binlog.000001 # Query # # drop database testing_1
|
|
use test;
|
|
reset master;
|
|
create temporary table tt1 (a int);
|
|
create table t1 (a int);
|
|
insert into t1 values (1);
|
|
drop database if exists mysqltest1;
|
|
insert into t1 values (1);
|
|
drop table tt1, t1;
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
binlog.000001 # Query # # use `test`; create table t1 (a int)
|
|
binlog.000001 # Query # # BEGIN
|
|
binlog.000001 # Table_map # # table_id: # (test.t1)
|
|
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
|
binlog.000001 # Query # # COMMIT
|
|
binlog.000001 # Query # # drop database if exists mysqltest1
|
|
binlog.000001 # Query # # BEGIN
|
|
binlog.000001 # Table_map # # table_id: # (test.t1)
|
|
binlog.000001 # Write_rows # # table_id: # flags: STMT_END_F
|
|
binlog.000001 # Query # # COMMIT
|
|
binlog.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
|
|
FLUSH STATUS;
|
|
|
|
# 'DROP TABLE IF EXISTS <deleted table>' are binlogged
|
|
# for each table in SEs not supporting atomic DDL which
|
|
# were dropped by failed 'DROP DATABASE'.
|
|
#
|
|
# Unlike test for bug#11765416/58381 this test uses MyISAM
|
|
# for t1. So failed DROP DATABASE will have side-effect even
|
|
# though removal of InnoDB tables is rolled back.
|
|
# DROP TABLE IF EXISTS is logged for MyISAM table in this case.
|
|
RESET MASTER;
|
|
CREATE DATABASE testing_1;
|
|
USE testing_1;
|
|
CREATE TABLE t1(c1 INT) ENGINE=MyISAM;
|
|
CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=XENGINE;
|
|
#
|
|
# 'DROP DATABASE' will fail but will delete table t1.
|
|
#
|
|
SET SESSION DEBUG='+d,rm_table_no_locks_abort_after_atomic_tables';
|
|
DROP DATABASE testing_1;
|
|
ERROR HY000: Unknown error
|
|
SET SESSION DEBUG='-d,rm_table_no_locks_abort_after_atomic_tables';
|
|
# Cleanup.
|
|
DROP DATABASE testing_1;
|
|
#
|
|
# Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
|
|
# BASED REPLICATION
|
|
#
|
|
USE test;
|
|
DROP DATABASE IF EXISTS db1;
|
|
DROP TABLE IF EXISTS t3;
|
|
CREATE DATABASE db1;
|
|
CREATE TABLE db1.t1 (a INT) engine=XENGINE;
|
|
CREATE TABLE db1.t2 (b INT, KEY(b)) engine=XENGINE;
|
|
RESET MASTER;
|
|
SET SESSION DEBUG='+d,rm_table_no_locks_abort_after_atomic_tables';
|
|
DROP DATABASE db1;
|
|
ERROR HY000: Unknown error
|
|
SET SESSION DEBUG='-d,rm_table_no_locks_abort_after_atomic_tables';
|
|
SHOW TABLES FROM db1;
|
|
Tables_in_db1
|
|
t1
|
|
t2
|
|
include/show_binlog_events.inc
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
DROP DATABASE db1;
|
|
RESET MASTER;
|
|
show databases;
|
|
Database
|
|
__recycle_bin__
|
|
information_schema
|
|
mtr
|
|
mysql
|
|
performance_schema
|
|
sys
|
|
test
|