MDEV-22055: Assertion `active() == false' failed in wsrep::transaction::start_transaction upon ROLLBACK AND CHAIN
The optional AND CHAIN clause is a convenience for initiating a new transaction as soon as the old transaction terminates. Therefore, do not start new transaction if it is already started at wsrep_start_transaction.
This commit is contained in:
parent
2000d05c2e
commit
a16f4927db
18
mysql-test/suite/galera/r/MDEV-22055.result
Normal file
18
mysql-test/suite/galera/r/MDEV-22055.result
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
connection node_2;
|
||||||
|
connection node_1;
|
||||||
|
ROLLBACK AND CHAIN;
|
||||||
|
CREATE TABLE t1(a int not null primary key) engine=innodb;
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO t1 values (2);
|
||||||
|
ROLLBACK AND CHAIN;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
connection node_2;
|
||||||
|
SET SESSION wsrep_sync_wait=15;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
connection node_1;
|
||||||
|
DROP TABLE t1;
|
19
mysql-test/suite/galera/t/MDEV-22055.test
Normal file
19
mysql-test/suite/galera/t/MDEV-22055.test
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
--source include/galera_cluster.inc
|
||||||
|
|
||||||
|
ROLLBACK AND CHAIN;
|
||||||
|
|
||||||
|
CREATE TABLE t1(a int not null primary key) engine=innodb;
|
||||||
|
INSERT INTO t1 values (1);
|
||||||
|
|
||||||
|
BEGIN;
|
||||||
|
INSERT INTO t1 values (2);
|
||||||
|
ROLLBACK AND CHAIN;
|
||||||
|
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
--connection node_2
|
||||||
|
SET SESSION wsrep_sync_wait=15;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
|
||||||
|
--connection node_1
|
||||||
|
DROP TABLE t1;
|
@ -133,9 +133,11 @@ static inline size_t wsrep_fragments_certified_for_stmt(THD* thd)
|
|||||||
|
|
||||||
static inline int wsrep_start_transaction(THD* thd, wsrep_trx_id_t trx_id)
|
static inline int wsrep_start_transaction(THD* thd, wsrep_trx_id_t trx_id)
|
||||||
{
|
{
|
||||||
return (thd->wsrep_cs().state() != wsrep::client_state::s_none ?
|
if (thd->wsrep_cs().state() != wsrep::client_state::s_none) {
|
||||||
thd->wsrep_cs().start_transaction(wsrep::transaction_id(trx_id)) :
|
if (wsrep_is_active(thd) == false)
|
||||||
0);
|
return thd->wsrep_cs().start_transaction(wsrep::transaction_id(trx_id));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user