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

btr_cur_open_at_index_side() is missing some consistency checks

    XMLWordPrintable

    Details

      Description

      In MDEV-13542, many sources of crash on a corrupted page were fixed, but something in the function btr_cur_open_at_index_side() was missed.

      		if (height == ULINT_UNDEFINED) {
      			/* We are in the root node */
       
      			height = btr_page_get_level(page);
      			ut_a(height >= level);
      

      This assertion could fail if a nonzero parameter level was supplied to the function. That is only the case when the inline wrapper function btr_pcur_open_at_index_side() is invoked with level>0, which in turn is only possible in the following functions, related to InnoDB persistent statistics:

      • dict_stats_analyze_index_level()
      • dict_stats_analyze_index_for_n_prefix()

      It would seem to make sense to remove the parameter level from the normal functions, and to write a special function that would be used when computing persistent statistics.

      Furthermore, btr_cur_open_at_index_side() currently fails to return DB_CORRUPTION on PAGE_LEVEL mismatch or when from_left ? !page_has_prev(page) : !page_has_next(page) does not hold.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.