Re: Split-up ECPG patches

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Michael Meskes <meskes(at)postgresql(dot)org>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, hs(at)cybertec(dot)at
Subject: Re: Split-up ECPG patches
Date: 2009-08-17 09:31:00
Message-ID: 4A892354.8010502@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Michael Meskes írta:
> On Sun, Aug 16, 2009 at 05:59:46PM +0200, Boszormenyi Zoltan wrote:
>
>>> What heppens if the sqlda is incompatible?
>>>
>> Returns false?
>>
>
> I wasn't talking about this one function but about the flow of the resulting
> program. How can it happen that sqlda is incompatible and what happens then?
>

Hm. The following may occur. One may pass the same
sqlda ptr to two different cursors in DECLARE or FETCH
in the same loop. In this case it's wrong to not process the
"incompatible" call. Modified patch is attached:
- fixed flow, frees up the "incompatible" sqlda and creates a new one
- added ecpg_log() calls
- no more realloc(), an "empty" sqlda is allocated for full size.
realloc() can destroy internal pointers (like the ones pointing to
field names and ->sqlvar.)

The previous pg85-describe-5-ctxdiff.patch still applies cleanly.

Best regards,
Zoltán Böszörményi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

Attachment Content-Type Size
pg85-sqlda-7-ctxdiff.patch text/x-patch 66.0 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-08-17 10:50:55 Re: hot standby - merged up to CVS HEAD
Previous Message ning 2009-08-17 09:26:09 memory free of constantly changed function