]> granicus.if.org Git - postgresql/commit
Change hashscan.c to keep its list of active hash index scans in
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Mar 2008 15:59:31 +0000 (15:59 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 7 Mar 2008 15:59:31 +0000 (15:59 +0000)
commit9cd94383e0dc9205bb3ce3c05025f5b3d2f44a25
tree7a1b43d59ce2b43ed7799bd875c0667e882ebe02
parent6bf887cadc974039babc1d61d7aa3a79b99e0165
Change hashscan.c to keep its list of active hash index scans in
TopMemoryContext, rather than scattered through executor per-query contexts.
This poses no danger of memory leak since the ResourceOwner mechanism
guarantees release of no-longer-needed items.  It is needed because the
per-query context might already be released by the time we try to clean up
the hash scan list.  Report by ykhuang, diagnosis by Heikki.

Back-patch to 8.0, where the ResourceOwner-based cleanup was introduced.
The given test case does not fail before 8.2, probably because we rearranged
transaction abort processing somehow; but this coding is undoubtedly risky
so I'll patch 8.0 and 8.1 anyway.
src/backend/access/hash/hashscan.c