Re: Bug in PL/pgSQL FOR cursor variant

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug in PL/pgSQL FOR cursor variant
Дата
Msg-id 11897.1277129327@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug in PL/pgSQL FOR cursor variant  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Bug in PL/pgSQL FOR cursor variant
Список pgsql-bugs
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> The problem is that exec_stmt_forc keeps using a pointer to the Portal,
> which becomes invalid if the cursor is closed in the middle. Patch
> attached, will apply..

Does that really fix anything?  I suspect you need to pstrdup() the
portalname.  Also, isn't exec_for_query() at just as much risk?
The latter's problem would only be exposed if the cursor was closed
at a batch boundary, but it's still a problem.

I wonder whether we ought to try to make it an error to close a portal
that's still in use.

            regards, tom lane

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

Предыдущее
От: "Yuhui"
Дата:
Сообщение: BUG #5515: Memory grows up problem
Следующее
От: Greg Stark
Дата:
Сообщение: Re: BUG #5516: Memory grows up problem