Commit 2b8758a3 authored by Tom Lane's avatar Tom Lane

Repair oversight in creation of "append relations": we should set up

rel->tuples as well as rel->rows, since some estimation functions expect both
to be valid in every baserel.  Per report from Dave Dutcher.
parent 5681cde7
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.157 2007/01/20 20:45:38 tgl Exp $ * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.158 2007/01/28 18:50:40 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -393,6 +393,12 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, ...@@ -393,6 +393,12 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel,
} }
} }
/*
* Set "raw tuples" count equal to "rows" for the appendrel; needed
* because some places assume rel->tuples is valid for any baserel.
*/
rel->tuples = rel->rows;
/* /*
* Finally, build Append path and install it as the only access path for * Finally, build Append path and install it as the only access path for
* the parent rel. (Note: this is correct even if we have zero or one * the parent rel. (Note: this is correct even if we have zero or one
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment