Re: libpq, PQExecParams and the inserting of binary data

Поиск
Список
Период
Сортировка
От Volkan YAZICI
Тема Re: libpq, PQExecParams and the inserting of binary data
Дата
Msg-id 7104a737050604065267a108b@mail.gmail.com
обсуждение исходный текст
Ответ на Re: libpq, PQExecParams and the inserting of binary data  ("Daniel Verite" <daniel@manitou-mail.org>)
Ответы Re: libpq, PQExecParams and the inserting of binary data
Список pgsql-interfaces
Hi,

On 6/4/05, Daniel Verite <daniel@manitou-mail.org> wrote:
> Are you passing a NULL pointer in paramLengths? You need to
> pass an array containing the actual length of your binary data.

Yes, paramLengthts is a NULL pointer. But, is SegFault an expected result?

Himms... When I take a look at src/interfaces/libpq/fe-exec.c:

956 if (paramValues && paramValues[i])
957 {
958     int         nbytes;
960     if (paramFormats && paramFormats[i] != 0)
961     {
962         /* binary parameter */
963         nbytes = paramLengths[i];

It appears to be SegFault was caused by paramLengths[i] on line 963.
So, this means, user _has_to_ specify the size of input while using
binary data. Maybe a "if ( paramLengths )" check can be useful.

Regards.


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

Предыдущее
От: "Daniel Verite"
Дата:
Сообщение: Re: libpq, PQExecParams and the inserting of binary data
Следующее
От: Tom Lane
Дата:
Сообщение: Re: libpq, PQExecParams and the inserting of binary data