pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Properly initialize SortSupport for ORDER BY rechecks in nodeInd
Date: Sun, 05 Jun 2016 15:53:19 +0000
Message-ID: <E1b9aMZ-0003po-0M@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Properly initialize SortSupport for ORDER BY rechecks in nodeIndexscan.c.

Fix still another bug in commit 35fcb1b3d: it failed to fully initialize
the SortSupport states it introduced to allow the executor to re-check
ORDER BY expressions containing distance operators.  That led to a null
pointer dereference if the sortsupport code tried to use ssup_cxt.  The
problem only manifests in narrow cases, explaining the lack of previous
field reports.  It requires a GiST-indexable distance operator that lacks
SortSupport and is on a pass-by-ref data type, which among core+contrib
seems to be only btree_gist's interval opclass; and it requires the scan
to be done as an IndexScan not an IndexOnlyScan, which explains how
btree_gist's regression test didn't catch it.  Per bug #14134 from
Jihyun Yu.

Peter Geoghegan

Report: <20160511154904.2603.43889@wrigleys.postgresql.org>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/8a859691d548dc4733b8bb302c624fbc012db534

Modified Files
--------------
contrib/btree_gist/expected/interval.out | 18 ++++++++++++++++++
contrib/btree_gist/sql/interval.sql      |  6 ++++++
src/backend/executor/nodeIndexscan.c     | 15 +++++++++++++--
3 files changed, 37 insertions(+), 2 deletions(-)


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


view thread (2+ messages)

Message-ID: <E1b9aMZ-0003po-0M@gemulon.postgresql.org>
Permalink:  ../E1b9aMZ-0003po-0M@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1b9aMZ-0003po-0M@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Properly initialize SortSupport for ORDER BY rechecks in nodeInd
  In-Reply-To: <E1b9aMZ-0003po-0M@gemulon.postgresql.org>
  References: <E1b9aMZ-0003po-0M@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