Re: Needless additional partition check in INSERT?

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Needless additional partition check in INSERT?
Дата
Msg-id 20180511062712.GA15629@paquier.xyz
обсуждение исходный текст
Ответ на Re: Needless additional partition check in INSERT?  (David Rowley <david.rowley@2ndquadrant.com>)
Ответы Re: Needless additional partition check in INSERT?  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
On Fri, May 11, 2018 at 06:12:38PM +1200, David Rowley wrote:
> On 11 May 2018 at 17:48, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
>> By the way,
>>
>> +            !resultRelInfo->ri_PartitionRoot)
>>
>> This should be resultRelInfo->ri_PartitionRoot == NULL, because the above
>> gives an impression that ri_PartitionRoot is a Boolean.
>
> If this is some new coding rule, then that's the first I've heard of it.
>
> Scanning over the result of git grep -E "if \(!\w{1,}\)" it looks like
> we have a bit of cleanup work to do before we can comply.
>
> FWIW, I've previously been told off for the opposite.

NULL maps to 0 so that's not really worth worrying.  A lot of code paths
use one way or the other for pointers.  That's really up to the patch
author at the end (I prefer matching with NULL, but usually it is better
to comply with the surroundings for consistency).
--
Michael

Вложения

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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Needless additional partition check in INSERT?
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Needless additional partition check in INSERT?