Commit 59142d9a authored by Venkatesh Duggirala's avatar Venkatesh Duggirala

Bug #20439913 CREATE TABLE DB.TABLE LIKE TMPTABLE IS

BINLOGGED INCORRECTLY - BREAKS A SLAVE

Submitted a incomplete patch with my previous push,
re submitting the extra changes the required to make
the patch complete.
parent 151b8ec4
......@@ -184,6 +184,8 @@ INSERT INTO t2 VALUES ("DROP USER test_3@localhost with table locked");
UNLOCK TABLE;
CREATE DATABASE db;
CREATE TABLE db.t1 LIKE t2;
CREATE TABLE t3 LIKE t2;
DROP TABLE t3;
DROP DATABASE db;
DROP USER test_3@localhost;
DROP FUNCTION f2;
......
......@@ -155,6 +155,8 @@ UNLOCK TABLE;
# BINLOGGED INCORRECTLY - BREAKS A SLAVE
CREATE DATABASE db;
CREATE TABLE db.t1 LIKE t2;
CREATE TABLE t3 LIKE t2;
DROP TABLE t3;
DROP DATABASE db;
# end of Bug #20439913 test
......
/* Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
/* Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -1139,6 +1139,11 @@ static bool get_field_default_value(THD *thd, Field *timestamp_field,
to tailor the format of the statement. Can be
NULL, in which case only SQL_MODE is considered
when building the statement.
show_database If true, then print the database before the table
name. The database name is only printed in the event
that it is different from the current database.
If false, then do not print the database before
the table name.
NOTE
Currently always return 0, but might return error code in the
......
......@@ -4720,8 +4720,7 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
int result __attribute__((unused))=
store_create_info(thd, table, &query,
create_info,
table->db ? TRUE : FALSE/* show_database */);
create_info, TRUE /* show_database */);
DBUG_ASSERT(result == 0); // store_create_info() always return 0
if (write_bin_log(thd, TRUE, query.ptr(), query.length()))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment