forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit80d5e3a
committed
amcheck: Tighten up validation of redirect line pointers.
Commitbbc1376 added a new lp_valid[]array which records whether or not a line pointer was thought to bevalid, but entries could sometimes get set to true in cases where thatwasn't actually safe. Fix that.Suppose A is a redirect line pointer and B is the other line pointerto which it points. The old code could mishandle this situation in acouple of different ways. First, if B was unused, we'd complain aboutcorruption but still set lp_valid[A] = true, causing later codeto try to access the B as if it were pointing to a tuple. Second,if B was dead, we wouldn't complain about corruption at all, which isan oversight, and would also set lp_valid[A] = true, which wouldagain confuse later code. Fix all that.In the case where B is a redirect, the old code was correct, butrefactor things a bit anyway so that all of these cases are handledmore symmetrically. Also add an Assert() and some comments.Andres Freund and Robert HaasDiscussion:http://postgr.es/m/20230323172607.y3lejpntjnuis5vv%40awork3.anarazel.de1 parent5a91c79 commit80d5e3a
1 file changed
+31
-9
lines changedLines changed: 31 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
481 | 481 |
| |
482 | 482 |
| |
483 | 483 |
| |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
484 | 491 |
| |
485 | 492 |
| |
| 493 | + | |
486 | 494 |
| |
487 |
| - | |
| 495 | + | |
488 | 496 |
| |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
489 | 513 |
| |
490 | 514 |
| |
491 | 515 |
| |
| |||
584 | 608 |
| |
585 | 609 |
| |
586 | 610 |
| |
587 |
| - | |
588 |
| - | |
589 |
| - | |
590 |
| - | |
591 |
| - | |
592 |
| - | |
593 |
| - | |
594 |
| - | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
595 | 617 |
| |
596 | 618 |
| |
597 | 619 |
| |
|
0 commit comments
Comments
(0)