mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-26175 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*)
If we are inside stored function or trigger we should not commit or rollback current statement transaction. Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
committed by
Julius Goryavsky
parent
4daea2f8b6
commit
f83b7ae13d
24
mysql-test/suite/galera/r/mdev-26175.result
Normal file
24
mysql-test/suite/galera/r/mdev-26175.result
Normal file
@ -0,0 +1,24 @@
|
||||
connection node_2;
|
||||
connection node_1;
|
||||
connection node_1;
|
||||
SET sql_mode="no_zero_date";
|
||||
SET GLOBAL wsrep_max_ws_rows=1;
|
||||
CREATE TABLE t2 (a INT);
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TRIGGER tgr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
|
||||
INSERT INTO t1 VALUES (0),(1);
|
||||
ERROR HY000: wsrep_max_ws_rows exceeded
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
connection node_2;
|
||||
SELECT * FROM t1;
|
||||
a
|
||||
SELECT * FROM t2;
|
||||
a
|
||||
connection node_1;
|
||||
SET sql_mode=DEFAULT;
|
||||
SET GLOBAL wsrep_max_ws_rows=DEFAULT;
|
||||
DROP TRIGGER tgr;
|
||||
DROP TABLE t1, t2;
|
@ -1,4 +1,5 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# MDEV-19353 : Alter Sequence do not replicate to another nodes with in Galera Cluster
|
||||
|
27
mysql-test/suite/galera/t/mdev-26175.test
Normal file
27
mysql-test/suite/galera/t/mdev-26175.test
Normal file
@ -0,0 +1,27 @@
|
||||
--source include/galera_cluster.inc
|
||||
--source include/have_innodb.inc
|
||||
|
||||
#
|
||||
# MDEV-26175 : Assertion `! thd->in_sub_stmt' failed in bool trans_rollback_stmt(THD*)
|
||||
#
|
||||
--connection node_1
|
||||
SET sql_mode="no_zero_date";
|
||||
SET GLOBAL wsrep_max_ws_rows=1;
|
||||
CREATE TABLE t2 (a INT);
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY) ENGINE=InnoDB;
|
||||
CREATE TRIGGER tgr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES (0);
|
||||
|
||||
--error ER_ERROR_DURING_COMMIT
|
||||
INSERT INTO t1 VALUES (0),(1);
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--connection node_2
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
|
||||
--connection node_1
|
||||
SET sql_mode=DEFAULT;
|
||||
SET GLOBAL wsrep_max_ws_rows=DEFAULT;
|
||||
DROP TRIGGER tgr;
|
||||
DROP TABLE t1, t2;
|
@ -6618,7 +6618,13 @@ static int wsrep_after_row(THD *thd)
|
||||
wsrep_thd_is_local(thd) &&
|
||||
thd->wsrep_affected_rows > wsrep_max_ws_rows)
|
||||
{
|
||||
trans_rollback_stmt(thd) || trans_rollback(thd);
|
||||
/*
|
||||
If we are inside stored function or trigger we should not commit or
|
||||
rollback current statement transaction. See comment in ha_commit_trans()
|
||||
call for more information.
|
||||
*/
|
||||
if (!thd->in_sub_stmt)
|
||||
trans_rollback_stmt(thd) || trans_rollback(thd);
|
||||
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
|
||||
DBUG_RETURN(ER_ERROR_DURING_COMMIT);
|
||||
}
|
||||
|
Reference in New Issue
Block a user