mariadb/mysql-test/suite/innodb/r/stats_persistent.result
Thirunarayanan Balathandayuthapani dac3d702f7 MDEV-36649 dict_acquire_mdl_shared() aborts when table mode is DICT_TABLE_OP_OPEN_ONLY_IF_CACHED
- InnoDB fails to check the table is being dropped or evicted
while acquiring the MDL for the table when table open operation
mode is DICT_TABLE_OP_OPEN_ONLY_IF_CACHED. This is caused by
the commit 337bf8ac4b (MDEV-36122)

Fix:
===
dict_acquire_mdl_shared(): If the table is evicted or dropped when
table operation mode is DICT_TABLE_OP_OPEN_IF_CACHED then return
nullptr
2025-04-22 15:17:29 +05:30

29 lines
1 KiB
Text

#
# MDEV-23991 dict_table_stats_lock() has unnecessarily long scope
#
CREATE TABLE t1(a INT) ENGINE=INNODB STATS_PERSISTENT=1;
SET DEBUG_SYNC='dict_stats_update_persistent SIGNAL stop WAIT_FOR go';
ANALYZE TABLE t1;
connect con1, localhost, root;
SET DEBUG_SYNC='now WAIT_FOR stop';
SELECT SUM(DATA_LENGTH+INDEX_LENGTH) FROM information_schema.TABLES WHERE ENGINE='InnoDB';
SUM(DATA_LENGTH+INDEX_LENGTH)
SUM
SET DEBUG_SYNC='now SIGNAL go';
disconnect con1;
connection default;
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
#
# MDEV-36649 dict_acquire_mdl_shared() aborts when table
# mode is DICT_TABLE_OP_OPEN_ONLY_IF_CACHED
#
set @old_defragment_stats_accuracy= @@innodb_defragment_stats_accuracy;
SET GLOBAL innodb_defragment_stats_accuracy=1;
CREATE TABLE t (a INT ) ENGINE=INNODB;
INSERT INTO t SELECT * FROM seq_1_to_1000;
DROP TABLE t;
set global innodb_defragment_stats_accuracy= @old_defragment_stats_accuracy;