Skip to content

Commit b43af42

Browse files
kanchairenSunRunAway
kanchairen
authored andcommitted
window function: function name of error message should be lowercase
1 parent 94d8127 commit b43af42

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

planner/core/logical_plan_builder.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3148,7 +3148,7 @@ func (b *PlanBuilder) buildWindowFunctions(p LogicalPlan, groupedFuncs map[*ast.
31483148
return nil, nil, err
31493149
}
31503150
if desc == nil {
3151-
return nil, nil, ErrWrongArguments.GenWithStackByArgs(windowFunc.F)
3151+
return nil, nil, ErrWrongArguments.GenWithStackByArgs(strings.ToLower(windowFunc.F))
31523152
}
31533153
preArgs += len(windowFunc.Args)
31543154
desc.WrapCastForAggArgs(b.ctx)

planner/core/logical_plan_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,10 @@ func (s *testPlanSuite) TestWindowFunction(c *C) {
22632263
sql: "select nth_value(a, 1.0) over() from t",
22642264
result: "[planner:1210]Incorrect arguments to nth_value",
22652265
},
2266+
{
2267+
sql: "SELECT NTH_VALUE(a, 1.0) OVER() FROM t",
2268+
result: "[planner:1210]Incorrect arguments to nth_value",
2269+
},
22662270
{
22672271
sql: "select nth_value(a, 0) over() from t",
22682272
result: "[planner:1210]Incorrect arguments to nth_value",

0 commit comments

Comments
 (0)