postgresql/src/backend
Tom Lane a0382e2d7e Make partition-lock-release coding more transparent in BufferAlloc().
Coverity complained that oldPartitionLock was possibly dereferenced after
having been set to NULL.  That actually can't happen, because we'd only use
it if (oldFlags & BM_TAG_VALID) is true.  But nonetheless Coverity is
justified in complaining, because at line 1275 we actually overwrite
oldFlags, and then still expect its BM_TAG_VALID bit to be a safe guide to
whether to release the oldPartitionLock.  Thus, the code would be incorrect
if someone else had changed the buffer's BM_TAG_VALID flag meanwhile.
That should not happen, since we hold pin on the buffer throughout this
sequence, but it's starting to look like a rather shaky chain of logic.
And there's no need for such assumptions, because we can simply replace
the (oldFlags & BM_TAG_VALID) tests with (oldPartitionLock != NULL),
which has identical results and makes it plain to all comers that we don't
dereference a null pointer.  A small side benefit is that the range of
liveness of oldFlags is greatly reduced, possibly allowing the compiler
to save a register.

This is just cleanup, not an actual bug fix, so there seems no need
for a back-patch.
2016-04-18 18:05:56 -04:00
..
access Fix memory leak in GIN index scans. 2016-04-15 00:02:26 -04:00
bootstrap Revert CREATE INDEX ... INCLUDING ... 2016-04-08 21:52:13 +03:00
catalog In recordExtensionInitPriv(), keep the scan til we're done with it 2016-04-15 21:57:15 -04:00
commands Disallow creation of indexes on system columns (except for OID). 2016-04-16 12:11:41 -04:00
executor Tweak EXPLAIN for parallel query to show workers launched. 2016-04-15 11:52:18 -04:00
foreign Fix whitespace 2016-04-11 14:44:51 -04:00
lib
libpq Add authentication parameters compat_realm and upn_usename for SSPI 2016-04-08 20:28:38 +02:00
main Avoid crash on old Windows with AVX2-capable CPU for VS2013 builds 2016-03-10 14:10:18 +01:00
nodes Fix whitespace 2016-04-11 14:44:51 -04:00
optimizer Fix typo in comment 2016-04-15 13:32:54 +02:00
parser Revert CREATE INDEX ... INCLUDING ... 2016-04-08 21:52:13 +03:00
po
port Fix prototype of pgwin32_bind(). 2016-04-14 09:44:21 -04:00
postmaster Use GRANT system to manage access to sensitive functions 2016-04-06 21:45:32 -04:00
regex
replication Fix trivial typo. 2016-04-14 19:25:16 -07:00
rewrite Improve error message for rejecting RETURNING clauses with dropped columns. 2016-02-29 19:11:38 -05:00
snowball
storage Make partition-lock-release coding more transparent in BufferAlloc(). 2016-04-18 18:05:56 -04:00
tcop Support ALTER THING .. DEPENDS ON EXTENSION 2016-04-05 18:38:54 -03:00
tsearch Fix possible use of uninitialised value in ts_headline() 2016-04-08 21:25:14 +03:00
utils Use PG_INT32_MIN instead of reiterating the constant. 2016-04-13 07:54:45 -04:00
.gitignore
common.mk
Makefile Support multiple synchronous standby servers. 2016-04-06 17:18:25 +09:00
nls.mk