Skip to content

Commit 114f783

Browse files
committed
update comment
1 parent 9370e74 commit 114f783

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

sql/analyzer/validation_rules.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,11 @@ func validateGroupBy(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scop
320320
return false
321321
}
322322
}
323-
// According to MySQL documentation, we should still be validating ORDER BY expressions ("If a query has
324-
// aggregate functions and no GROUP BY clause, it cannot have nonaggregated columns in the select list, HAVING
325-
// condition, or ORDER BY list with ONLY_FULL_GROUP_BY enabled"). But when testing actual queries in MySQL,
326-
// it doesn't seem like they validate ORDER BY expressions in aggregate queries without an explicit GROUP BY
323+
// According to MySQL documentation, we should still be validating ORDER BY expressions when there's not an
324+
// explicit GROUP BY in the query ("If a query has aggregate functions and no GROUP BY clause, it cannot
325+
// have nonaggregated columns in the select list, HAVING condition, or ORDER BY list with
326+
// ONLY_FULL_GROUP_BY enabled"). But when testing queries in MySQL, it doesn't seem like they actually
327+
// validate ORDER BY expressions in aggregate queries without an explicit GROUP BY
327328
if !noGroupBy {
328329
for i, expr := range orderByExprs {
329330
if valid, col := expressionReferencesOnlyGroupBys(groupBys, expr, noGroupBy); !valid {

0 commit comments

Comments
 (0)