-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters