Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6fc9d42

Browse files
committed
Revert my erroneous fix for Taiki Yamaguchi's DISTINCT MAX() bug.
Whatever we do about that, this isn't the path to the solution.
1 parent 2b350bc commit 6fc9d42

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

src/backend/optimizer/plan/planner.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.229 2008/03/28 02:00:11 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.230 2008/03/29 00:15:28 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -835,21 +835,6 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
835835

836836
MemSet(&agg_counts, 0, sizeof(AggClauseCounts));
837837

838-
/*
839-
* If the query involves ungrouped aggregation, then it can produce
840-
* at most one row, so we can ignore any ORDER BY or DISTINCT
841-
* request. This isn't all that exciting as an optimization, but it
842-
* prevents a corner case when optimize_minmax_aggregates succeeds:
843-
* if ORDER BY or DISTINCT were present we'd try, and fail, to match
844-
* the EquivalenceClasses we're about to build with the modified
845-
* targetlist entries it will create.
846-
*/
847-
if (parse->hasAggs && parse->groupClause == NIL)
848-
{
849-
parse->sortClause = NIL;
850-
parse->distinctClause = NIL;
851-
}
852-
853838
/* Preprocess targetlist */
854839
tlist = preprocess_targetlist(root, tlist);
855840

0 commit comments

Comments
 (0)