Skip to content

Commit 17278ed

Browse files
committed
added explanation comment
1 parent e64408d commit 17278ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sql/analyzer/validation_rules.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ func validateGroupBy(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scop
338338
}
339339
}
340340
case *plan.Project:
341+
// Project nodes that are direct children of Having nodes include aliases for columns that are part of an
342+
// aggregate function that aren't necessarily selected expressions and therefore shouldn't be validated
341343
if _, isHaving := parent.(*plan.Having); !isHaving {
342344
project = n
343345
orderBy = nil

0 commit comments

Comments
 (0)