Skip to content

Commit c352e0d

Browse files
SunRunAwayzz-jason
authored andcommitted
window function: function name of error message should be lowe… (#11118)
1 parent 9148566 commit c352e0d

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
@@ -2281,6 +2281,10 @@ func (s *testPlanSuite) TestWindowFunction(c *C) {
22812281
sql: "select nth_value(a, 1.0) over() from t",
22822282
result: "[planner:1210]Incorrect arguments to nth_value",
22832283
},
2284+
{
2285+
sql: "SELECT NTH_VALUE(a, 1.0) OVER() FROM t",
2286+
result: "[planner:1210]Incorrect arguments to nth_value",
2287+
},
22842288
{
22852289
sql: "select nth_value(a, 0) over() from t",
22862290
result: "[planner:1210]Incorrect arguments to nth_value",

0 commit comments

Comments
 (0)