Re: Endless loop calling PL/Python set returning functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Endless loop calling PL/Python set returning functions
Дата
Msg-id 1676.1457624156@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Endless loop calling PL/Python set returning functions  (Alexey Grishchenko <agrishchenko@pivotal.io>)
Ответы Re: Endless loop calling PL/Python set returning functions  (Alexey Grishchenko <agrishchenko@pivotal.io>)
Список pgsql-hackers
Alexey Grishchenko <agrishchenko@pivotal.io> writes:
> There is a bug in implementation of set-returning functions in PL/Python.
> When you call the same set-returning function twice in a single query, the
> executor falls to infinite loop which causes OOM.

Ugh.

> Another issue with calling the same set-returning function twice in the
> same query, is that it would delete the input parameter of the function
> from the global variables dictionary at the end of execution. With calling
> the function twice, this code attempts to delete the same entry from global
> variables dict twice, thus causing KeyError. This is why the
> function PLy_function_delete_args is modified as well to check whether the
> key we intend to delete is in the globals dictionary.

That whole business with putting a function's parameters into a global
dictionary makes me itch.  Doesn't it mean problems if one plpython
function calls another (presumably via SPI)?
        regards, tom lane



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Add generate_series(date,date) and generate_series(date,date,integer)
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Add generate_series(date,date) and generate_series(date,date,integer)