forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite88754a
committed
amcheck: Fix verify_heapam for tuples where xmin or xmax is 0.
In such cases, get_xid_status() doesn't set its output parameter (thethird argument), so we shouldn't fall through to code which will testthe value of that parameter. There are five existing calls toget_xid_status(), three of which seem to already handle this caseproperly. This commit tries to fix the other two.If we're checking xmin and find that it is invalid (i.e. 0) justreport that as corruption, similar to what's already done in thethree cases that seem correct. If we're checking xmax and findthat's invalid, that's fine: it just means that the tuple hasn'tbeen updated or deleted.Thanks to Andres Freund and valgrind for finding this problem, andalso to Andres for having a look at the patch. This bug seems to goall the way back to where verify_heapam was first introduced, butwasn't detected until recently, possibly because of the new test casesadded for update chain verification. Back-patch to v14, where thiscode showed up.Discussion:http://postgr.es/m/CA+TgmoZAYzQZqyUparXy_ks3OEOfLD9-bEXt8N-2tS1qghX9gQ@mail.gmail.com1 parenta04761a commite88754a
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1012 | 1012 |
| |
1013 | 1013 |
| |
1014 | 1014 |
| |
1015 |
| - | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
1016 | 1018 |
| |
1017 | 1019 |
| |
1018 | 1020 |
| |
| |||
1350 | 1352 |
| |
1351 | 1353 |
| |
1352 | 1354 |
| |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
1353 | 1358 |
| |
1354 | 1359 |
| |
1355 | 1360 |
| |
| |||
1372 | 1377 |
| |
1373 | 1378 |
| |
1374 | 1379 |
| |
1375 |
| - | |
1376 | 1380 |
| |
1377 | 1381 |
| |
1378 | 1382 |
| |
|
0 commit comments
Comments
(0)