aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-03-26 11:53:37 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-03-26 11:53:37 -0400
commit979cd655c13c3ea5d7df1db84ef9c9c85c0ea6b3 (patch)
tree5b522cbbc2aa78330b97aa0f58c41daff4d5b622
parent923def9a533a7d986acfb524139d8b9e5466d0a5 (diff)
downloadpostgresql-979cd655c13c3ea5d7df1db84ef9c9c85c0ea6b3.tar.gz
postgresql-979cd655c13c3ea5d7df1db84ef9c9c85c0ea6b3.zip
Suppress compiler warning in pub_collist_to_bitmapset().
A fair percentage of the buildfarm doesn't recognize that oldcxt won't be used uninitialized; silence those warnings by initializing it. While here, upgrade the function's thoroughly inadequate header comment. Oversight in 923def9a5, per buildfarm.
-rw-r--r--src/backend/catalog/pg_publication.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index a5a54e676e9..9fe3b189269 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -592,7 +592,11 @@ publication_translate_columns(Relation targetrel, List *columns,
}
/*
- * Transform the column list (represented by an array) to a bitmapset.
+ * Transform a column list (represented by an array Datum) to a bitmapset.
+ *
+ * If columns isn't NULL, add the column numbers to that set.
+ *
+ * If mcxt isn't NULL, build the bitmapset in that context.
*/
Bitmapset *
pub_collist_to_bitmapset(Bitmapset *columns, Datum pubcols, MemoryContext mcxt)
@@ -601,7 +605,7 @@ pub_collist_to_bitmapset(Bitmapset *columns, Datum pubcols, MemoryContext mcxt)
ArrayType *arr;
int nelems;
int16 *elems;
- MemoryContext oldcxt;
+ MemoryContext oldcxt = NULL;
/*
* If an existing bitmap was provided, use it. Otherwise just use NULL