Re: unsafe use of hash_search(... HASH_ENTER ...)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: unsafe use of hash_search(... HASH_ENTER ...)
Дата
Msg-id 877.1117340722@sss.pgh.pa.us
обсуждение исходный текст
Ответ на unsafe use of hash_search(... HASH_ENTER ...)  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
Список pgsql-hackers
"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> In general, code snippet like this:

> if (hash_search(..., HASH_ENTER, ...) == NULL)
>     action_except_elog__ERROR__;

> are considered unsafe if: (1) the allocation method of the target hash table
> could elog(ERROR) themselves and (2) the reaction to the failure of
> hash_search() is not elog(ERROR).

I've made some changes to hopefully prevent this type of thinko again.
Thanks for spotting it.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Escape handling in COPY, strings, psql
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Bloom Filter indexes?