1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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:
Daniele Sciascia
2017-09-14 11:48:50 +02:00
committed by Jan Lindström
parent d970f805e6
commit fc26fd1c47

View File

@ -1088,10 +1088,12 @@ 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. Bail out if DB snapshot has not been installed.
*/ */
if (thd->variables.wsrep_on && !thd->wsrep_applier && 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)
{ {
@ -1105,6 +1107,7 @@ bool do_command(THD *thd)
return_value= FALSE; return_value= FALSE;
goto out; goto out;
} }
}
#endif #endif
/* Restore read timeout value */ /* Restore read timeout value */
@ -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) &&