diff options
author | Jan Wieck <JanWieck@Yahoo.com> | 1999-05-12 15:02:39 +0000 |
---|---|---|
committer | Jan Wieck <JanWieck@Yahoo.com> | 1999-05-12 15:02:39 +0000 |
commit | 79c2576f775b962c67cac136722c5c7cc98201aa (patch) | |
tree | 3da66174208ed6b258542dde2ba9f00c0e706c07 /src/backend/optimizer/util/tlist.c | |
parent | 1a87c14c9cf2c58009dd653c5356f68d605dff2f (diff) | |
download | postgresql-79c2576f775b962c67cac136722c5c7cc98201aa.tar.gz postgresql-79c2576f775b962c67cac136722c5c7cc98201aa.zip |
Replaced targetlist entry in GroupClause by reference number
in Resdom and GroupClause so changing of resno's doesn't confuse
the grouping any more.
Jan
Diffstat (limited to 'src/backend/optimizer/util/tlist.c')
-rw-r--r-- | src/backend/optimizer/util/tlist.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c index 6d25950bca0..a914930cc93 100644 --- a/src/backend/optimizer/util/tlist.c +++ b/src/backend/optimizer/util/tlist.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.29 1999/05/06 23:07:33 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/tlist.c,v 1.30 1999/05/12 15:01:44 wieck Exp $ * *------------------------------------------------------------------------- */ @@ -518,6 +518,25 @@ get_expr(TargetEntry *tle) } +Var * +get_groupclause_expr(GroupClause *groupClause, List *targetList) +{ + List *l; + TargetEntry *tle; + + foreach(l, targetList) + { + tle = (TargetEntry *)lfirst(l); + if (tle->resdom->resgroupref == groupClause->tleGroupref) + return get_expr(tle); + } + + elog(ERROR, + "get_groupclause_expr: GROUP BY expression not found in targetlist"); + return NULL; +} + + /***************************************************************************** * *****************************************************************************/ @@ -528,6 +547,11 @@ get_expr(TargetEntry *tle) * in there. */ #ifdef NOT_USED +/* + * WARNING!!! If this ever get's used again, the new reference + * mechanism from group clause to targetlist entry must be implemented + * here too. Jan + */ void AddGroupAttrToTlist(List *tlist, List *grpCl) { |