diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-29 21:39:12 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-11-29 21:39:12 +0000 |
commit | f68f11928d5c791873073c882775dae10283ff49 (patch) | |
tree | 628e4491fe33cdafb0e205d73e29b154ef68f94b /src/backend/parser/parse_clause.c | |
parent | 851a4c48fd468b15ef988d5d2c79a44246dd478d (diff) | |
download | postgresql-f68f11928d5c791873073c882775dae10283ff49.tar.gz postgresql-f68f11928d5c791873073c882775dae10283ff49.zip |
Tighten selection of equality and ordering operators for grouping
operations: make sure we use operators that are compatible, as determined
by a mergejoin link in pg_operator. Also, add code to planner to ensure
we don't try to use hashed grouping when the grouping operators aren't
marked hashable.
Diffstat (limited to 'src/backend/parser/parse_clause.c')
-rw-r--r-- | src/backend/parser/parse_clause.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index d9638753746..ca398b4e3b3 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.99 2002/11/15 02:50:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.100 2002/11/29 21:39:11 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1128,8 +1128,7 @@ findTargetlistEntry(ParseState *pstate, Node *node, List *tlist, int clause) /* * transformGroupClause - - * transform a Group By clause - * + * transform a GROUP BY clause */ List * transformGroupClause(ParseState *pstate, List *grouplist, List *targetlist) @@ -1151,7 +1150,7 @@ transformGroupClause(ParseState *pstate, List *grouplist, List *targetlist) grpcl->tleSortGroupRef = assignSortGroupRef(tle, targetlist); - grpcl->sortop = any_ordering_op(tle->resdom->restype); + grpcl->sortop = ordering_oper_opid(tle->resdom->restype); glist = lappend(glist, grpcl); } @@ -1331,7 +1330,7 @@ addAllTargetsToSortList(List *sortlist, List *targetlist) * addTargetToSortList * If the given targetlist entry isn't already in the ORDER BY list, * add it to the end of the list, using the sortop with given name - * or any available sort operator if opname == NIL. + * or the default sort operator if opname == NIL. * * Returns the updated ORDER BY list. */ @@ -1352,7 +1351,7 @@ addTargetToSortList(TargetEntry *tle, List *sortlist, List *targetlist, tle->resdom->restype, false); else - sortcl->sortop = any_ordering_op(tle->resdom->restype); + sortcl->sortop = ordering_oper_opid(tle->resdom->restype); sortlist = lappend(sortlist, sortcl); } |