postgresql/src/backend
Heikki Linnakangas 42f782be91 Tidy up GetMultiXactIdMembers()'s behavior on error
One of the error paths left *members uninitialized. That's not a live
bug, because most callers don't look at *members when the function
returns -1, but let's be tidy. One caller, in heap_lock_tuple(), does
"if (members != NULL) pfree(members)", but AFAICS it never passes an
invalid 'multi' value so it should not reach that error case.

The callers are also a bit inconsistent in their expectations.
heap_lock_tuple() pfrees the 'members' array if it's not-NULL, others
pfree() it if "nmembers >= 0", and others if "nmembers > 0". That's
not a live bug either, because the function should never return 0, but
add an Assert for that to make it more clear. I left the callers alone
for now.

I also moved the line where we set *nmembers. It wasn't wrong before,
but I like to do that right next to the 'return' statement, to make it
clear that it's always set on return.

Also remove one unreachable return statement after ereport(ERROR), for
brevity and for consistency with the similar if-block right after it.

Author: Greg Nancarrow with the additional changes by me
Backpatch-through: 9.6, all supported versions
2021-06-17 14:52:45 +03:00
..
access Tidy up GetMultiXactIdMembers()'s behavior on error 2021-06-17 14:52:45 +03:00
bootstrap Skip WAL for new relfilenodes, under wal_level=minimal. 2020-04-04 12:25:34 -07:00
catalog Disallow whole-row variables in GENERATED expressions. 2021-05-21 15:12:19 -04:00
commands Fix plancache refcount leak after error in ExecuteQuery. 2021-06-16 19:30:17 -04:00
executor Fix usage of "tableoid" in GENERATED expressions. 2021-05-21 15:02:07 -04:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit jit: Fix warning reported by gcc-11 caused by dubious function signature. 2021-05-05 22:14:52 -07:00
lib Fix typo in comment 2021-04-20 14:36:41 +02:00
libpq Disallow SSL renegotiation 2021-05-25 10:11:13 +09:00
main Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nodes Ensure that expandTableLikeClause() re-examines the same table. 2020-12-01 14:02:27 -05:00
optimizer Fix planner's row-mark code for inheritance from a foreign table. 2021-06-02 14:38:14 -04:00
parser Reject SELECT ... GROUP BY GROUPING SETS (()) FOR UPDATE. 2021-06-01 11:12:56 -04:00
partitioning Fix hash partition pruning with asymmetric partition sets. 2021-01-28 13:41:55 -05:00
po Translation updates 2021-05-10 14:32:18 +02:00
port Spelling adjustments 2020-06-07 15:06:51 +02:00
postmaster Be more careful about barriers when releasing BackgroundWorkerSlots. 2021-05-15 12:21:06 -04:00
regex Fix another ancient bug in parsing of BRE-mode regular expressions. 2021-02-18 22:38:55 -05:00
replication Fix decoding of speculative aborts. 2021-06-15 08:41:16 +05:30
rewrite Revert "Propagate CTE property flags when copying a CTE list into a rule." 2021-02-07 12:54:08 -05:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Use correct spelling of statistics kind 2021-03-23 05:00:19 +01:00
storage Fix typo and outdated information in README.barrier 2021-05-18 09:55:54 +12:00
tcop Restore the portal-level snapshot after procedure COMMIT/ROLLBACK. 2021-05-21 14:03:53 -04:00
tsearch Don't leak compiled regex(es) when an ispell cache entry is dropped. 2021-03-18 21:44:43 -04:00
utils Ensure pg_filenode_relation(0, 0) returns NULL. 2021-06-12 13:29:24 -04:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Update copyrights for 2020 2020-01-01 12:21:45 -05:00
nls.mk Translation updates 2020-09-14 13:14:53 +02:00