Skip to content

Commit

Permalink
Mark aggregate functions callable (vitessio#10805)
Browse files Browse the repository at this point in the history
These should also implement the iCallable interface as they are also
callable as functions.

Signed-off-by: Dirkjan Bussink <[email protected]>
  • Loading branch information
dbussink authored Jul 25, 2022
1 parent 8149db5 commit 059e84c
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 1 deletion.
7 changes: 7 additions & 0 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -3059,6 +3059,13 @@ func (*UpdateXMLExpr) iCallable() {}
func (*PerformanceSchemaFuncExpr) iCallable() {}
func (*GTIDFuncExpr) iCallable() {}

func (*Sum) iCallable() {}
func (*Min) iCallable() {}
func (*Max) iCallable() {}
func (*Avg) iCallable() {}
func (*CountStar) iCallable() {}
func (*Count) iCallable() {}

func (sum *Sum) GetArg() Expr { return sum.Arg }
func (min *Min) GetArg() Expr { return min.Arg }
func (max *Max) GetArg() Expr { return max.Arg }
Expand Down
12 changes: 12 additions & 0 deletions go/vt/sqlparser/ast_clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions go/vt/sqlparser/ast_equals.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions go/vt/sqlparser/ast_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions go/vt/sqlparser/ast_visit.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion go/vt/vtgate/engine/cached_size.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 059e84c

Please sign in to comment.