Skip to content

Commit 7177291

Browse files
zhaoyanxingSunRunAway
zhaoyanxing
authored andcommitted
window function: function name of error message should be lowercase (#11047)
1 parent 58f5632 commit 7177291

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
@@ -3134,7 +3134,7 @@ func (b *PlanBuilder) buildWindowFunctions(p LogicalPlan, groupedFuncs map[*ast.
31343134
return nil, nil, err
31353135
}
31363136
if desc == nil {
3137-
return nil, nil, ErrWrongArguments.GenWithStackByArgs(windowFunc.F)
3137+
return nil, nil, ErrWrongArguments.GenWithStackByArgs(strings.ToLower(windowFunc.F))
31383138
}
31393139
preArgs += len(windowFunc.Args)
31403140
desc.WrapCastForAggArgs(b.ctx)

planner/core/logical_plan_test.go

+4
Original file line numberDiff line numberDiff line change
@@ -2285,6 +2285,10 @@ func (s *testPlanSuite) TestWindowFunction(c *C) {
22852285
sql: "select nth_value(a, 1.0) over() from t",
22862286
result: "[planner:1210]Incorrect arguments to nth_value",
22872287
},
2288+
{
2289+
sql: "SELECT NTH_VALUE(a, 1.0) OVER() FROM t",
2290+
result: "[planner:1210]Incorrect arguments to nth_value",
2291+
},
22882292
{
22892293
sql: "select nth_value(a, 0) over() from t",
22902294
result: "[planner:1210]Incorrect arguments to nth_value",

0 commit comments

Comments
 (0)