Debian Codegraph @

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

raw
1 # BUG#45574:
2 # SP: CREATE DATABASE|TABLE IF NOT EXISTS not binlogged if routine exists.
3 #
4 # There is an inconsistency with DROP DATABASE|TABLE|EVENT IF EXISTS and
5 # CREATE DATABASE|TABLE|EVENT IF NOT EXISTS. DROP IF EXISTS statements are
6 # binlogged even if either the DB, TABLE or EVENT does not exist. In
7 # contrast, Only the CREATE EVENT IF NOT EXISTS is binlogged when the EVENT
8 # exists.
9 #
10 # This problem caused some of the tests to fail randomly on PB or PB2.
11 #
12 # Test is implemented as follows:
13 #
14 # i) test each "CREATE TEMPORARY TABLE IF EXISTS" (DDL), found in MySQL
15 # 5.1 manual, on existent objects;
16 # ii) show binlog events;
17 #
18 # Note:
19 # rpl_create_if_not_exists.test tests other cases.
20 #
21 # References:
22 # http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-data-definition.html
23 #
24
25 #CREATE TEMPORARY TABLE statements are not binlogged in row mode,
26 #So it must be test by itself.
27 source include/have_binlog_format_mixed_or_statement.inc;
28 source include/master-slave.inc;
29 disable_warnings;
30
31 DROP DATABASE IF EXISTS mysqltest;
32
33 CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int);
34 CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int);
35 CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp;
36 CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp;
37 CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp;
38 CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp;
39 source include/show_binlog_events.inc;
40
41 DROP TEMPORARY TABLE tmp;
42 DROP TEMPORARY TABLE tmp1;
43 DROP TEMPORARY TABLE tmp2;
44
45 --source include/rpl_end.inc