Re: Error in PQsetvalue

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Pavel Golub <pavel(at)microolap(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Error in PQsetvalue
Date: 2011-06-04 02:26:26
Message-ID: 4DE997D2.7070103@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


>> I disagree -- I think the fix is a one-liner. line 446:
>> if (tup_num == res->ntups&& !res->tuples[tup_num])
>>
>> should just become
>> if (tup_num == res->ntups)
>>
>> also the memset of the tuple slots when the slot array is expanded can
>> be removed. (in addition, the array tuple array expansion should
>> really be abstracted, but that isn't strictly necessary here).
>>
>
> All true. This is a cleaner fix to something that was in fact broken ;) You want

Attached a patch that fixes the OP's issue. PQsetvalue now uses pqAddTuple to
grow the tuple table and has removed the remnants of an older idea that caused
the bug.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

Attachment Content-Type Size
PQsetvalue.patch text/x-patch 1.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Chernow 2011-06-04 02:36:37 Re: Error in PQsetvalue
Previous Message Bruce Momjian 2011-06-04 02:12:10 Re: Remove support for 'userlocks'?