pgsql: Remove dead NULL-pointer checks in GiST code.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove dead NULL-pointer checks in GiST code.
Date: 2015-01-28 08:05:08
Message-ID: E1YGNca-0002qU-5i@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-01-28 08:27:36 pgsql: Fix typo in comment.
Previous Message Tom Lane 2015-01-27 17:07:02 pgsql: Fix NUMERIC field access macros to treat NaNs consistently.