[MDEV-32190] Index corruption with unique key and nopad collation (without DESC or HASH keys) Created: 2023-09-17 Updated: 2023-12-12 |
|
| Status: | Confirmed |
| Project: | MariaDB Server |
| Component/s: | Character Sets, Storage Engine - InnoDB |
| Affects Version/s: | 10.5, 10.6, 10.10, 10.11, 11.0, 11.1, 11.2 |
| Fix Version/s: | 10.5, 10.6, 10.11, 11.0, 11.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Or without CHECK:
|
| Comments |
| Comment by Elena Stepanova [ 2023-09-17 ] |
|
Assigned to InnoDB by tradition, even though it will be likely reassigned to the core. I think there were previous nopad-related issues with the explanation why they aren't an InnoDB problem, but I can't find them. |
| Comment by Marko Mäkelä [ 2023-09-17 ] |
|
This looks like a simpler version of the test case in MDEV-28328, with a shorter column prefix in the PRIMARY KEY, and using a different NOPAD collation. |
| Comment by Elena Stepanova [ 2023-09-17 ] |
|
Thanks, that's the one (or one of) I was thinking of but couldn't find. |
| Comment by Marko Mäkelä [ 2023-09-18 ] |
|
I debugged the test case in 10.6 0f870914d410e8a34ea99b1e0ea7eb71094606f9. At the time row_check_index()} reports the error, both the secondary index and the clustered index comprise of a single page each, each of them containing 14 records. The format of the secondary index records (page 4) is (id,b(2)). The records are exactly like in the INSERT statement, in the same order, and using the same length of b(2). The format of the clustered index records (page 3) is (b(2),id,DB_TRX_ID,DB_ROLL_PTR,b). All records carry DB_TRX_ID=0x14 and a DB_ROLL_PTR whose most significant bit is set, denoting a fresh insert. They could also be DB_TRX_ID=0, DB_ROLL_PTR=1<<55 in case the purge of committed history had been completed. In the clustered index, the order of records starts as follows: It looks wrong to me that the empty string is not being sorted consistently. |