| 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 |
--source include/not_group_replication_plugin.inc |
| 26 |
#CREATE TEMPORARY TABLE statements are not binlogged in row mode, |
| 27 |
#or in mixed mode, so it must be test by itself. |
| 28 |
source include/have_binlog_format_statement.inc; |
| 29 |
source include/master-slave.inc; |
| 30 |
|
| 31 |
--disable_warnings ER_TABLE_EXISTS_ERROR |
| 32 |
CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int); |
| 33 |
CREATE TEMPORARY TABLE IF NOT EXISTS tmp(c1 int); |
| 34 |
CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp; |
| 35 |
CREATE TEMPORARY TABLE IF NOT EXISTS tmp1 LIKE tmp; |
| 36 |
CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp; |
| 37 |
CREATE TEMPORARY TABLE IF NOT EXISTS tmp2 SELECT * FROM tmp; |
| 38 |
--enable_warnings ER_TABLE_EXISTS_ERROR |
| 39 |
|
| 40 |
source include/show_binlog_events.inc; |
| 41 |
|
| 42 |
DROP TEMPORARY TABLE IF EXISTS tmp; |
| 43 |
DROP TEMPORARY TABLE IF EXISTS tmp1; |
| 44 |
DROP TEMPORARY TABLE IF EXISTS tmp2; |
| 45 |
|
| 46 |
--source include/rpl_end.inc |