postgresql/src/backend/utils/cache
Tom Lane c13ed70a4f Fix longstanding race condition in plancache.c.
When creating or manipulating a cached plan for a transaction control
command (particularly ROLLBACK), we must not perform any catalog accesses,
since we might be in an aborted transaction.  However, plancache.c busily
saved or examined the search_path for every cached plan.  If we were
unlucky enough to do this at a moment where the path's expansion into
schema OIDs wasn't already cached, we'd do some catalog accesses; and with
some more bad luck such as an ill-timed signal arrival, that could lead to
crashes or Assert failures, as exhibited in bug #8095 from Nachiket Vaidya.
Fortunately, there's no real need to consider the search path for such
commands, so we can just skip the relevant steps when the subject statement
is a TransactionStmt.  This is somewhat related to bug #5269, though the
failure happens during initial cached-plan creation rather than
revalidation.

This bug has been there since the plan cache was invented, so back-patch
to all supported branches.
2013-04-20 16:59:31 -04:00
..
attoptcache.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
catcache.c Fix race condition with toast table access from a stale syscache entry. 2011-11-01 19:48:43 -04:00
inval.c Fix race condition in relcache init file invalidation. 2011-08-16 13:12:03 -04:00
lsyscache.c Fix getTypeIOParam to support type record[]. 2011-12-01 12:44:22 -05:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
plancache.c Fix longstanding race condition in plancache.c. 2013-04-20 16:59:31 -04:00
relcache.c Fix failure to ignore leftover temp tables after a server crash. 2012-12-17 20:15:45 -05:00
relmapper.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
spccache.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
syscache.c Capitalization fixes 2011-06-19 00:39:19 +03:00
ts_cache.c Fix error-checking typo in check_TSCurrentConfig(). 2013-01-20 23:10:18 -05:00
typcache.c Fix race condition in enum value comparisons. 2012-07-01 17:12:59 -04:00