pgsql: Use a separate memory context for GIN scan keys.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Use a separate memory context for GIN scan keys.
Date: 2015-02-04 15:41:46
Message-ID: E1YJ25K-0005Dz-E2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Use a separate memory context for GIN scan keys.

It was getting tedious to track and release all the different things that
form a scan key. We were leaking at least the queryCategories array, and
possibly more, on a rescan. That was visible if a GIN index was used in a
nested loop join. This also protects from leaks in extractQuery method.

No backpatching, given the lack of complaints from the field. Maybe later,
after this has received more field testing.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/d88976cfa1302e8dccdcbfe55e9e29faee8c0cdf

Modified Files
--------------
src/backend/access/gin/ginget.c | 5 ++++-
src/backend/access/gin/ginscan.c | 43 ++++++++++++++++++++------------------
src/include/access/gin_private.h | 2 ++
3 files changed, 29 insertions(+), 21 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Meskes 2015-02-05 14:14:02 pgsql: This routine was calling ecpg_alloc to allocate to memory but di
Previous Message Heikki Linnakangas 2015-02-04 14:09:23 pgsql: Fix reference-after-free when waiting for another xact due to co