@@ -2876,7 +2876,7 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
2876
2876
if (create_info->tmp_table ())
2877
2877
{
2878
2878
/* CREATE TEMPORARY TABLE LIKE must be skipped from replication */
2879
- WSREP_DEBUG (" CREATE TEMPORARY TABLE LIKE... skipped replication\n %s" ,
2879
+ WSREP_DEBUG (" CREATE TEMPORARY TABLE LIKE... skipped replication\n %s" ,
2880
2880
thd->query ());
2881
2881
}
2882
2882
else if (!(thd->find_temporary_table (src_table)))
@@ -2886,21 +2886,17 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
2886
2886
}
2887
2887
else
2888
2888
{
2889
- /* here we have CREATE TABLE LIKE <temporary table>
2890
- the temporary table definition will be needed in slaves to
2891
- enable the create to succeed
2892
- */
2893
- TABLE_LIST tbl;
2894
- bzero ((void *) &tbl, sizeof (tbl));
2895
- tbl.db = src_table->db ;
2896
- tbl.table_name = tbl.alias = src_table->table_name ;
2897
- tbl.table = src_table->table ;
2889
+ /* Non-MERGE tables ignore this call. */
2890
+ if (src_table->table ->file ->extra (HA_EXTRA_ADD_CHILDREN_LIST))
2891
+ return (true );
2892
+
2898
2893
char buf[2048 ];
2899
2894
String query (buf, sizeof (buf), system_charset_info);
2900
2895
query.length (0 ); // Have to zero it since constructor doesn't
2901
2896
2902
- (void ) show_create_table (thd, &tbl, &query, NULL , WITH_DB_NAME);
2903
- WSREP_DEBUG (" TMP TABLE: %s" , query.ptr ());
2897
+ int result __attribute__ ((unused))=
2898
+ show_create_table (thd, src_table, &query, NULL , WITH_DB_NAME);
2899
+ WSREP_DEBUG (" TMP TABLE: %s ret_code %d" , query.ptr (), result);
2904
2900
2905
2901
thd->wsrep_TOI_pre_query = query.ptr ();
2906
2902
thd->wsrep_TOI_pre_query_len = query.length ();
@@ -2909,11 +2905,14 @@ bool wsrep_create_like_table(THD* thd, TABLE_LIST* table,
2909
2905
2910
2906
thd->wsrep_TOI_pre_query = NULL ;
2911
2907
thd->wsrep_TOI_pre_query_len = 0 ;
2908
+
2909
+ /* Non-MERGE tables ignore this call. */
2910
+ src_table->table ->file ->extra (HA_EXTRA_DETACH_CHILDREN);
2912
2911
}
2913
2912
2914
2913
return (false );
2915
2914
2916
- WSREP_ERROR_LABEL :
2915
+ wsrep_error_label :
2917
2916
thd->wsrep_TOI_pre_query = NULL ;
2918
2917
return (true );
2919
2918
}
0 commit comments