Re: BUG #4715: libpq `PQgetlength' return invalid field length.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #4715: libpq `PQgetlength' return invalid field length.
Дата
Msg-id 8381.1237380061@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #4715: libpq `PQgetlength' return invalid field length.  ("VEN" <bsditer@gmail.com>)
Список pgsql-bugs
"VEN" <bsditer@gmail.com> writes:
> Database have below table:
> CREATE TABLE TEST {
>     NUM BIGINT NOT NULL DEFAULT 0
> };


> EXEC "SELECT NUM FROM TEST LIMIT 1"
>    PQgetlength return valid length (sizeof(int64)), it's ok.

> but
> EXEC "SELECT SUM(NUM)::BIGINT FROM TEST"
> or
> EXEC "SELECT SUM(NUM) FROM TEST"

>    PQgetlength already return zero.

I see no bug here.  For such a case (with no rows in the table)
SUM() is defined to return NULL, and PQgetvalue() is defined to
return an empty string for a null, and PQgetlength() is defined
to return the length of whatever PQgetvalue() returns.

            regards, tom lane

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #4714: Unicode Big5 Conversion
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: BUG #4714: Unicode Big5 Conversion