diff options
Diffstat (limited to 'src/backend/optimizer/path')
-rw-r--r-- | src/backend/optimizer/path/allpaths.c | 11 | ||||
-rw-r--r-- | src/backend/optimizer/path/pathkeys.c | 10 |
2 files changed, 11 insertions, 10 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 && diff --git a/src/backend/optimizer/path/pathkeys.c b/src/backend/optimizer/path/pathkeys.c index 0e23045fef9..766aa1d1165 100644 --- a/src/backend/optimizer/path/pathkeys.c +++ b/src/backend/optimizer/path/pathkeys.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.65 2005/03/27 06:29:36 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/pathkeys.c,v 1.66 2005/04/06 16:34:05 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -791,7 +791,7 @@ build_subquery_pathkeys(Query *root, RelOptInfo *rel, Query *subquery) { TargetEntry *tle = (TargetEntry *) lfirst(k); - if (!tle->resdom->resjunk && + if (!tle->resjunk && equal(tle->expr, sub_key)) { /* Found a representation for this sub_key */ @@ -800,9 +800,9 @@ build_subquery_pathkeys(Query *root, RelOptInfo *rel, Query *subquery) int score; outer_var = makeVar(rel->relid, - tle->resdom->resno, - tle->resdom->restype, - tle->resdom->restypmod, + tle->resno, + exprType((Node *) tle->expr), + exprTypmod((Node *) tle->expr), 0); outer_item = makePathKeyItem((Node *) outer_var, sub_item->sortop, |