Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-17765

lock_discard_page() may fail to discard locks for SPATIAL INDEX

    XMLWordPrintable

    Details

      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.

        Attachments

          Activity

            People

            Assignee:
            marko Marko Mäkelä
            Reporter:
            marko Marko Mäkelä
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: