Commit 386ac12a authored by mkaruza's avatar mkaruza Committed by Jan Lindström

MDEV-25740 Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command ==...

MDEV-25740 Assertion `!wsrep_has_changes(thd) || (thd->lex->sql_command == SQLCOM_CREATE_TABLE && !thd->is_current_stmt_binlog_format_row())' failed in void wsrep_commit_empty(THD*, bool)

Using ROLLBACK with `completion_type = CHAIN` result in start of
transaction and implicit commit before previous WSREP internal data is
cleared.
Reviewed-by: default avatarJan Lindström <jan.lindstrom@mariadb.com>
parent eb26e20d
connection node_2;
connection node_1;
SET AUTOCOMMIT = OFF;
SET completion_type = CHAIN;
CREATE TABLE t1(f1 INT) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
ROLLBACK;
DROP TABLE t1;
#
# When `completion_type = CHAIN` is used, transaction started should not have previous writeset.
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
SET AUTOCOMMIT = OFF;
SET completion_type = CHAIN;
CREATE TABLE t1(f1 INT) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
ROLLBACK;
DROP TABLE t1;
......@@ -5750,6 +5750,11 @@ mysql_execute_command(THD *thd)
/* Begin transaction with the same isolation level. */
if (tx_chain)
{
#ifdef WITH_WSREP
/* If there are pending changes after rollback we should clear them */
if (wsrep_on(thd) && wsrep_has_changes(thd))
wsrep_after_statement(thd);
#endif
if (trans_begin(thd))
goto error;
}
......
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