mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
MDEV-7955 WSREP() appears on radar in OLTP RO
This commit is for optimizing WSREP(thd) macro. #define WSREP(thd) \ (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on)) In this we can safely remove wsrep and thd. We are not removing WSREP_ON because this will change WSREP(thd) behaviour. Patch Credit:- Nirbhay Choubay, Sergey Vojtovich
This commit is contained in:
@@ -2624,7 +2624,7 @@ mysql_execute_command(THD *thd)
|
||||
} /* endif unlikely slave */
|
||||
#endif
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP(thd))
|
||||
if (wsrep && WSREP(thd))
|
||||
{
|
||||
/*
|
||||
change LOCK TABLE WRITE to transaction
|
||||
|
||||
@@ -179,7 +179,7 @@ extern wsrep_seqno_t wsrep_locked_seqno;
|
||||
strcmp(wsrep_provider, WSREP_NONE))
|
||||
|
||||
#define WSREP(thd) \
|
||||
(WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))
|
||||
(WSREP_ON && thd->variables.wsrep_on)
|
||||
|
||||
#define WSREP_CLIENT(thd) \
|
||||
(WSREP(thd) && thd->wsrep_client_thread)
|
||||
|
||||
@@ -4103,7 +4103,7 @@ innobase_commit_low(
|
||||
#ifdef WITH_WSREP
|
||||
THD* thd = (THD*)trx->mysql_thd;
|
||||
const char* tmp = 0;
|
||||
if (wsrep_on(thd)) {
|
||||
if (thd && wsrep_on(thd)) {
|
||||
#ifdef WSREP_PROC_INFO
|
||||
char info[64];
|
||||
info[sizeof(info) - 1] = '\0';
|
||||
|
||||
@@ -1349,7 +1349,7 @@ trx_commit_in_memory(
|
||||
ut_ad(!trx->in_rw_trx_list);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (wsrep_on(trx->mysql_thd)) {
|
||||
if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) {
|
||||
trx->lock.was_chosen_as_deadlock_victim = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4742,7 +4742,7 @@ innobase_commit_low(
|
||||
#ifdef WITH_WSREP
|
||||
THD* thd = (THD*)trx->mysql_thd;
|
||||
const char* tmp = 0;
|
||||
if (wsrep_on(thd)) {
|
||||
if (thd && wsrep_on(thd)) {
|
||||
#ifdef WSREP_PROC_INFO
|
||||
char info[64];
|
||||
info[sizeof(info) - 1] = '\0';
|
||||
|
||||
@@ -1572,7 +1572,7 @@ trx_commit_in_memory(
|
||||
ut_ad(!trx->in_rw_trx_list);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (wsrep_on(trx->mysql_thd)) {
|
||||
if (trx->mysql_thd && wsrep_on(trx->mysql_thd)) {
|
||||
trx->lock.was_chosen_as_deadlock_victim = FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user