1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

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
This commit is contained in:
Tom Lane
2022-06-01 17:21:45 -04:00
parent 1072e4c45d
commit 4e46726156
2 changed files with 7 additions and 1 deletions

View File

@ -1053,7 +1053,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);