@@ -1199,6 +1199,7 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
1199
1199
uchar* buf (0 );
1200
1200
size_t buf_len (0 );
1201
1201
int buf_err;
1202
+ int rc= 0 ;
1202
1203
1203
1204
WSREP_DEBUG (" TO BEGIN: %lld, %d : %s" , (long long )wsrep_thd_trx_seqno (thd),
1204
1205
thd->wsrep_exec_mode , thd->query () );
@@ -1238,7 +1239,6 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
1238
1239
{
1239
1240
thd->wsrep_exec_mode = TOTAL_ORDER;
1240
1241
wsrep_to_isolation++;
1241
- if (buf) my_free (buf);
1242
1242
wsrep_keys_free (&key_arr);
1243
1243
WSREP_DEBUG (" TO BEGIN: %lld, %d" ,(long long )wsrep_thd_trx_seqno (thd),
1244
1244
thd->wsrep_exec_mode );
@@ -1250,18 +1250,18 @@ static int wsrep_TOI_begin(THD *thd, char *db_, char *table_,
1250
1250
ret, (thd->query ()) ? thd->query () : " void" );
1251
1251
my_error (ER_LOCK_DEADLOCK, MYF (0 ), " WSREP replication failed. Check "
1252
1252
" your wsrep connection state and retry the query." );
1253
- if (buf) my_free (buf);
1254
1253
wsrep_keys_free (&key_arr);
1255
- return -1 ;
1254
+ rc= -1 ;
1256
1255
}
1257
1256
else {
1258
1257
/* non replicated DDL, affecting temporary tables only */
1259
1258
WSREP_DEBUG (" TO isolation skipped for: %d, sql: %s."
1260
1259
" Only temporary tables affected." ,
1261
1260
ret, (thd->query ()) ? thd->query () : " void" );
1262
- return 1 ;
1261
+ rc= 1 ;
1263
1262
}
1264
- return 0 ;
1263
+ if (buf) my_free (buf);
1264
+ return rc;
1265
1265
}
1266
1266
1267
1267
static void wsrep_TOI_end (THD *thd) {
0 commit comments