diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result index e66110af947..0264c9421fc 100644 --- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result +++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result @@ -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; diff --git a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test index d253b7b7175..d722a15f255 100644 --- a/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test +++ b/mysql-test/suite/rpl/t/rpl_tmp_table_and_DDL.test @@ -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 diff --git a/sql/sql_show.cc b/sql/sql_show.cc index ccbf1f41126..24e7d92d1ad 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1,4 +1,4 @@ -/* 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 diff --git a/sql/sql_table.cc b/sql/sql_table.cc index b0547a16050..b8858cffce6 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -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()))