pgsql: Mop up some undue familiarity with the innards of Bitmapsets. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Mop up some undue familiarity with the innards of Bitmapsets.
Date
Msg-id E1pXmJY-001Xy2-VO@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Mop up some undue familiarity with the innards of Bitmapsets.

nodeAppend.c used non-nullness of appendstate->as_valid_subplans as
a state flag to indicate whether it'd done ExecFindMatchingSubPlans
(or some sufficient approximation to that).  This was pretty
questionable even in the beginning, since it wouldn't really work
right if there are no valid subplans.  It got more questionable
after commit 27e1f1456 added logic that could reduce as_valid_subplans
to an empty set: at that point we were depending on unspecified
behavior of bms_del_members, namely that it'd not return an empty
set as NULL.  It's about to start doing that, which breaks this
logic entirely.  Hence, add a separate boolean flag to signal
whether as_valid_subplans has been computed.

Also fix a previously-cosmetic bug in nodeAgg.c, wherein it ignored
the return value of bms_del_member instead of updating its pointer.

Patch by me; thanks to Nathan Bossart and Richard Guo for review.

Discussion: https://postgr.es/m/1159933.1677621588@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/141225b2518f20ca7bd68d4458953c3404d2e364

Modified Files
--------------
src/backend/executor/nodeAgg.c    |  2 +-
src/backend/executor/nodeAppend.c | 37 +++++++++++++++++++++++--------------
src/include/nodes/execnodes.h     |  1 +
3 files changed, 25 insertions(+), 15 deletions(-)


pgsql-committers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: pgsql: Mark options as deprecated in usage output
Next
From: Thomas Munro
Date:
Subject: pgsql: Don't leak descriptors into subprograms.