mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
2ca1123464
This follows up the previous fix in commitc3c53926c4
(MDEV-26554). ha_innobase::delete_table(): Work around the insufficient metadata locking (MDL) during DML operations by acquiring exclusive InnoDB table locks on all child tables. Previously, this was only done on TRUNCATE and ALTER. ibuf_delete_rec(), btr_cur_optimistic_delete(): Do not invoke lock_update_delete() during change buffer operations. The revised trx_t::commit(std::vector<pfs_os_file_t>&) will hold exclusive lock_sys.latch while invoking fil_delete_tablespace(), which in turn may invoke ibuf_delete_rec(). dict_index_t::has_locking(): A new predicate, replacing the dummy !dict_table_is_locking_disabled(index->table). Used for skipping lock operations during ibuf_delete_rec(). trx_t::commit(std::vector<pfs_os_file_t>&): Release the locks and remove the table from the cache while holding exclusive lock_sys.latch. trx_t::commit_in_memory(): Skip release_locks() if dict_operation holds. trx_t::commit(): Reset dict_operation before invoking commit_in_memory() via commit_persist(). lock_release_on_drop(): Release locks while lock_sys.latch is exclusively locked. lock_table(): Add a parameter for a pointer to the table. We must not dereference the table before a lock_sys.latch has been acquired. If the pointer to the table does not match the table at that point, the table is invalid and DB_DEADLOCK will be returned. row_ins_foreign_check_on_constraint(): Improve the checks. Remove a bogus DB_LOCK_WAIT_TIMEOUT return that was needed before commitc5fd9aa562
(MDEV-25919). row_upd_check_references_constraints(), wsrep_row_upd_check_foreign_constraints(): Simplify checks.
24 lines
587 B
Text
24 lines
587 B
Text
--source include/have_innodb.inc
|
|
--source include/have_debug.inc
|
|
--source include/have_debug_sync.inc
|
|
|
|
CREATE TABLE t1 (a INT NOT NULL) ENGINE=InnoDB STATS_PERSISTENT=0;
|
|
|
|
connect ddl,localhost,root;
|
|
SET DEBUG_SYNC='after_trx_committed_in_memory SIGNAL stuck WAIT_FOR ever';
|
|
send ALTER TABLE t1 ADD PRIMARY KEY(a);
|
|
|
|
connection default;
|
|
SET DEBUG_SYNC='now WAIT_FOR stuck';
|
|
|
|
SET GLOBAL innodb_log_checkpoint_now=ON;
|
|
|
|
--let $shutdown_timeout=0
|
|
--source include/restart_mysqld.inc
|
|
|
|
disconnect ddl;
|
|
|
|
SHOW CREATE TABLE t1;
|
|
SELECT * FROM t1;
|
|
DROP TABLE t1;
|
|
--source include/wait_all_purged.inc
|