pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
To: pgsql-committers@postgresql.org
Subject: pgsql: Remove dead NULL-pointer checks in GiST code.
Date: Wed, 28 Jan 2015 08:05:08 +0000
Message-ID: <E1YGNca-0002qU-5i@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Remove dead NULL-pointer checks in GiST code.

gist_poly_compress() and gist_circle_compress() checked for a NULL-pointer
key argument, but that was dead code; the gist code never passes a
NULL-pointer to the "compress" method.

This commit also removes a documentation note added in commit a0a3883,
about doing NULL-pointer checks in the "compress" method. It was added
based on the fact that some implementations were doing NULL-pointer
checks, but those checks were unnecessary in the first place.

The NULL-pointer check in gbt_var_same() function was also unnecessary.
The arguments to the "same" method come from the "compress", "union", or
"picksplit" methods, but none of them return a NULL pointer.

None of this is to be confused with SQL NULL values. Those are dealt with
by the gist machinery, and are never passed to the GiST opclass methods.

Michael Paquier

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/670bf71f65c2315fc2ea7265d540402093db8cef

Modified Files
--------------
contrib/btree_gist/btree_utils_num.c |    9 ++---
contrib/btree_gist/btree_utils_var.c |   10 ++----
doc/src/sgml/gist.sgml               |    6 ----
src/backend/access/gist/gistproc.c   |   60 ++++++++++++----------------------
4 files changed, 25 insertions(+), 60 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1YGNca-0002qU-5i@gemulon.postgresql.org>
Permalink:  ../E1YGNca-0002qU-5i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1YGNca-0002qU-5i@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: heikki.linnakangas@iki.fi
  Subject: Re: pgsql: Remove dead NULL-pointer checks in GiST code.
  In-Reply-To: <E1YGNca-0002qU-5i@gemulon.postgresql.org>
  References: <E1YGNca-0002qU-5i@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