summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2014-03-28 09:31:24 +0200
committerMichael Widenius <monty@mariadb.org>2014-03-28 09:31:24 +0200
commit10ae6e35d0fa69f0827324ac15750ee7bbdb78c8 (patch)
treee047bb6824f52ebe6a3fd9d4f2d193f2299bdc5d /sql/sql_insert.cc
parentc386daf0c07ff07d83bb29f3e152a1bde803bedb (diff)
downloadmariadb-git-10ae6e35d0fa69f0827324ac15750ee7bbdb78c8.tar.gz
Fixed that the we don't change CREATE to CREATE OR REPLACE, except if the slave removed an existing table as part of CREATE.
This will help the following replicaition scenario: MariaDB 10.0 master (statement replication) -> MariaDB 10.0 slave (row based replication) -> MySQL or MariaDB 5.x slave mysql-test/r/mysqld--help.result: Updated help text mysql-test/suite/rpl/r/create_or_replace_mix.result: Added more tests mysql-test/suite/rpl/r/create_or_replace_row.result: Added more tests mysql-test/suite/rpl/r/create_or_replace_statement.result: Added more tests mysql-test/suite/rpl/t/create_or_replace.inc: Added more tests sql/handler.h: Added org_options so that we can detect what come from the query and what was possible added later. sql/sql_insert.cc: Only write CREATE OR REPLACE if was originally specified or if we delete a conflicting table as part of create sql/sql_parse.cc: Remember orginal create options sql/sql_table.cc: Only write CREATE OR REPLACE if was originally specified or if we delete a conflicting table as part of create sql/sys_vars.cc: Updated help text
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 59223a6091f..d61af758ced 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4164,8 +4164,9 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
result= store_create_info(thd, &tmp_table_list, &query, create_info,
/* show_database */ TRUE,
- MY_TEST(create_info->options &
- HA_LEX_CREATE_REPLACE));
+ MY_TEST(create_info->org_options &
+ HA_LEX_CREATE_REPLACE) ||
+ create_info->table_was_deleted);
DBUG_ASSERT(result == 0); /* store_create_info() always return 0 */
if (mysql_bin_log.is_open())