diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-28 18:50:48 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-01-28 18:50:48 +0000 |
commit | 01d9754bd9c535fd0a6b859acda01359db0eb6a2 (patch) | |
tree | d7741312649bb33532585dbcf3c4c1151ab790be | |
parent | 8a114e0031706ae9a1d239702ddb457ecabd25fa (diff) | |
download | postgresql-01d9754bd9c535fd0a6b859acda01359db0eb6a2.tar.gz |
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.
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 12da0781a0..1e195398f3 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.154 2006/10/04 00:29:53 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.154.2.1 2007/01/28 18:50:48 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -384,6 +384,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 * the parent rel. (Note: this is correct even if we have zero or one * live subpath due to constraint exclusion.) |