[MDEV-13228] Assertion `n < rec_offs_n_fields(offsets)' failed in rec_get_nth_field_offs upon crash recovery with compressed table Created: 2017-07-01 Updated: 2017-07-03 Resolved: 2017-07-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2.7 |
| Fix Version/s: | 10.2.7 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | regression | ||
| Description |
|
Note: It might be just a bad assertion failure, as nothing obviously bad seems to be happening on non-debug build, but it needs to be checked at least.
The problem appeared in 10.2 tree with this revision:
|
| Comments |
| Comment by Elena Stepanova [ 2017-07-01 ] | ||||||||||||||||||||||||
|
ATTN jplindst | ||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-07-03 ] | ||||||||||||||||||||||||
|
Sorry, this was a simple off-by-one error. I think that it should affect debug builds only, because the out-of-bounds access occurred inside a debug assertion:
The fix is simple:
| ||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-07-03 ] | ||||||||||||||||||||||||
|
It would be good if you could add comment why +3 is needed (e.g. in rem/rem0rec.cc: ulint offsets_[REC_OFFS_HEADER_SIZE + MAX_REF_PARTS + 2] | ||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-07-03 ] | ||||||||||||||||||||||||
|
Sorry, I already pushed the patch. Initializing the first pos+2 elements of the offsets allows us to access the clustered index fields DB_TRX_ID (pos) and DB_ROLL_PTR (pos+1). |