postgres/src/backend
Tom Lane ac63dca607 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 17:00:23 -04:00
..
access Remove some unused and seldom used fields from RelationAmInfo. 2013-04-16 15:07:58 +03:00
bootstrap Allow I/O reliability checks using 16-bit checksums 2013-03-22 13:54:07 +00:00
catalog Clean up references to SQL92 2013-04-20 11:04:41 -04:00
commands Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
executor Clean up references to SQL92 2013-04-20 11:04:41 -04:00
foreign Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
lib Update copyrights for 2013 2013-01-01 17:15:01 -05:00
libpq Standardize spelling of "nonblocking" 2013-04-18 23:35:19 -04:00
main Fix insecure parsing of server command-line switches. 2013-04-01 14:00:51 -04:00
nodes Clean up the mess around EXPLAIN and materialized views. 2013-04-12 19:25:31 -04:00
optimizer Ignore extra subquery outputs in set_subquery_size_estimates(). 2013-03-31 18:34:15 -04:00
parser Clean up references to SQL92 2013-04-20 11:04:41 -04:00
po Translation updates 2011-08-17 14:07:46 +03:00
port Move pqsignal() to libpgport. 2013-03-17 12:06:42 -04:00
postmaster Standardize spelling of "nonblocking" 2013-04-18 23:35:19 -04:00
regex Support indexing of regular-expression searches in contrib/pg_trgm. 2013-04-09 01:06:54 -04:00
replication In base backup, only include our own tablespace version directory. 2013-03-25 20:19:22 +02:00
rewrite Add serial comma 2013-04-14 11:12:30 -04:00
snowball Update copyrights for 2013 2013-01-01 17:15:01 -05:00
storage Minor rewording of README comments 2013-04-08 17:20:26 +01:00
tcop Clean up references to SQL92 2013-04-20 11:04:41 -04:00
tsearch Update copyrights for 2013 2013-01-01 17:15:01 -05:00
utils Fix longstanding race condition in plancache.c. 2013-04-20 17:00:23 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Call check_keywords.pl in maintainer-check 2012-02-27 13:53:12 +02:00
Makefile Move relpath() to libpgcommon 2013-02-21 22:46:17 -03:00
nls.mk Split out XLog reading as an independent facility 2013-01-16 16:12:53 -03:00