From f68f11928d5c791873073c882775dae10283ff49 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 29 Nov 2002 21:39:12 +0000 Subject: 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. --- src/backend/parser/parse_clause.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/backend/parser/parse_clause.c') 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); } -- cgit v1.2.3