Commit 3cf7353
committed
MDEV-38140: InnoDB index corruption after UPDATE affecting virtual
columns
Issue:
- Purge thread attempts to purge a secondary index record that is not
delete-marked.
Root Cause:
- When a secondary index includes a virtual column whose v_pos is
greater than the number of fields in the clustered index record, the
virtual column is incorrectly skipped while reading from the undo
record.
- This leads the purge logic to incorrectly assume it is safe to purge
the secondary index record.
- The code also confuses the nth virtual column with the nth stored
column when writing ordering columns at the end of the undo record.
Fix:
- In trx_undo_update_rec_get_update(): Skip a virtual column only
when v_pos == FIL_NULL, not when v_pos is greater than the number
of fields.
- In trx_undo_page_report_modify(): Ensure ordering columns are
written based on the correct stored-column positions, without
confusing them with virtual-column positions.1 parent d0ae38c commit 3cf7353
File tree
3 files changed
+46
-3
lines changed- mysql-test/suite/innodb
- r
- t
- storage/innobase/trx
3 files changed
+46
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1222 | 1222 | | |
1223 | 1223 | | |
1224 | 1224 | | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1225 | 1229 | | |
1226 | | - | |
1227 | | - | |
| 1230 | + | |
1228 | 1231 | | |
1229 | 1232 | | |
1230 | 1233 | | |
| |||
1524 | 1527 | | |
1525 | 1528 | | |
1526 | 1529 | | |
1527 | | - | |
| 1530 | + | |
1528 | 1531 | | |
1529 | 1532 | | |
1530 | 1533 | | |
| |||
0 commit comments