pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter_e@gmx.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Don't cast between GinNullCategory and bool
Date: Tue, 02 Jan 2018 17:29:33 +0000
Message-ID: <E1eWQNZ-00082j-64@gemulon.postgresql.org> (raw)

Don't cast between GinNullCategory and bool

The original idea was that we could use an isNull-style bool array
directly as a GinNullCategory array.  However, the existing code already
acknowledges that that doesn't really work, because of the possibility
that bool as currently defined can have arbitrary bit patterns for true
values.  So it has to loop through the nullFlags array to set each bool
value to an acceptable value.  But if we are looping through the whole
array anyway, we might as well build a proper GinNullCategory array
instead and abandon the type casting.  That makes the code much safer in
case bool is ever changed to something else.

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/438036264a3b71eaf39b2d2eeca67237ed38ca51

Modified Files
--------------
src/backend/access/gin/ginscan.c | 19 ++++++++-----------
src/backend/access/gin/ginutil.c | 18 ++++++++----------
src/include/access/ginblock.h    |  7 +++++--
3 files changed, 21 insertions(+), 23 deletions(-)



Message-ID: <E1eWQNZ-00082j-64@gemulon.postgresql.org>
Permalink:  ../E1eWQNZ-00082j-64@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1eWQNZ-00082j-64@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter_e@gmx.net
  Subject: Re: pgsql: Don't cast between GinNullCategory and bool
  In-Reply-To: <E1eWQNZ-00082j-64@gemulon.postgresql.org>
  References: <E1eWQNZ-00082j-64@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox