pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix freeing old values in index_store_float8_orderby_distances()
Date: Thu, 19 Sep 2019 22:20:58 +0000
Message-ID: <E1iB4nK-00005U-Vn@gemulon.postgresql.org> (raw)

Fix freeing old values in index_store_float8_orderby_distances()

6cae9d2c10 has added an error in freeing old values in
index_store_float8_orderby_distances() function.  It looks for old value in
scan->xs_orderbynulls[i] after setting a new value there.
This commit fixes that.  Also it removes short-circuit in handling
distances == NULL situation.  Now distances == NULL will be treated the same
way as array with all null distances.  That is, previous values will be freed
if any.

Reported-by: Tom Lane, Nikita Glukhov
Discussion: https://postgr.es/m/CAPpHfdu2wcoAVAm3Ek66rP%3Duo_C-D84%2B%2Buf1VEcbyi_caBXWCA%40mail.gmail.com
Discussion: https://postgr.es/m/426580d3-a668-b9d1-7b8e-f74d1a6524e0%40postgrespro.ru
Backpatch-through: 12

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8c8a267201bebb0edeaab2a76b7d3bcc9739924f

Modified Files
--------------
src/backend/access/index/indexam.c | 40 +++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 20 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1iB4nK-00005U-Vn@gemulon.postgresql.org>
Permalink:  ../E1iB4nK-00005U-Vn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iB4nK-00005U-Vn@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: akorotkov@postgresql.org
  Subject: Re: pgsql: Fix freeing old values in index_store_float8_orderby_distances()
  In-Reply-To: <E1iB4nK-00005U-Vn@gemulon.postgresql.org>
  References: <E1iB4nK-00005U-Vn@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