Skip to content

Commit d3e7ae8

Browse files
committed
commented out validation skip for parent nodes
1 parent 635d803 commit d3e7ae8

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

sql/analyzer/validation_rules.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,23 @@ func validateGroupBy(ctx *sql.Context, a *Analyzer, n sql.Node, scope *plan.Scop
249249
}
250250

251251
var err error
252-
var parent sql.Node
252+
//var parent sql.Node
253253
transform.Inspect(n, func(n sql.Node) bool {
254-
defer func() {
255-
parent = n
256-
}()
254+
//defer func() {
255+
// parent = n
256+
//}()
257257

258258
gb, ok := n.(*plan.GroupBy)
259259
if !ok {
260260
return true
261261
}
262262

263-
switch parent.(type) {
264-
case *plan.Having, *plan.Project, *plan.Sort:
265-
// TODO: these shouldn't be skipped; you can group by primary key without problem b/c only one value
266-
// https://dev.mysql.com/doc/refman/8.0/en/group-by-handling.html#:~:text=The%20query%20is%20valid%20if%20name%20is%20a%20primary%20key
267-
return true
268-
}
263+
//switch parent.(type) {
264+
//case *plan.Having, *plan.Project, *plan.Sort:
265+
// // TODO: these shouldn't be skipped; you can group by primary key without problem b/c only one value
266+
// // https://dev.mysql.com/doc/refman/8.0/en/group-by-handling.html#:~:text=The%20query%20is%20valid%20if%20name%20is%20a%20primary%20key
267+
// return true
268+
//}
269269

270270
// Allow the parser use the GroupBy node to eval the aggregation functions
271271
// for sql statements that don't make use of the GROUP BY expression.

0 commit comments

Comments
 (0)