pgsql: Change inv_truncate() to not repeat its systable_getnext_ordered

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Change inv_truncate() to not repeat its systable_getnext_ordered
Date: 2011-01-27 00:34:38
Message-ID: E1PiFos-0003u1-IC@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=7ab6f2da23516e48174f3f144ee9ef19bdc287fb

Modified Files
--------------
src/backend/storage/large_object/inv_api.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2011-01-27 00:55:12 pgsql: Restructure streaming docs so streaming seems more integrated in
Previous Message Tom Lane 2011-01-26 23:40:51 Re: Re: [COMMITTERS] pgsql: Get rid of the global variable holding the error state