Skip to content

Commit e14b682

Browse files
committed
Fixed assert in WSREP if one started with --wsrep_provider=.. --wsrep_on=OFF
Assert was: mariadbd: /my/maria-10.6/wsrep-lib/src/client_state.cpp:256: int wsrep::client_state::after_statement(): Assertion `state() == s_exec' The reason was because of two faults: - A missing test for WSREP(thd) when checking wsrep_after_statement(() - THD->wsrep_cs().state was set to s_idle instead of s_none
1 parent c03841e commit e14b682

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

sql/sql_parse.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3781,7 +3781,8 @@ mysql_execute_command(THD *thd)
37813781
thd->transaction.stmt.mark_trans_did_ddl();
37823782
#ifdef WITH_WSREP
37833783
/* Clean up the previous transaction on implicit commit */
3784-
if (wsrep_thd_is_local(thd) && wsrep_after_statement(thd))
3784+
if (WSREP_NNULL(thd) && wsrep_thd_is_local(thd) &&
3785+
wsrep_after_statement(thd))
37853786
{
37863787
goto error;
37873788
}
@@ -3855,7 +3856,7 @@ mysql_execute_command(THD *thd)
38553856
Do not start transaction for stored procedures, it will be handled
38563857
internally in SP processing.
38573858
*/
3858-
if (WSREP(thd) &&
3859+
if (WSREP_NNULL(thd) &&
38593860
wsrep_thd_is_local(thd) &&
38603861
lex->sql_command != SQLCOM_BEGIN &&
38613862
lex->sql_command != SQLCOM_CALL &&

sql/wsrep_trans_observer.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,10 @@ static inline void wsrep_after_apply(THD* thd)
407407
static inline void wsrep_open(THD* thd)
408408
{
409409
DBUG_ENTER("wsrep_open");
410-
if (WSREP_PROVIDER_EXISTS)
410+
if (WSREP_ON_)
411411
{
412+
/* WSREP_PROVIDER_EXISTS_ cannot be set if WSREP_ON_ is not set */
413+
DBUG_ASSERT(WSREP_PROVIDER_EXISTS_);
412414
thd->wsrep_cs().open(wsrep::client_id(thd->thread_id));
413415
thd->wsrep_cs().debug_log_level(wsrep_debug);
414416
if (!thd->wsrep_applier && thd->variables.wsrep_trx_fragment_size)

0 commit comments

Comments
 (0)