Re: Error in PQsetvalue

Поиск
Список
Период
Сортировка
От Andrew Chernow
Тема Re: Error in PQsetvalue
Дата
Msg-id 4DE93ED7.4000407@esilo.com
обсуждение исходный текст
Ответ на Error in PQsetvalue  (Pavel Golub <pavel@microolap.com>)
Ответы Re: Error in PQsetvalue
Re: Error in PQsetvalue
Список pgsql-hackers
On 6/3/2011 3:03 PM, Pavel Golub wrote:
> Hello.
>
> Reproduced under Windows XP SP3 using Visual C++ 2008 and Delphi. If
> PQsetvalue is called with second parameter equals to PQntuples then
> memory corruption appears. But it should grow internal tuples array
> and populate the last item with provided data. Please see the code:
>
>

At first glance (have not tested this theory), looks like pqAddTuple() 
doesn't zero the newly allocated tuples slots like PQsetvalue() does. 
PQsetvalue is depending on the unassigned tuple table slots to be NULL 
to detect when a tuple must be allocated.  Around line 446 on fe-exec.c.  I never tested this case since libpqtypes
nevertried to call 
 
PQsetvalue on a PGresult created by the standard libpq library.

The solution I see would be to zero the new table slots within 
pqAddTuple.  Any other ideas?

-- 
Andrew Chernow
eSilo, LLC
global backup
http://www.esilo.com/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Domains versus polymorphic functions, redux
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Error in PQsetvalue