BINLOG with LOCK TABLES and SAVEPOINT could cause a crash in debug bin
MDEV-22048 Assertion `binlog_table_maps == 0 || locked_tables_mode == LTM_LOCK_TABLES' failed in THD::reset_for_next_command
This commit is contained in:
parent
6a3b581b90
commit
654b593149
11
mysql-test/suite/binlog/r/binlog_mixed.result
Normal file
11
mysql-test/suite/binlog/r/binlog_mixed.result
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 (a) VALUES (1),(2);
|
||||||
|
CREATE TABLE t2 (b INT) ENGINE=InnoDB;
|
||||||
|
CREATE TRIGGER tr1 BEFORE UPDATE ON t1 FOR EACH ROW SET @a = 0;
|
||||||
|
CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM t1 LIMIT 1;
|
||||||
|
SET AUTOCOMMIT= OFF;
|
||||||
|
LOCK TABLES t2 WRITE;
|
||||||
|
DELETE FROM t1 LIMIT 1;
|
||||||
|
SAVEPOINT A;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP TABLE t1, t2;
|
23
mysql-test/suite/binlog/t/binlog_mixed.test
Normal file
23
mysql-test/suite/binlog/t/binlog_mixed.test
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
--source include/have_innodb.inc
|
||||||
|
--source include/have_binlog_format_mixed_or_row.inc
|
||||||
|
|
||||||
|
#
|
||||||
|
# MDEV-22048 Assertion `binlog_table_maps == 0 ||
|
||||||
|
# locked_tables_mode == LTM_LOCK_TABLES' failed in
|
||||||
|
# THD::reset_for_next_command
|
||||||
|
#
|
||||||
|
|
||||||
|
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
|
||||||
|
INSERT INTO t1 (a) VALUES (1),(2);
|
||||||
|
|
||||||
|
CREATE TABLE t2 (b INT) ENGINE=InnoDB;
|
||||||
|
|
||||||
|
CREATE TRIGGER tr1 BEFORE UPDATE ON t1 FOR EACH ROW SET @a = 0;
|
||||||
|
CREATE TRIGGER tr2 BEFORE INSERT ON t2 FOR EACH ROW DELETE FROM t1 LIMIT 1;
|
||||||
|
|
||||||
|
SET AUTOCOMMIT= OFF;
|
||||||
|
LOCK TABLES t2 WRITE;
|
||||||
|
DELETE FROM t1 LIMIT 1;
|
||||||
|
SAVEPOINT A;
|
||||||
|
UNLOCK TABLES;
|
||||||
|
DROP TABLE t1, t2;
|
@ -5045,6 +5045,7 @@ mysql_execute_command(THD *thd)
|
|||||||
res= 1;
|
res= 1;
|
||||||
thd->mdl_context.release_transactional_locks();
|
thd->mdl_context.release_transactional_locks();
|
||||||
thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
|
thd->variables.option_bits&= ~(OPTION_TABLE_LOCK);
|
||||||
|
thd->reset_binlog_for_next_statement();
|
||||||
}
|
}
|
||||||
if (thd->global_read_lock.is_acquired() &&
|
if (thd->global_read_lock.is_acquired() &&
|
||||||
thd->current_backup_stage == BACKUP_FINISHED)
|
thd->current_backup_stage == BACKUP_FINISHED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user