Re: SIGSEGV in PQreset(..)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SIGSEGV in PQreset(..)
Дата
Msg-id 5379.1139868543@sss.pgh.pa.us
обсуждение исходный текст
Ответ на SIGSEGV in PQreset(..)  (Arturs Zoldners <az@rpiva.lv>)
Список pgsql-bugs
Arturs Zoldners <az@rpiva.lv> writes:
> The following code raises SIGSEGV:

>         PGconn* conn = PQconnectdb("x");
>         ConnStatusType status = PQstatus(conn);
>     //status == CONNECTION_BAD
>         PQreset(conn);

PQreset assumes it's been passed a reasonably valid PGconn, which is not
the case if conninfo_parse couldn't make any sense of the connect
options string.  We probably ought to add a state flag to indicate
whether the options have been set up successfully, and cause PQreset to
fail if not.  (The alternative seems to be for PQreset to refuse to do
anything if the connection state is CONNECTION_BAD, but that looks like
it would destroy most of the usefulness of PQreset ...)

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2246: Bad malloc interactions: ecpg, openssl
Следующее
От: "Evgeny Gridasov"
Дата:
Сообщение: BUG #2257: Can' stop server while autovacuum is running