From a622585236194d8f38f203c60b5ed23936c591cd Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Mon, 2 Feb 2004 21:20:10 +0200 Subject: [PATCH] sql_table.cc: Fix for a bug #2557 which caused that MySQL 4.1.2 does not replicate CREATE TABLE ... LIKE .. --- sql/sql_table.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 60da32fceca..03272c8bc16 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1845,6 +1845,20 @@ int mysql_create_like_table(THD* thd, TABLE_LIST* table, table_name); /* purecov: inspected */ DBUG_RETURN(-1); /* purecov: inspected */ } + else + { + // Must be written before unlock + mysql_update_log.write(thd,thd->query, thd->query_length); + if (mysql_bin_log.is_open()) + { + thd->clear_error(); + Query_log_event qinfo(thd, thd->query, thd->query_length, + test(create_info->options & + HA_LEX_CREATE_TMP_TABLE)); + mysql_bin_log.write(&qinfo); + } + } + DBUG_RETURN(0); table_exists: