mirror of
https://github.com/MariaDB/server.git
synced 2026-10-23 18:49:29 +03:00
A locking read on a SPATIAL INDEX collects the matching records into a shadow block matched_rec_t::block. sel_set_rtr_rec_lock() holds page.lock on that block while it locks the records, because lock_rec_lock() asserts that the block of the record being locked is latched. If a lock request has to wait, the records are collected again after the wait, and rtr_init_match() re-initializes the block by buf_page_t::init(), which asserts that the block is not latched. The assertion is about a latch that would be a leftover from the previous identity of the block. It does not apply to rtr_init_match(), where the block is in buf_page_t::MEMORY state, private to the current thread, which is holding page.lock on it on purpose. Changes: - buf_page_t::init(): Tolerate a latch that the current thread is holding on a block that is being initialized in buf_page_t::MEMORY state.