Skip to content

Commit 1e14db1

Browse files
Daniele SciasciaNirbhay Choubey
authored andcommitted
- Add calls to wsrep_sync_wait for SHOW CREATE DB/PROCEDURE/FUNCTION/TRIGGER/EVENT and SHOW PROCEDURE/FUNCTION CODE
1 parent 5ebf6ce commit 1e14db1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

sql/sql_parse.cc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4367,6 +4367,11 @@ case SQLCOM_PREPARE:
43674367
db_name.str= db_name_buff;
43684368
db_name.length= lex->name.length;
43694369
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+
43704375
if (check_db_name(&db_name))
43714376
{
43724377
my_error(ER_WRONG_DB_NAME, MYF(0), db_name.str);
@@ -4423,6 +4428,9 @@ case SQLCOM_PREPARE:
44234428
/* lex->unit.cleanup() is called outside, no need to call it here */
44244429
break;
44254430
case SQLCOM_SHOW_CREATE_EVENT:
4431+
#ifdef WITH_WSREP
4432+
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
4433+
#endif /* WITH_WSREP */
44264434
res= Events::show_create_event(thd, lex->spname->m_db,
44274435
lex->spname->m_name);
44284436
break;
@@ -5389,12 +5397,18 @@ case SQLCOM_PREPARE:
53895397
}
53905398
case SQLCOM_SHOW_CREATE_PROC:
53915399
{
5400+
#ifdef WITH_WSREP
5401+
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
5402+
#endif /* WITH_WSREP */
53925403
if (sp_show_create_routine(thd, TYPE_ENUM_PROCEDURE, lex->spname))
53935404
goto error;
53945405
break;
53955406
}
53965407
case SQLCOM_SHOW_CREATE_FUNC:
53975408
{
5409+
#ifdef WITH_WSREP
5410+
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
5411+
#endif /* WITH_WSREP */
53985412
if (sp_show_create_routine(thd, TYPE_ENUM_FUNCTION, lex->spname))
53995413
goto error;
54005414
break;
@@ -5407,6 +5421,9 @@ case SQLCOM_PREPARE:
54075421
stored_procedure_type type= (lex->sql_command == SQLCOM_SHOW_PROC_CODE ?
54085422
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
54095423

5424+
#ifdef WITH_WSREP
5425+
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
5426+
#endif /* WITH_WSREP */
54105427
if (sp_cache_routine(thd, type, lex->spname, FALSE, &sp))
54115428
goto error;
54125429
if (!sp || sp->show_routine_code(thd))
@@ -5431,6 +5448,9 @@ case SQLCOM_PREPARE:
54315448
goto error;
54325449
}
54335450

5451+
#ifdef WITH_WSREP
5452+
if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd)) goto error;
5453+
#endif /* WITH_WSREP */
54345454
if (show_create_trigger(thd, lex->spname))
54355455
goto error; /* Error has been already logged. */
54365456

0 commit comments

Comments
 (0)