mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 02:05:57 +01:00
Fix for MDEV-15812 Assert in SEQUENCE when forcing STATEMEMT format
The bug was the we copied the lock type to the underlying engine even when external_lock failed.
This commit is contained in:
parent
529c1a3b6c
commit
0bfd45f634
3 changed files with 24 additions and 1 deletions
5
mysql-test/suite/sql_sequence/replication_drop.result
Normal file
5
mysql-test/suite/sql_sequence/replication_drop.result
Normal file
|
@ -0,0 +1,5 @@
|
|||
CREATE SEQUENCE seq ENGINE=InnoDB;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
INSERT INTO seq VALUES (1,1,100,1,1,1,1,1);
|
||||
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
|
||||
DROP SEQUENCE seq;
|
17
mysql-test/suite/sql_sequence/replication_drop.test
Normal file
17
mysql-test/suite/sql_sequence/replication_drop.test
Normal file
|
@ -0,0 +1,17 @@
|
|||
#
|
||||
# Test for MDEV-15812
|
||||
# Assertion `m_lock_type == 2' failed in
|
||||
# handler::~handler on dropping a sequence after
|
||||
# ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_binlog_format_statement.inc
|
||||
|
||||
CREATE SEQUENCE seq ENGINE=InnoDB;
|
||||
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
|
||||
--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
|
||||
INSERT INTO seq VALUES (1,1,100,1,1,1,1,1);
|
||||
|
||||
# Cleanup
|
||||
DROP SEQUENCE seq;
|
|
@ -322,7 +322,8 @@ int ha_sequence::external_lock(THD *thd, int lock_type)
|
|||
Copy lock flag to satisfy DBUG_ASSERT checks in ha_* functions in
|
||||
handler.cc when we later call it with file->ha_..()
|
||||
*/
|
||||
file->m_lock_type= lock_type;
|
||||
if (!error)
|
||||
file->m_lock_type= lock_type;
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue