diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-04-06 16:34:07 +0000 |
commit | ad161bcc8a3792d18ef2f3ebe66bb1e22d42b6f2 (patch) | |
tree | 18ec8963fbd1d6dd62ad214bfe3552fc2e7d06eb /src/backend/optimizer/path/allpaths.c | |
parent | 0f3748a28c42d09d794ff00af3f1f992eaa5fd7c (diff) |
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
few palloc's. I also chose to eliminate the restype and restypmod fields
entirely, since they are redundant with information stored in the node's
contained expression; re-examining the expression at need seems simpler
and more reliable than trying to keep restype/restypmod up to date.
initdb forced due to change in contents of stored rules.
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index 42d8761845c..16513108450 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.124 2005/03/10 23:21:21 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.125 2005/04/06 16:34:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -29,6 +29,7 @@ #include "optimizer/var.h" #include "parser/parsetree.h" #include "parser/parse_clause.h" +#include "parser/parse_expr.h" #include "rewrite/rewriteManip.h" @@ -656,12 +657,12 @@ compare_tlist_datatypes(List *tlist, List *colTypes, { TargetEntry *tle = (TargetEntry *) lfirst(l); - if (tle->resdom->resjunk) + if (tle->resjunk) continue; /* ignore resjunk columns */ if (colType == NULL) elog(ERROR, "wrong number of tlist entries"); - if (tle->resdom->restype != lfirst_oid(colType)) - differentTypes[tle->resdom->resno] = true; + if (exprType((Node *) tle->expr) != lfirst_oid(colType)) + differentTypes[tle->resno] = true; colType = lnext(colType); } if (colType != NULL) @@ -740,7 +741,7 @@ qual_is_pushdown_safe(Query *subquery, Index rti, Node *qual, /* Must find the tlist element referenced by the Var */ tle = get_tle_by_resno(subquery->targetList, var->varattno); Assert(tle != NULL); - Assert(!tle->resdom->resjunk); + Assert(!tle->resjunk); /* If subquery uses DISTINCT or DISTINCT ON, check point 3 */ if (subquery->distinctClause != NIL && |