[MDEV-17765] lock_discard_page() may fail to discard locks for SPATIAL INDEX Created: 2018-11-19  Updated: 2018-11-20  Resolved: 2018-11-19

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2.2, 10.3.0, 10.4.0
Fix Version/s: 10.4.1, 10.2.20, 10.3.12

Type: Bug Priority: Major
Reporter: Marko Mäkelä Assignee: Marko Mäkelä
Resolution: Fixed Votes: 0
Labels: GIS, lock


 Description   

The function lock_update_discard() starts with an incorrect check:

	if (!lock_rec_get_first_on_page(lock_sys->rec_hash, block)
	    && (!lock_rec_get_first_on_page(lock_sys->prdt_hash, block))) {
		/* No locks exist on page, nothing to do */

This fails to account for lock_sys->prdt_page_hash. If such locks exist on the page, they will not be discarded.

Also, the function is unnecessarily traversing both B-tree record locks and predicate locks for the same pages. Predicate locks exist only on spatial index pages, and B-tree record locks only exist on B-tree index pages.



 Comments   
Comment by Marko Mäkelä [ 2018-11-19 ]

This was motivated by this commit in MySQL 8.0.13.

Generated at Thu Feb 08 08:38:56 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.