diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-06-01 17:21:45 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-06-01 17:21:45 -0400 |
commit | dd1c8dd1015f4548d6c29de56e54eda317b39319 (patch) | |
tree | 75683ff69f8de24b6b6d82efa72bd6baf333b68a /src | |
parent | eb39610f82679e015dd990a3fbba1c62e399c32a (diff) | |
download | postgresql-dd1c8dd1015f4548d6c29de56e54eda317b39319.tar.gz postgresql-dd1c8dd1015f4548d6c29de56e54eda317b39319.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.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c index 52f171772dc..0de1441dc6d 100644 --- a/src/backend/access/brin/brin.c +++ b/src/backend/access/brin/brin.c @@ -1051,7 +1051,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); |