1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-13051 MySQL#86607 InnoDB crash after failed ADD INDEX and table_definition_cache eviction

There are two bugs related to failed ADD INDEX and
the InnoDB table cache eviction.

dict_table_close(): Try dropping failed ADD INDEX when releasing
the last table handle, not when releasing the last-but-one.

dict_table_remove_from_cache_low(): Do not invoke
row_merge_drop_indexes() after freeing all index metadata.
Instead, directly invoke row_merge_drop_indexes_dict() to
remove the metadata from the persistent data dictionary
and to free the index pages.
This commit is contained in:
Marko Mäkelä
2017-10-16 12:06:43 +03:00
parent b9418ed333
commit 1eee3a3fb7
4 changed files with 97 additions and 30 deletions

View File

@ -0,0 +1,16 @@
SET @save_tdc= @@GLOBAL.table_definition_cache;
SET @save_toc= @@GLOBAL.table_open_cache;
SET GLOBAL table_definition_cache= 400;
SET GLOBAL table_open_cache= 1024;
CREATE TABLE to_be_evicted(a INT PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB;
INSERT INTO to_be_evicted VALUES(1,2),(2,1);
SET DEBUG_SYNC = 'row_log_apply_before SIGNAL scanned WAIT_FOR got_duplicate';
ALTER TABLE to_be_evicted ADD UNIQUE INDEX(b);
SET DEBUG_SYNC = 'now WAIT_FOR scanned';
BEGIN;
INSERT INTO to_be_evicted VALUES(3, 2);
SET DEBUG_SYNC = 'now SIGNAL got_duplicate';
ERROR 23000: Duplicate entry '2' for key 'b'
COMMIT;
SET DEBUG_SYNC = RESET;
FLUSH TABLES;