forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9a10945
committed
Fix bugs in contrib/pg_visibility.
collect_corrupt_items() failed to initialize tuple.t_self. WhileHeapTupleSatisfiesVacuum() doesn't actually use that value, it doesAssert that it's valid, so that the code would dump core if ip_posidchanced to be zero. (That's somewhat unlikely, which probably explainshow this got missed. In any case it wouldn't matter for field use.)Also, collect_corrupt_items was returning the wrong TIDs, that is thecontents of t_ctid rather than the tuple's own location. This wouldbe the same thing in simple cases, but it could be wrong if, forexample, a past update attempt had been rolled back, leaving a livetuple whose t_ctid doesn't point at itself.Also, in pg_visibility(), guard against trying to read a page pastthe end of the rel. The VM code handles inquiries beyond the endof the map by silently returning zeroes, and it seems like we shoulddo the same thing here.I ran into the assertion failure while using pg_visibility to checkpg_upgrade's behavior, and then noted the other problems whilereading the code.Report: <29043.1475288648@sss.pgh.pa.us>1 parent33596ed commit9a10945
1 file changed
+26
-12
lines changedLines changed: 26 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| 6 | + | |
| 7 | + | |
6 | 8 |
| |
7 | 9 |
| |
8 | 10 |
| |
| |||
54 | 56 |
| |
55 | 57 |
| |
56 | 58 |
| |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
57 | 63 |
| |
58 | 64 |
| |
59 | 65 |
| |
| |||
122 | 128 |
| |
123 | 129 |
| |
124 | 130 |
| |
125 |
| - | |
126 |
| - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
127 | 136 |
| |
128 |
| - | |
129 |
| - | |
| 137 | + | |
| 138 | + | |
130 | 139 |
| |
131 |
| - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
132 | 147 |
| |
133 | 148 |
| |
134 | 149 |
| |
| |||
611 | 626 |
| |
612 | 627 |
| |
613 | 628 |
| |
614 |
| - | |
615 |
| - | |
616 |
| - | |
617 |
| - | |
| 629 | + | |
| 630 | + | |
618 | 631 |
| |
619 | 632 |
| |
620 | 633 |
| |
621 | 634 |
| |
| 635 | + | |
622 | 636 |
| |
623 | 637 |
| |
624 | 638 |
| |
| |||
649 | 663 |
| |
650 | 664 |
| |
651 | 665 |
| |
652 |
| - | |
| 666 | + | |
653 | 667 |
| |
654 | 668 |
| |
655 | 669 |
| |
656 | 670 |
| |
657 |
| - | |
| 671 | + | |
658 | 672 |
| |
659 | 673 |
| |
660 | 674 |
| |
| |||
665 | 679 |
| |
666 | 680 |
| |
667 | 681 |
| |
668 |
| - | |
| 682 | + | |
669 | 683 |
| |
670 | 684 |
| |
671 | 685 |
| |
|
0 commit comments
Comments
(0)