Re: Warnings around booleans - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Warnings around booleans
Date
Msg-id 55CC7F7A.3050203@iki.fi
Whole thread Raw
In response to Re: Warnings around booleans  (Stephen Frost <sfrost@snowman.net>)
Responses Re: Warnings around booleans  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 08/12/2015 03:46 PM, Stephen Frost wrote:
> * Andres Freund (andres@anarazel.de) wrote:
>> On 2015-08-12 08:16:09 -0400, Stephen Frost wrote:
>>>> 1) gin stores/queries some bools as GinTernaryValue.
>>>>
>>>>     Part of this is easy to fix, just adjust GinScanKeyData->entryRes to
>>>>     be a GinTernaryValue (it's actually is compared against MAYBE).
>>>>
>>>>     What I find slightly worrysome is that in gin_tsquery_consistent()
>>>>     checkcondition_gin (returning GinTernaryValue) is passed as a
>>>>     callback that's expected to return bool. And the field
>>>>     checkcondition_gin is returning (GinChkVal->check[i]) actually is a
>>>>     ternary.
>>>
>>> Is there a potential corruption issue from that..?
>>
>> I honestly don't understand the gin code well enough to answer that.
>
> Yeah, neither do I, so I've added Heikki.  Heikki, any idea as to the
> impact of this?

It's harmless. gin_tsquery_consistent() places a boolean array as the 
'check' array, and therefore checkcondition_gin will also only return 
TRUEs and FALSEs, never MAYBEs. A comment to explain why that's OK would 
probably be in order though.

- Heikki




pgsql-hackers by date:

Previous
From: Michael Meskes
Date:
Subject: Re: Warnings around booleans
Next
From: Andres Freund
Date:
Subject: Re: Warnings around booleans