]> granicus.if.org Git - postgresql/commit
Fix management of fn_extra caching during repeated GiST index scans.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 May 2013 03:08:25 +0000 (23:08 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 10 May 2013 03:08:25 +0000 (23:08 -0400)
commiteb6cc854adbcf08778c31441f7aab053168928e6
tree472203db54cba49deda595f0bafb5ccfd46deaaa
parent44f5bb245ce497ef052d93b5c17e368ffaac83a8
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.
src/backend/access/gist/gistscan.c