[MDEV-16065] Assertion `!cmp_rec_rec(cursor->old_rec, rec, offsets1, offsets2, index)' failed in btr_pcur_restore_position_func on UPDATE Created: 2018-04-30 Updated: 2018-05-02 Resolved: 2018-05-02 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table, Storage Engine - InnoDB |
| Affects Version/s: | 10.3 |
| Fix Version/s: | 10.3.7 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Issue Links: |
|
||||||||
| Description |
|
It appears to be a regression from this commit
|
| Comments |
| Comment by Marko Mäkelä [ 2018-05-02 ] | ||||||||||||||||||||
|
I can repeat this. All the ALTER TABLE only serve to add NOT NULL constraints to the columns. Here is a simpler version of the test:
The INSERT can be moved right before the ADD COLUMN, and the bug will still reproduce. The table contents is as follows: The successor of the page infimum is a default row record starting at 0xa2, containing dummy values for the hard-coded columns: (f4='',f3=0,DB_TRX_ID,DB_ROLL_PTR,f1=0,f2=0). Its successor is the only user-visible record, whose successor is the page supremum. The user-visible record starts at 0xc3 and has the following contents:
The offsets1, which is built for the copied prefix cursor->old_rec, shows the wrong field end offsets (0 and 4) instead of the correct ones (3 and 7), which are in offsets2. Both cursor->old_rec and rec contain the 7 bytes 'foo',0x80000003 corresponding to the key values ('foo',3). The offsets1 are obviously wrong. When computing the offsets, btr_pcur_restore_position() is looking for the length bytes at the wrong place:
The status bits at rec[-3] & 7 are as they should be for these records: The bug is that in cursor->old_rec, the | ||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-05-02 ] | ||||||||||||||||||||
|
For the record: 1+1 columns should be enough to reproduce (I used 2+1 in the test):
|