-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
panic because of slice bounds out of range #20552
Comments
[2020/10/21 13:19:49.532 +08:00] [ERROR] [conn.go:727] ["connection running loop panic"] [conn=1] [lastSQL="SELECT * FROM t1 WHERE ISNULL(t1.a IN (SELECT t3.a FROM t1 t3))"] [err="runtime error: slice bounds out of range [-1:]"] [stack="goroutine 431 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x69d0ac0, 0xc00f800cc0, 0xc00f631180)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/server/conn.go:725 +0xee\npanic(0x620d180, 0xc0101f8c20)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/planner/core.(*expressionRewriter).funcCallToExpression(0xc010119860, 0xc010119790)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:1576 +0xabb\ngithub.com/pingcap/tidb/planner/core.(*expressionRewriter).Leave(0xc010119860, 0x69d1d80, 0xc010119790, 0x69fd7c0, 0xc010228840, 0x64fef01)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:982 +0x19c7\ngithub.com/pingcap/parser/ast.(*FuncCallExpr).Accept(0xc010119790, 0x699c280, 0xc010119860, 0xc0100fc780, 0xc00fc45f10, 0x0)\n\t/Users/liuzhuomin/go/pkg/mod/github.com/pingcap/parser@v0.0.0-20201014065945-fb6bde872a79/ast/functions.go:523 +0x182\ngithub.com/pingcap/tidb/planner/core.(*PlanBuilder).rewriteExprNode(0xc010215540, 0xc010119860, 0x69fd4c0, 0xc010119790, 0xc0100fc700, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:194 +0x8e\ngithub.com/pingcap/tidb/planner/core.(*PlanBuilder).rewriteWithPreprocess(0xc010215540, 0x69d0ac0, 0xc010232b10, 0x69fd4c0, 0xc010119790, 0x6a19ac0, 0xc0100fc780, 0x0, 0x0, 0x0, ...)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:141 +0x163\ngithub.com/pingcap/tidb/planner/core.(*PlanBuilder).rewrite(0xc010215540, 0x69d0ac0, 0xc010232b10, 0x69fd4c0, 0xc010119790, 0x6a19ac0, 0xc0100fc780, 0x0, 0x0, 0x0, ...)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/expression_rewriter.go:109 +0xb9\ngithub.com/pingcap/tidb/planner/core.(*PlanBuilder).buildSelection(0xc010215540, 0x69d0ac0, 0xc010232b10, 0x6a19ac0, 0xc0100fc780, 0x69fd4c0, 0xc010119790, 0x0, 0x2, 0x0, ...)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/logical_plan_builder.go:820 +0x216\ngithub.com/pingcap/tidb/planner/core.(*PlanBuilder).buildSelect(0xc010215540, 0x69d0ac0, 0xc010232b10, 0xc00f765770, 0x6a19ac0, 0xc0100fc780, 0x0, 0x0)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/logical_plan_builder.go:2712 +0x1667\ngithub.com/pingcap/tidb/planner/core.(*PlanBuilder).Build(0xc010215540, 0x69d0ac0, 0xc010232b10, 0x69d2940, 0xc00f765770, 0xc010215540, 0xc0101ebf40, 0x85908c0, 0x69d0ac0)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/core/planbuilder.go:592 +0xb37\ngithub.com/pingcap/tidb/planner.optimize(0x69d0ac0, 0xc010232b10, 0x6a1b1c0, 0xc0005eed20, 0x69d2940, 0xc00f765770, 0x6a0f080, 0xc00fc97680, 0x0, 0x0, ...)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/optimize.go:215 +0x1e9\ngithub.com/pingcap/tidb/planner.Optimize(0x69d0ac0, 0xc010232b10, 0x6a1b1c0, 0xc0005eed20, 0x69d2940, 0xc00f765770, 0x6a0f080, 0xc00fc97680, 0x0, 0x0, ...)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/planner/optimize.go:114 +0x354\ngithub.com/pingcap/tidb/executor.(*Compiler).Compile(0xc00fc46da0, 0x69d0ac0, 0xc010232b10, 0x69da600, 0xc00f765770, 0x0, 0x0, 0x0)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/executor/compiler.go:62 +0x294\ngithub.com/pingcap/tidb/session.(*session).ExecuteStmt(0xc0005eed20, 0x69d0ac0, 0xc010232a20, 0x69da600, 0xc00f765770, 0x0, 0x0, 0x0, 0x0)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/session/session.go:1189 +0x1db\ngithub.com/pingcap/tidb/server.(*TiDBContext).ExecuteStmt(0xc00f801080, 0x69d0ac0, 0xc010232a20, 0x69da600, 0xc00f765770, 0xc00f6e5170, 0x69d0ac0, 0xc010232a20, 0x60fb1c0)\n\t/Users/liuzhuomin/.gvm/pkgsets/go1.13/global/src/github.com/pingcap/tidb/server/driver_tidb.go:198 +0x68\ngithub.com/pingcap/tidb/server.(*clientConn).h"] |
@winoros PTAL. |
it seems when invoke |
This issue can be closed because #19797 fixed it. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
Bug1. Root Cause Analysis (RCA) (optional)
2. Symptom (optional)SQLs like 3. All Trigger Conditions (optional)use IN subquery inside a function call or a CASE...WHEN... operator 4. Workaround (optional)5. Affected versions[v4.0.0:v4.0.8] 6. Fixed versions4.0.9 |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: