~michaeleguo/ubuntu/trusty/percona-xtradb-cluster-5.5/arm64fix

« back to all changes in this revision

Viewing changes to mysql-test/extra/binlog_tests/database.test

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-02-10 14:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20140210144423-f2134l2gxuvq2m6l
Tags: upstream-5.5.34-25.9+dfsg
ImportĀ upstreamĀ versionĀ 5.5.34-25.9+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
source include/have_log_bin.inc;
 
2
source include/not_embedded.inc;
 
3
 
 
4
# Checking that the drop of a database does not replicate anything in
 
5
# addition to the drop of the database
 
6
 
 
7
reset master;
 
8
create database testing_1;
 
9
use testing_1;
 
10
create table t1 (a int);
 
11
create function sf1 (a int) returns int return a+1;
 
12
create trigger tr1 before insert on t1 for each row insert into t2 values (2*new.a);
 
13
create procedure sp1 (a int) insert into t1 values(a);
 
14
drop database testing_1;
 
15
source include/show_binlog_events.inc;
 
16
 
 
17
# BUG#38773: DROP DATABASE cause switch to stmt-mode when there are
 
18
# temporary tables open
 
19
 
 
20
use test;
 
21
reset master;
 
22
create temporary table tt1 (a int);
 
23
create table t1 (a int);
 
24
insert into t1 values (1);
 
25
disable_warnings;
 
26
drop database if exists mysqltest1;
 
27
enable_warnings;
 
28
insert into t1 values (1);
 
29
drop table tt1, t1;
 
30
source include/show_binlog_events.inc;
 
31
 
 
32
FLUSH STATUS;
 
33
 
 
34
 
 
35
--echo #
 
36
--echo # Bug#11765416 58381: FAILED DROP DATABASE CAN BREAK STATEMENT
 
37
--echo #              BASED REPLICATION
 
38
--echo #
 
39
 
 
40
--disable_warnings
 
41
DROP DATABASE IF EXISTS db1;
 
42
DROP TABLE IF EXISTS t3;
 
43
--enable_warnings
 
44
 
 
45
CREATE DATABASE db1;
 
46
CREATE TABLE db1.t1 (a INT);
 
47
CREATE TABLE db1.t2 (b INT, KEY(b)) engine=innodb;
 
48
CREATE TABLE t3 (a INT, KEY (a), FOREIGN KEY(a) REFERENCES db1.t2(b))
 
49
  engine=innodb;
 
50
RESET MASTER;
 
51
 
 
52
--error ER_ROW_IS_REFERENCED
 
53
DROP DATABASE db1;                      # Fails because of the fk
 
54
SHOW TABLES FROM db1;                   # t1 was dropped, t2 remains
 
55
--source include/show_binlog_events.inc # Check that the binlog drops t1
 
56
 
 
57
# Cleanup
 
58
DROP TABLE t3;
 
59
DROP DATABASE db1;