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

CHECK TABLE attempts to access parent_right_page_no=FIL_NULL

    XMLWordPrintable

    Details

      Description

      While debugging MDEV-23304, I encountered crashes in CHECK TABLE. As a result of the bug, the parent page (root page of the clustered index) would miss many node pointers to child pages, but the child pages would be reachable from each other via the doubly linked list formed by FIL_PAGE_NEXT and FIL_PAGE_PREV. The command crashed, because it was attempting to access parent_right_page_no, which was still FIL_NULL. For parent_page_no, we do have an appropriate condition:

      			} else if (parent_page_no != FIL_NULL) {
      				btr_block_get(
      					page_id_t(index->space,
      						  parent_page_no),
      					table_page_size,
      					RW_SX_LATCH, index, &mtr);
      

      The problematic code was added in the merge of WL#6326 to MySQL 5.7.2 and later imported to MariaDB 10.2.2.

        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: