Skip to content

Commit

Permalink
MDEV-22879 SIGSEGV (or hang) in free/my_free
Browse files Browse the repository at this point in the history
This bug was already fixed in a previous commit.
Added test case from the MDEV to prove it's fixed.
  • Loading branch information
montywi committed Oct 29, 2020
1 parent 85613a3 commit eb38e7e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mysql-test/main/backup_locks.result
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,22 @@ connection default;
disconnect con1;
show tables;
Tables_in_test
#
# MDEV-22879 SIGSEGV (or hang) in free/my_free from
# _ma_end_block_record (on optimized builds)
#
SET STATEMENT max_statement_time=20 FOR BACKUP LOCK test.t1;
CREATE TABLE IF NOT EXISTS t3 (c1 CHAR(1) BINARY,c2 SMALLINT(10),c3 NUMERIC(1,0), PRIMARY KEY(c1(1))) ENGINE=InnoDB;
ERROR HY000: Can't execute the query because you have a conflicting read lock
BACKUP UNLOCK;
CREATE TABLE IF NOT EXISTS t3 (c1 CHAR(1) BINARY,c2 SMALLINT(10),c3 NUMERIC(1,0), PRIMARY KEY(c1(1))) ENGINE=InnoDB;
SET STATEMENT max_statement_time=20 FOR BACKUP LOCK test.t1;
LOCK TABLES t3 AS a2 WRITE, t3 AS a1 READ LOCAL;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
DROP TABLE t3;
ERROR HY000: Can't execute the query because you have a conflicting read lock
BACKUP UNLOCK;
DROP TABLE t3;
#
# End of MariaDB 10.4 tests
#
23 changes: 23 additions & 0 deletions mysql-test/main/backup_locks.test
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,26 @@ connection con1;
connection default;
disconnect con1;
show tables;

--echo #
--echo # MDEV-22879 SIGSEGV (or hang) in free/my_free from
--echo # _ma_end_block_record (on optimized builds)
--echo #

SET STATEMENT max_statement_time=20 FOR BACKUP LOCK test.t1;
--error ER_CANT_UPDATE_WITH_READLOCK
CREATE TABLE IF NOT EXISTS t3 (c1 CHAR(1) BINARY,c2 SMALLINT(10),c3 NUMERIC(1,0), PRIMARY KEY(c1(1))) ENGINE=InnoDB;
BACKUP UNLOCK;

CREATE TABLE IF NOT EXISTS t3 (c1 CHAR(1) BINARY,c2 SMALLINT(10),c3 NUMERIC(1,0), PRIMARY KEY(c1(1))) ENGINE=InnoDB;
SET STATEMENT max_statement_time=20 FOR BACKUP LOCK test.t1;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
LOCK TABLES t3 AS a2 WRITE, t3 AS a1 READ LOCAL;
--error ER_CANT_UPDATE_WITH_READLOCK
DROP TABLE t3;
BACKUP UNLOCK;
DROP TABLE t3;

--echo #
--echo # End of MariaDB 10.4 tests
--echo #

0 comments on commit eb38e7e

Please sign in to comment.