Re: fastgetattr & isNull

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: fastgetattr & isNull
Дата
Msg-id 603c8f071001061017y334047den1e993257a9b1e04@mail.gmail.com
обсуждение исходный текст
Ответ на Re: fastgetattr & isNull  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Jan 6, 2010 at 1:05 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> The fastgetattr() attempts to make provision for the case where isnull
>> is a NULL pointer, but it doesn't seem to work.  I tried it and got:
>
>> relcache.c:494: error: invalid use of void expression
>> relcache.c:494: error: invalid use of void expression
>> relcache.c:494: warning: left-hand operand of comma expression has no effect
>> relcache.c:494: warning: left-hand operand of comma expression has no effect
>
> Hmm.  I think the macro means to handle the case where the argument is a
> pointer variable whose value is null, not the case of writing "NULL" as
> a literal argument.

Hmm, I didn't think of that.  I don't see any attempt at doing that in
the source code anywhere, though.

> Still, it's not entirely clear to me why ignoring the possibility of
> a null value would be a good idea.

It's harmless if (Datum) 0 can't be a datum of the relevant type,
because you can still distinguish whether you got a result back.  But
you can always pass a dummy boolean point if you really want to do
that.

...Robert


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: fastgetattr & isNull
Следующее
От: Leonardo F
Дата:
Сообщение: Re: I: TODO: Allow substring/replace() to get/set bit values