Skip to content

Commit

Permalink
window function: function name of error message should be lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
kanchairen authored and SunRunAway committed Jul 8, 2019
1 parent 94d8127 commit b43af42
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -3148,7 +3148,7 @@ func (b *PlanBuilder) buildWindowFunctions(p LogicalPlan, groupedFuncs map[*ast.
return nil, nil, err
}
if desc == nil {
return nil, nil, ErrWrongArguments.GenWithStackByArgs(windowFunc.F)
return nil, nil, ErrWrongArguments.GenWithStackByArgs(strings.ToLower(windowFunc.F))
}
preArgs += len(windowFunc.Args)
desc.WrapCastForAggArgs(b.ctx)
Expand Down
4 changes: 4 additions & 0 deletions planner/core/logical_plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2263,6 +2263,10 @@ func (s *testPlanSuite) TestWindowFunction(c *C) {
sql: "select nth_value(a, 1.0) over() from t",
result: "[planner:1210]Incorrect arguments to nth_value",
},
{
sql: "SELECT NTH_VALUE(a, 1.0) OVER() FROM t",
result: "[planner:1210]Incorrect arguments to nth_value",
},
{
sql: "select nth_value(a, 0) over() from t",
result: "[planner:1210]Incorrect arguments to nth_value",
Expand Down

0 comments on commit b43af42

Please sign in to comment.