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

maria_open() fails with error 126 on a freshly created internal temporary table with keys=0, uniques=1

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.11.19
    • None
    • Storage Engine - Aria
    • None
    • Debian 12, kernel 6.1.0-53-amd64, x86_64. wsrep/Galera enabled (not implicated).
    • Can result in hang or crash

    Description

      Observed once. create_internal_tmp_table created an Aria internal temporary table successfully, and the immediately following maria_open() in open_tmp_table failed:

      [Warning] mariadbd: Got error '126 "Index is corrupted"' for '(null)'
      [ERROR] mariadbd: Can't find record in '(temporary)'

      The (null) table name is consistent with failure inside maria_open before the share is named. The resulting ER_KEY_NOT_FOUND (1032) then drove cleanup, which crashed separately — see MDEV-41294. Table characteristics from the core: keys=0, uniques=1 (hash unique from the converted distinct index), 5 fields, reclength=198, one Field_blob of length 16777215 from GROUP_CONCAT(DISTINCT ...), tmpdir on a dedicated filesystem.

      The offending code seems to be in ha_maria.cc, line 2858 (in 10.11.19):

      void ha_maria::drop_table(const char *name)

      { DBUG_ASSERT(!file || file->s->temporary); file->s->deleting= 1; // Do not flush data (void) ha_close(); (void) maria_delete_table_files(name, 1, MY_WME); }

      The DBUG_ASSERT call is okay with file being NULL, but then it is immediately dereferenced.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              xan@biblionix.com Xan Charbonnet
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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