mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
00d2c7f7f4
- During XA PREPARE, InnoDB releases the non-exclusive locks. But it fails to remove the non-exclusive table lock from the transaction table locks. In the mean time, main thread evicts the table from the LRU cache. While rollbacking the XA transaction, InnoDB iterates through the table locks to check whether it holds lock on any system tables and wrongly assumes the evicted table as system table since the table id is 0 Fix: === During XA PREPARE, remove the table locks of the transaction while releasing the non-exclusive locks.
23 lines
664 B
Text
23 lines
664 B
Text
#
|
|
# MDEV-34542 Assertion `lock_trx_has_sys_table_locks(trx) == __null'
|
|
# failed in void row_mysql_unfreeze_data_dictionary(trx_t*)
|
|
#
|
|
#
|
|
CREATE TABLE t1 (c1 CHAR(1) ,c2 INT) ENGINE=INNODB
|
|
PARTITION BY LINEAR HASH ((c2)) PARTITIONS 512;
|
|
CREATE TABLE t2 (a INT) ENGINE=INNODB;
|
|
set @old_table_open_cache= @@table_open_cache;
|
|
XA START 'a';
|
|
INSERT INTO mysql.innodb_index_stats SELECT * FROM mysql.innodb_index_stats WHERE table_name='';
|
|
SET GLOBAL table_open_cache=10;
|
|
INSERT into t2 (a) VALUES (1);
|
|
SELECT * FROM t1;
|
|
c1 c2
|
|
XA END 'a';
|
|
XA PREPARE 'a';
|
|
SELECT sleep(3);
|
|
sleep(3)
|
|
0
|
|
XA ROLLBACK 'a';
|
|
DROP TABLE t1, t2;
|
|
SET GLOBAL table_open_cache=@old_table_open_cache;
|