properly sizing attnums in pg_get_publication_tables

Поиск
Список
Период
Сортировка
От Ted Yu
Тема properly sizing attnums in pg_get_publication_tables
Дата
Msg-id CALte62watWE6moG8XbRWDU17wbG+hwE0adxp2tqP6OGLcRn6gg@mail.gmail.com
обсуждение исходный текст
Ответы Re: properly sizing attnums in pg_get_publication_tables  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
Hi,
I was looking at commit b7ae03953690a1dee455ba3823cc8f71a72cbe1d .

In `pg_get_publication_tables`, attnums is allocated with size `desc->natts`. However, since some columns may be dropped, this size may be larger than necessary.
When `nattnums > 0` is false, there is no need to allocate the `attnums` array. In the current formation, `attnums` should be freed in this scenario.

Please take a look at the patch which moves the allocation to inside the `if (nattnums > 0)` block.

Thanks

Вложения

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

Предыдущее
От: Zhang Mingli
Дата:
Сообщение: Re: Fix condition in shm_toc and remove unused function shm_toc_freespace.
Следующее
От: Nikolay Samokhvalov
Дата:
Сообщение: Re: Transaction timeout