Skip to content

Commit 62cd755

Browse files
sciascidJan Lindström
authored andcommitted
MW-86 Additional wsrep_sync_wait coverage
The following commands are now subject to wsrep_sync_wait with bitmask value 8: SHOW BINARY LOGS SHOW BINLOG EVENTS SHOW GRANTS
1 parent e2ccbe1 commit 62cd755

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

sql/sql_parse.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,11 +2805,14 @@ mysql_execute_command(THD *thd)
28052805
case SQLCOM_SHOW_COLLATIONS:
28062806
case SQLCOM_SHOW_STORAGE_ENGINES:
28072807
case SQLCOM_SHOW_PROFILE:
2808-
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
28092808
case SQLCOM_SELECT:
28102809
{
2811-
if (lex->sql_command == SQLCOM_SELECT)
2812-
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ);
2810+
#ifdef WITH_WSREP
2811+
if (lex->sql_command == SQLCOM_SELECT)
2812+
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ)
2813+
else
2814+
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW)
2815+
#endif /* WITH_WSREP */
28132816

28142817
thd->status_var.last_query_cost= 0.0;
28152818

@@ -2933,6 +2936,7 @@ case SQLCOM_PREPARE:
29332936
case SQLCOM_SHOW_RELAYLOG_EVENTS: /* fall through */
29342937
case SQLCOM_SHOW_BINLOG_EVENTS:
29352938
{
2939+
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
29362940
if (check_global_access(thd, REPL_SLAVE_ACL))
29372941
goto error;
29382942
res = mysql_show_binlog_events(thd);
@@ -3495,6 +3499,7 @@ case SQLCOM_PREPARE:
34953499
{
34963500
if (check_global_access(thd, SUPER_ACL | REPL_CLIENT_ACL))
34973501
goto error;
3502+
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
34983503
res = show_binlogs(thd);
34993504
break;
35003505
}
@@ -4778,6 +4783,7 @@ case SQLCOM_PREPARE:
47784783
if (!grant_user)
47794784
goto error;
47804785

4786+
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
47814787
res = mysql_show_grants(thd, grant_user);
47824788
break;
47834789
}

sql/sql_parse.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ inline bool is_supported_parser_charset(CHARSET_INFO *cs)
226226
&& wsrep_to_isolation_begin(thd, db_, table_, table_list_)) goto error;
227227

228228
#define WSREP_SYNC_WAIT(thd_, before_) \
229-
if (WSREP_CLIENT(thd_) && \
230-
wsrep_sync_wait(thd_, before_)) goto error;
229+
{ if (WSREP_CLIENT(thd_) && \
230+
wsrep_sync_wait(thd_, before_)) goto error; }
231231

232232
#else
233233

0 commit comments

Comments
 (0)