Re: redundant check of msg in does_not_exist_skipping

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: redundant check of msg in does_not_exist_skipping
Дата
Msg-id 1833733.1668700547@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: redundant check of msg in does_not_exist_skipping  (Japin Li <japinli@hotmail.com>)
Ответы Re: redundant check of msg in does_not_exist_skipping  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Japin Li <japinli@hotmail.com> writes:
> On Thu, 17 Nov 2022 at 23:06, Japin Li <japinli@hotmail.com> wrote:
>> I think we cannot remove the check, for example, if objtype is OBJECT_OPFAMILY,
>> and schema_does_not_exist_skipping() returns true, the so the msg keeps NULL,
>> if we remove this check, a sigfault might be occurd in ereport().

> Sorry, I didn't look into schema_does_not_exist_skipping(), and after look
> into schema_does_not_exist_skipping function and others, all paths that go
> out switch branch has non-NULL for msg, so we can remove this check safely.

This is a completely bad idea.  If it takes that level of analysis
to see that msg can't be null, we should leave the test in place.
Any future modification of either this code or what it calls could
break the conclusion.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: allow segment size to be set to < 1GiB
Следующее
От: Himanshu Upadhyaya
Дата:
Сообщение: Re: HOT chain validation in verify_heapam()