aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/commands/analyze.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/commands/analyze.c b/src/backend/commands/analyze.c
index ce29bf59095..7c126010aaa 100644
--- a/src/backend/commands/analyze.c
+++ b/src/backend/commands/analyze.c
@@ -1206,6 +1206,10 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
ListCell *lc;
bool has_child;
+ /* Initialize output parameters to zero now, in case we exit early */
+ *totalrows = 0;
+ *totaldeadrows = 0;
+
/*
* Find all members of inheritance set. We only need AccessShareLock on
* the children.
@@ -1337,8 +1341,6 @@ acquire_inherited_sample_rows(Relation onerel, int elevel,
* clear that it's worth working harder.)
*/
numrows = 0;
- *totalrows = 0;
- *totaldeadrows = 0;
for (i = 0; i < nrels; i++)
{
Relation childrel = rels[i];