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

From Ranier Vilela
Subject Re: Avoid mix char with bool type in comparisons
Date
Msg-id CAEudQApCoDhuHHNOSvpJyXPgWQGizsXUHDsdMRc8iFfL_kNRKQ@mail.gmail.com
Whole thread Raw
In response to Re: Avoid mix char with bool type in comparisons  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Avoid mix char with bool type in comparisons  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Em qui., 6 de out. de 2022 às 20:52, Tom Lane <tgl@sss.pgh.pa.us> escreveu:
Ranier Vilela <ranier.vf@gmail.com> writes:
> 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

Yeah, that's how it's designed.  Unless you can point to a bug,
I do not think we ought to change this code.
Thanks for answering.

My main concerns is this point:
  /* If already matched on earlier page, do no extra work */
- if (key->entryRes[j])
+ if (key->entryRes[j] == GIN_TRUE)
  continue;

If GIN_MAYBE cases are erroneously ignored.

regards,
Ranier Vilela

pgsql-hackers by date:

Previous
From: Ajin Cherian
Date:
Subject: Re: Support logical replication of DDLs
Next
From: Tom Lane
Date:
Subject: Re: Avoid mix char with bool type in comparisons