From f959bf9a5b9cecd2f6e6bdd24a34a7b269b00827 Mon Sep 17 00:00:00 2001 From: David Rowley Date: Wed, 24 Aug 2022 22:04:28 +1200 Subject: Further -Wshadow=compatible-local warning fixes These should have been included in 421892a19 as these shadowed variable warnings can also be fixed by adjusting the scope of the shadowed variable to put the declaration for it in an inner scope. This is part of the same effort as f01592f91. By my count, this takes the warning count from 114 down to 106. Author: David Rowley and Justin Pryzby Discussion: https://postgr.es/m/CAApHDvrwLGBP%2BYw9vriayyf%3DXR4uPWP5jr6cQhP9au_kaDUhbA%40mail.gmail.com --- src/backend/utils/adt/ruleutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/adt/ruleutils.c') diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index 8964f73b929..8280711f7ef 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -1615,7 +1615,6 @@ pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok) ArrayType *arr; char *enabled; Datum datum; - bool isnull; bool ndistinct_enabled; bool dependencies_enabled; bool mcv_enabled; @@ -1668,6 +1667,8 @@ pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok) if (!columns_only) { + bool isnull; + nsp = get_namespace_name_or_temp(statextrec->stxnamespace); appendStringInfo(&buf, "CREATE STATISTICS %s", quote_qualified_identifier(nsp, -- cgit v1.2.3