Avoid mix char with bool type in comparisons - Mailing list pgsql-hackers

From Ranier Vilela
Subject Avoid mix char with bool type in comparisons
Date
Msg-id CAEudQApbr_v76BWsPK4oe6+pEfra7QG1PmSRJRVK64C7jrGWjg@mail.gmail.com
Whole thread Raw
Responses Re: Avoid mix char with bool type in comparisons  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

GIN Indexes:

Defines a type char GinTernaryValue with 3 values:
#define GIN_FALSE 0 /* item is not present / does not match */
#define GIN_TRUE 1 /* item is present / matches */
#define GIN_MAYBE 2 /* don't know if item is present / don't know
* if matches */

So, any use of this GinTernaryValue are:

1. if (key->entryRes[j]) be FALSE if GIN_FALSE
2. if (key->entryRes[j]) be TRUE if GIN_TRUE
3. if (key->entryRes[j]) be TRUE if GIN_MAYBE

So gin matchs can fail with GYN_MAYBE or I lost something?

regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Reducing the chunk header sizes on all memory context types
Next
From: Zheng Li
Date:
Subject: Re: Support logical replication of DDLs