pgsql: Fix management of fn_extra caching during repeated GiST index sc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix management of fn_extra caching during repeated GiST index sc
Date: 2013-05-10 03:09:13
Message-ID: E1Uadhp-0006pL-DB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix management of fn_extra caching during repeated GiST index scans.

Commit d22a09dc70f9830fa78c1cd1a3a453e4e473d354 introduced official support
for GiST consistentFns that want to cache data using the FmgrInfo fn_extra
pointer: the idea was to preserve the cached values across gistrescan(),
whereas formerly they'd been leaked. However, there was an oversight in
that, namely that multiple scan keys might reference the same column's
consistentFn; the code would result in propagating the same cache value
into multiple scan keys, resulting in crashes or wrong answers. Use a
separate array instead to ensure that each scan key keeps its own state.

Per bug #8143 from Joel Roller. Back-patch to 9.2 where the bug was
introduced.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/91715e82932665c6e125d100eeaa1b6debf73e7b

Modified Files
--------------
src/backend/access/gist/gistscan.c | 51 ++++++++++++++++++++---------------
1 files changed, 29 insertions(+), 22 deletions(-)

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-05-10 17:07:35 pgsql: Fix pgp_pub_decrypt() so it works for secret keys with passwords
Previous Message Peter Eisentraut 2013-05-10 02:27:17 pgsql: Remove make_keywords