Commit b00fd50f authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-32541 Assertion `!(thd->server_status & (1U | 8192U))' failed in...

MDEV-32541 Assertion `!(thd->server_status & (1U | 8192U))' failed in MDL_context::release_transactional_locks

SERVER_STATUS_IN_TRANS_READONLY should never be set without
SERVER_STATUS_IN_TRANS.

They're set together, must be removed together.
parent 082aea77
...@@ -359,4 +359,34 @@ Note 4092 Unknown VIEW: 'test.s' ...@@ -359,4 +359,34 @@ Note 4092 Unknown VIEW: 'test.s'
DROP VIEW v1; DROP VIEW v1;
DROP SEQUENCE s; DROP SEQUENCE s;
DROP TABLE t; DROP TABLE t;
#
# End of 10.3 tests # End of 10.3 tests
#
#
# MDEV-32541 Assertion `!(thd->server_status & (1U | 8192U))' failed in MDL_context::release_transactional_locks
#
create sequence s1;
create sequence s2;
connect con1,localhost,root,,;
set session transaction read only;
start transaction;
connection default;
start transaction;
insert into s2 values (1, 1, 10000, 100, 1, 1000, 0, 0);
connection con1;
select lastval(s1);
lastval(s1)
NULL
select lastval(s2);;
connection default;
set lock_wait_timeout= 1;
insert into s1 values (1, 1, 10000, 100, 1, 1000, 0, 0);
connection con1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
disconnect con1;
connection default;
drop sequence s1;
drop sequence s2;
#
# End of 10.4 tests
#
...@@ -387,4 +387,39 @@ DROP VIEW IF EXISTS s; ...@@ -387,4 +387,39 @@ DROP VIEW IF EXISTS s;
DROP VIEW v1; DROP VIEW v1;
DROP SEQUENCE s; DROP SEQUENCE s;
DROP TABLE t; DROP TABLE t;
--echo #
--echo # End of 10.3 tests --echo # End of 10.3 tests
--echo #
--echo #
--echo # MDEV-32541 Assertion `!(thd->server_status & (1U | 8192U))' failed in MDL_context::release_transactional_locks
--echo #
create sequence s1;
create sequence s2;
--connect (con1,localhost,root,,)
set session transaction read only;
start transaction;
--connection default
start transaction;
insert into s2 values (1, 1, 10000, 100, 1, 1000, 0, 0);
--connection con1
select lastval(s1);
--send select lastval(s2);
--connection default
set lock_wait_timeout= 1;
insert into s1 values (1, 1, 10000, 100, 1, 1000, 0, 0);
--connection con1
--error ER_LOCK_DEADLOCK
--reap
--disconnect con1
--connection default
drop sequence s1;
drop sequence s2;
--echo #
--echo # End of 10.4 tests
--echo #
...@@ -383,7 +383,7 @@ bool trans_rollback_implicit(THD *thd) ...@@ -383,7 +383,7 @@ bool trans_rollback_implicit(THD *thd)
*/ */
DBUG_ASSERT(thd->transaction.stmt.is_empty() && !thd->in_sub_stmt); DBUG_ASSERT(thd->transaction.stmt.is_empty() && !thd->in_sub_stmt);
thd->server_status&= ~SERVER_STATUS_IN_TRANS; thd->server_status&= ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY);
DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS")); DBUG_PRINT("info", ("clearing SERVER_STATUS_IN_TRANS"));
res= ha_rollback_trans(thd, true); res= ha_rollback_trans(thd, true);
/* /*
......
...@@ -45,7 +45,7 @@ class Wsrep_non_trans_mode ...@@ -45,7 +45,7 @@ class Wsrep_non_trans_mode
, m_server_status(thd->server_status) , m_server_status(thd->server_status)
{ {
m_thd->variables.option_bits&= ~OPTION_BEGIN; m_thd->variables.option_bits&= ~OPTION_BEGIN;
m_thd->server_status&= ~SERVER_STATUS_IN_TRANS; m_thd->server_status&= ~(SERVER_STATUS_IN_TRANS | SERVER_STATUS_IN_TRANS_READONLY);
m_thd->wsrep_cs().enter_toi_mode(ws_meta); m_thd->wsrep_cs().enter_toi_mode(ws_meta);
} }
~Wsrep_non_trans_mode() ~Wsrep_non_trans_mode()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment