Re: PlPython bug in 9.0/8.4.4

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PlPython bug in 9.0/8.4.4
Дата
Msg-id 6099.1276013677@sss.pgh.pa.us
обсуждение исходный текст
Ответ на PlPython bug in 9.0/8.4.4  (Teodor Sigaev <teodor@sigaev.ru>)
Список pgsql-hackers
Teodor Sigaev <teodor@sigaev.ru> writes:
> The way to reproduce:

Well, of course plpython's error handling is fundamentally brain dead.

The immediate problem here seems to be that the PLy_error_in_progress
struct is stored in a memory context that's been cleared by the time
that control gets to the place in PLy_procedure_call() where we try to
re-throw it.  It might be that we need to copy the ErrorData into a
less short-lived context than the one that's current when
PLy_spi_prepare is called.  Or maybe PLy_function_handler just needs
to think a bit harder about where it has to check PLy_error_in_progress
and/or where it's safe to shut down the SPI call.  Or all of the above.

Really I'd like to see that whole mess thrown out and rewritten.
pltcl and plperl got rid of static error state years ago, because of
essentially this same type of risk.

> 8.4.4 haves essentially the same bug.

I'm sure it goes all the way back.
        regards, tom lane


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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: Functional dependencies and GROUP BY
Следующее
От: Josh Berkus
Дата:
Сообщение: How about closing some Open Items?