Re: redundant check of msg in does_not_exist_skipping

2022-11-17 Thread Li Japin
> On Nov 18, 2022, at 4:04 AM, Robert Haas wrote: > > On Thu, Nov 17, 2022 at 10:56 AM Tom Lane wrote: >> 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 w

Re: redundant check of msg in does_not_exist_skipping

2022-11-17 Thread Robert Haas
On Thu, Nov 17, 2022 at 10:56 AM Tom Lane wrote: > 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. +1. Also, even if

Re: redundant check of msg in does_not_exist_skipping

2022-11-17 Thread Tom Lane
Japin Li writes: > On Thu, 17 Nov 2022 at 23:06, Japin Li 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 erepor

Re: redundant check of msg in does_not_exist_skipping

2022-11-17 Thread Japin Li
On Thu, 17 Nov 2022 at 23:06, Japin Li wrote: > On Thu, 17 Nov 2022 at 20:12, Ted Yu wrote: >> Hi, >> I was looking at commit aca992040951c7665f1701cd25d48808eda7a809 >> >> I think the check of msg after the switch statement is not necessary. The >> variable msg is used afterward. >> If there i

Re: redundant check of msg in does_not_exist_skipping

2022-11-17 Thread Japin Li
On Thu, 17 Nov 2022 at 20:12, Ted Yu wrote: > Hi, > I was looking at commit aca992040951c7665f1701cd25d48808eda7a809 > > I think the check of msg after the switch statement is not necessary. The > variable msg is used afterward. > If there is (potential) missing case in switch statement, the com