aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-06-01 17:21:45 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-06-01 17:21:45 -0400
commit60ca2e8418a14b531f684723d08639997afc0d6f (patch)
treee83b8b96f885d5acde48a40c389fc88b1ef4f9c9 /src
parenteeac7dd9ff76ee7ea1feb2dd6004c5d92c6caca5 (diff)
downloadpostgresql-60ca2e8418a14b531f684723d08639997afc0d6f.tar.gz
postgresql-60ca2e8418a14b531f684723d08639997afc0d6f.zip
Silence compiler warnings from some older compilers.
Since a117cebd6, some older gcc versions issue "variable may be used uninitialized in this function" complaints for brin_summarize_range. Silence that using the same coding pattern as in bt_index_check_internal; arguably, a117cebd6 had too narrow a view of which compilers might give trouble. Nathan Bossart and Tom Lane. Back-patch as the previous commit was. Discussion: https://postgr.es/m/20220601163537.GA2331988@nathanxps13
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/brin/brin.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index 8906bc76fb4..0becfde1133 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -911,7 +911,13 @@ brin_summarize_range(PG_FUNCTION_ARGS)
save_nestlevel = NewGUCNestLevel();
}
else
+ {
heapRel = NULL;
+ /* Set these just to suppress "uninitialized variable" warnings */
+ save_userid = InvalidOid;
+ save_sec_context = -1;
+ save_nestlevel = -1;
+ }
indexRel = index_open(indexoid, ShareUpdateExclusiveLock);