Remove bms_first_member().
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 2 Mar 2023 16:34:29 +0000 (11:34 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 2 Mar 2023 16:34:29 +0000 (11:34 -0500)
This function has been semi-deprecated ever since we invented
bms_next_member().  Its habit of scribbling on the input bitmapset
isn't great, plus for sufficiently large bitmapsets it would take
O(N^2) time to complete a loop.  Now we have the additional problem
that reducing the input to empty while leaving it still accessible
would violate a planned invariant.  So let's just get rid of it,
after updating the few extant callers to use bms_next_member().

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

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

contrib/file_fdw/file_fdw.c
contrib/sepgsql/dml.c
src/backend/access/heap/heapam.c
src/backend/executor/nodeAgg.c
src/backend/nodes/bitmapset.c
src/backend/optimizer/plan/subselect.c
src/backend/parser/parse_expr.c
src/backend/replication/logical/relation.c
src/include/nodes/bitmapset.h

index 8ccc1675488eeade58dc3847d33b9a29c1718332..2d2b0b6a6b91c24cad626259d9c902bbbb24dffa 100644 (file)
@@ -858,7 +858,7 @@ check_selective_binary_conversion(RelOptInfo *baserel,
    ListCell   *lc;
    Relation    rel;
    TupleDesc   tupleDesc;
-   AttrNumber  attnum;
+   int