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

AUTO_INCREMENT columns with DESC index do not work

    XMLWordPrintable

    Details

      Description

      The function row_search_get_max_rec() needs to be adjusted to take descending indexes into account:

      preview-10.8-MDEV-13756-desc-indexes 43444ff5d2a8d06460adea027993cfb6df45c7b9

      innodb.autoinc_persist 'desc,innodb'     [ fail ]
              Test ended at 2022-01-07 15:09:42
       
      CURRENT_TEST: innodb.autoinc_persist
      mysqltest: In included file "./suite/innodb/include/autoinc_persist_alter.inc": 
      included from /mariadb/10.8m/mysql-test/suite/innodb/t/autoinc_persist.test at line 449:
      At line 27: query 'ALTER TABLE $table AUTO_INCREMENT = 180, ALGORITHM = $algorithm' failed: <Unknown> (2013): Lost connection to server during query
      mariadbd: /mariadb/10.8m/storage/innobase/row/row0sel.cc:6144: const rec_t* row_search_get_max_rec(dict_index_t*, mtr_t*): Assertion `!rec || !(rec_get_info_bits(rec, (index->table)->not_redundant()) & (0x10UL | 0x20UL))' failed.
      #8  0x000055d705783009 in row_search_get_max_rec (index=index@entry=0x7f7e9895e0c8, mtr=mtr@entry=0x7f7f38855430) at /mariadb/10.8m/storage/innobase/row/row0sel.cc:6144
      #9  0x000055d7057846ac in row_search_max_autoinc (index=index@entry=0x7f7e9895e0c8) at /mariadb/10.8m/storage/innobase/row/row0sel.cc:6164
      #10 0x000055d7055f4548 in commit_set_autoinc (ha_alter_info=ha_alter_info@entry=0x7f7f38856390, ctx=ctx@entry=0x7f7e98018260, altered_table=altered_table@entry=0x7f7f38856450, old_table=<optimized out>) at /mariadb/10.8m/storage/innobase/handler/handler0alter.cc:9546
      

      This can be repeated by applying the attached patch to the test case.

      Note: The correctness of the desc combination of that test case has not been checked.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              thiru Thirunarayanan Balathandayuthapani
              Reporter:
              marko Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.