[MDEV-27439] AUTO_INCREMENT columns with DESC index do not work Created: 2022-01-07  Updated: 2022-01-26  Resolved: 2022-01-07

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: None
Fix Version/s: 10.8.1

Type: Bug Priority: Critical
Reporter: Marko Mäkelä Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: crash

Attachments: File autoinc_persist.patch    
Issue Links:
Problem/Incident
is caused by MDEV-13756 Implement descending index: KEY (a DE... Closed

 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.


Generated at Thu Feb 08 09:52:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.