@@ -4367,6 +4367,11 @@ case SQLCOM_PREPARE:
4367
4367
db_name.str = db_name_buff;
4368
4368
db_name.length = lex->name .length ;
4369
4369
strmov (db_name.str , lex->name .str );
4370
+
4371
+ #ifdef WITH_WSREP
4372
+ if (WSREP_CLIENT (thd) && wsrep_sync_wait (thd)) goto error;
4373
+ #endif /* WITH_WSREP */
4374
+
4370
4375
if (check_db_name (&db_name))
4371
4376
{
4372
4377
my_error (ER_WRONG_DB_NAME, MYF (0 ), db_name.str );
@@ -4423,6 +4428,9 @@ case SQLCOM_PREPARE:
4423
4428
/* lex->unit.cleanup() is called outside, no need to call it here */
4424
4429
break ;
4425
4430
case SQLCOM_SHOW_CREATE_EVENT:
4431
+ #ifdef WITH_WSREP
4432
+ if (WSREP_CLIENT (thd) && wsrep_sync_wait (thd)) goto error;
4433
+ #endif /* WITH_WSREP */
4426
4434
res= Events::show_create_event (thd, lex->spname ->m_db ,
4427
4435
lex->spname ->m_name );
4428
4436
break ;
@@ -5389,12 +5397,18 @@ case SQLCOM_PREPARE:
5389
5397
}
5390
5398
case SQLCOM_SHOW_CREATE_PROC:
5391
5399
{
5400
+ #ifdef WITH_WSREP
5401
+ if (WSREP_CLIENT (thd) && wsrep_sync_wait (thd)) goto error;
5402
+ #endif /* WITH_WSREP */
5392
5403
if (sp_show_create_routine (thd, TYPE_ENUM_PROCEDURE, lex->spname ))
5393
5404
goto error;
5394
5405
break ;
5395
5406
}
5396
5407
case SQLCOM_SHOW_CREATE_FUNC:
5397
5408
{
5409
+ #ifdef WITH_WSREP
5410
+ if (WSREP_CLIENT (thd) && wsrep_sync_wait (thd)) goto error;
5411
+ #endif /* WITH_WSREP */
5398
5412
if (sp_show_create_routine (thd, TYPE_ENUM_FUNCTION, lex->spname ))
5399
5413
goto error;
5400
5414
break ;
@@ -5407,6 +5421,9 @@ case SQLCOM_PREPARE:
5407
5421
stored_procedure_type type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE ?
5408
5422
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
5409
5423
5424
+ #ifdef WITH_WSREP
5425
+ if (WSREP_CLIENT (thd) && wsrep_sync_wait (thd)) goto error;
5426
+ #endif /* WITH_WSREP */
5410
5427
if (sp_cache_routine (thd, type, lex->spname , FALSE , &sp))
5411
5428
goto error;
5412
5429
if (!sp || sp->show_routine_code (thd))
@@ -5431,6 +5448,9 @@ case SQLCOM_PREPARE:
5431
5448
goto error;
5432
5449
}
5433
5450
5451
+ #ifdef WITH_WSREP
5452
+ if (WSREP_CLIENT (thd) && wsrep_sync_wait (thd)) goto error;
5453
+ #endif /* WITH_WSREP */
5434
5454
if (show_create_trigger (thd, lex->spname ))
5435
5455
goto error; /* Error has been already logged. */
5436
5456
0 commit comments