pgsql: Fix I/O-conversion-related memory leaks in plpgsql.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix I/O-conversion-related memory leaks in plpgsql.
Дата
Msg-id E1RwM2Z-0000Lr-QZ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix I/O-conversion-related memory leaks in plpgsql.

Datatype I/O functions are allowed to leak memory in CurrentMemoryContext,
since they are generally called in short-lived contexts.  However, plpgsql
calls such functions for purposes of type conversion, and was calling them
in its procedure context.  Therefore, any leaked memory would not be
recovered until the end of the plpgsql function.  If such a conversion
was done within a loop, quite a bit of memory could get consumed.  Fix by
calling such functions in the transient "eval_econtext", and adjust other
logic to match.  Back-patch to all supported versions.

Andres Freund, Jan Urbański, Tom Lane

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6fb17aeeab87dafca42a9db49ecb152a967d155c

Modified Files
--------------
src/pl/plpgsql/src/pl_exec.c |  162 +++++++++++++++++++++++++-----------------
1 files changed, 96 insertions(+), 66 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix I/O-conversion-related memory leaks in plpgsql.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix I/O-conversion-related memory leaks in plpgsql.