Re: Jsonb transform for pl/python
| От | Nikita Glukhov |
|---|---|
| Тема | Re: Jsonb transform for pl/python |
| Дата | |
| Msg-id | b14b08f2-6598-b386-46f7-cd577383d54f@postgrespro.ru обсуждение исходный текст |
| Ответ на | Re: Jsonb transform for pl/python (Alexander Korotkov <a.korotkov@postgrespro.ru>) |
| Ответы |
Re: Jsonb transform for pl/python
|
| Список | pgsql-hackers |
Working on the new lazy transform for jsonb I found another memory leak in
PLyObject_ToJsonbValue(): palloc() for output boolean JsonbValue is unnecessary,
'out' variable is already initialized.
Fix is attached.
On 15.06.2018 14:42, Alexander Korotkov wrote:
> Hi!
>
> On Fri, Jun 15, 2018 at 2:11 PM Nikita Glukhov <n.gluhov@postgrespro.ru> wrote:
>
> I found a memory leak in PLySequence_ToJsonbValue():
> PyObject returned from PySequence_GetItem() is not released.
>
> A bug can be easily reproduced using function roudtrip() from regression test:
> SELECT roundtrip('[1,2,3]'::jsonb) FROM generate_series(1, 1000000);
>
> Similar code in PLyMapping_ToJsonbValue() seems to be correct because
> PyList_GetItem() and PyTuple_GetItem() return a borrowed reference.
>
> Patch with fix is attached.
> I'm going to check and commit this if everything is OK.
>
> ------
> Alexander Korotkov
> Postgres Professional: http://www.postgrespro.com
> The Russian Postgres Company
--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
Вложения
В списке pgsql-hackers по дате отправления: