summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index 7d682f6e997..9ad3ef0c1c0 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -2719,7 +2719,7 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
if (create_info->tmp_table())
{
/* CREATE TEMPORARY TABLE LIKE must be skipped from replication */
- WSREP_DEBUG("CREATE TEMPORARY TABLE LIKE... skipped replication\n %s",
+ WSREP_DEBUG("CREATE TEMPORARY TABLE LIKE... skipped replication\n %s",
thd->query());
}
else if (!(thd->find_temporary_table(src_table)))
@@ -2729,21 +2729,17 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
}
else
{
- /* here we have CREATE TABLE LIKE <temporary table>
- the temporary table definition will be needed in slaves to
- enable the create to succeed
- */
- TABLE_LIST tbl;
- bzero((void*) &tbl, sizeof(tbl));
- tbl.db= src_table->db;
- tbl.table_name= tbl.alias= src_table->table_name;
- tbl.table= src_table->table;
+ /* Non-MERGE tables ignore this call. */
+ if (src_table->table->file->extra(HA_EXTRA_ADD_CHILDREN_LIST))
+ return (true);
+
char buf[2048];
String query(buf, sizeof(buf), system_charset_info);
query.length(0); // Have to zero it since constructor doesn't
- (void) show_create_table(thd, &tbl, &query, NULL, WITH_DB_NAME);
- WSREP_DEBUG("TMP TABLE: %s", query.ptr());
+ int result __attribute__((unused))=
+ show_create_table(thd, src_table, &query, NULL, WITH_DB_NAME);
+ WSREP_DEBUG("TMP TABLE: %s ret_code %d", query.ptr(), result);
thd->wsrep_TOI_pre_query= query.ptr();
thd->wsrep_TOI_pre_query_len= query.length();
@@ -2752,6 +2748,9 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
thd->wsrep_TOI_pre_query= NULL;
thd->wsrep_TOI_pre_query_len= 0;
+
+ /* Non-MERGE tables ignore this call. */
+ src_table->table->file->extra(HA_EXTRA_DETACH_CHILDREN);
}
return(false);