MW-405 Remove redundant conditions
Remove clause on `thd->variables.wsrep_on` in the following code: if (WSREP(thd)) { ... if (thd->variables.wsrep_on && ... In the above snippet, `WSREP(thd)` already ensures thd->variables.wsrep_on
This commit is contained in:
parent
d970f805e6
commit
fc26fd1c47
@ -1088,22 +1088,25 @@ bool do_command(THD *thd)
|
|||||||
command_name[command].str));
|
command_name[command].str));
|
||||||
|
|
||||||
#ifdef WITH_WSREP
|
#ifdef WITH_WSREP
|
||||||
/*
|
if (WSREP(thd))
|
||||||
Bail out if DB snapshot has not been installed.
|
{
|
||||||
*/
|
/*
|
||||||
if (thd->variables.wsrep_on && !thd->wsrep_applier &&
|
Bail out if DB snapshot has not been installed.
|
||||||
|
*/
|
||||||
|
if (!thd->wsrep_applier &&
|
||||||
(!wsrep_ready || wsrep_reject_queries != WSREP_REJECT_NONE) &&
|
(!wsrep_ready || wsrep_reject_queries != WSREP_REJECT_NONE) &&
|
||||||
(server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0)
|
(server_command_flags[command] & CF_SKIP_WSREP_CHECK) == 0)
|
||||||
{
|
{
|
||||||
thd->protocol->end_statement();
|
thd->protocol->end_statement();
|
||||||
|
|
||||||
/* Performance Schema Interface instrumentation end. */
|
/* Performance Schema Interface instrumentation end. */
|
||||||
MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
|
MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da());
|
||||||
thd->m_statement_psi= NULL;
|
thd->m_statement_psi= NULL;
|
||||||
thd->m_digest= NULL;
|
thd->m_digest= NULL;
|
||||||
|
|
||||||
return_value= FALSE;
|
return_value= FALSE;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -2666,8 +2669,7 @@ mysql_execute_command(THD *thd)
|
|||||||
* allow SET and SHOW queries and reads from information schema
|
* allow SET and SHOW queries and reads from information schema
|
||||||
* and dirty reads (if configured)
|
* and dirty reads (if configured)
|
||||||
*/
|
*/
|
||||||
if (thd->variables.wsrep_on &&
|
if (!thd->wsrep_applier &&
|
||||||
!thd->wsrep_applier &&
|
|
||||||
!(wsrep_ready && wsrep_reject_queries == WSREP_REJECT_NONE) &&
|
!(wsrep_ready && wsrep_reject_queries == WSREP_REJECT_NONE) &&
|
||||||
!(thd->variables.wsrep_dirty_reads &&
|
!(thd->variables.wsrep_dirty_reads &&
|
||||||
(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) == 0) &&
|
(sql_command_flags[lex->sql_command] & CF_CHANGES_DATA) == 0) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user