aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2021-06-17 14:50:42 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2021-06-17 14:50:42 +0300
commitd24c5658a80c8f5037e9e1948de311d3f3350f12 (patch)
tree6355dc5f10e51d8bd703c005220d3e1a1d39718a /src/backend/executor/functions.c
parent3cb828dbe26087e7754f49f3cfe3ed036d5af439 (diff)
downloadpostgresql-d24c5658a80c8f5037e9e1948de311d3f3350f12.tar.gz
postgresql-d24c5658a80c8f5037e9e1948de311d3f3350f12.zip
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
Diffstat (limited to 'src/backend/executor/functions.c')
0 files changed, 0 insertions, 0 deletions