Change inv_truncate() to not repeat its systable_getnext_ordered() scan.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jan 2011 00:33:50 +0000 (19:33 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Jan 2011 00:33:50 +0000 (19:33 -0500)
commit7ab6f2da23516e48174f3f144ee9ef19bdc287fb
tree82a5dcd267ec5a31a6df93585a4ea780a508b655
parent8b6f5f25102f9e2503ce18af77b6fd547a2192ca
Change inv_truncate() to not repeat its systable_getnext_ordered() scan.

In the case where the initial call of systable_getnext_ordered() returned
NULL, this function would nonetheless call it again.  That's undefined
behavior that only by chance failed to not give visibly incorrect results.
Put an if-test around the final loop to prevent that, and in passing
improve some comments.  No back-patch since there's no actual failure.

Per report from YAMAMOTO Takashi.
src/backend/storage/large_object/inv_api.c