Skip to content
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

Unexpected panic in simplifyOuterJoin #14514

Closed
XuHuaiyu opened this issue Jan 17, 2020 · 0 comments · Fixed by #14515
Closed

Unexpected panic in simplifyOuterJoin #14514

XuHuaiyu opened this issue Jan 17, 2020 · 0 comments · Fixed by #14515
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.

Comments

@XuHuaiyu
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
create table t (pk varchar(14) primary key, a varchar(12));
select * from (select t1.pk or '/' as c from t as t1 left join t as t2 on t1.a = t2.pk) as t where t.c = 1;
  1. What did you expect to see?
    query executes without panic

  2. What did you see instead?

[2020/01/17 16:13:56.128 +08:00] [ERROR] [terror.go:360] ["encountered error"] [error="[expression:1305]FUNCTION amldb.sig_*expression.builtinrealistruesig does not exist"]
[2020/01/17 16:13:56.128 +08:00] [ERROR] [conn.go:625] ["connection running loop panic"] [conn=1] [lastSQL="select * from (select t1.pk or '/' as c from t as t1 left join t as t2 on t1.a = t2.pk) as t where t.c = 1"] [err="runtime error: invalid memory address or nil pointer dereference"] [stack="goroutine 274 [running]:\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0x5c609a0, 0xc001b62120, 0xc0001b2d00)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/conn.go:623 +0xee\npanic(0x565cd80, 0x6fd41d0)\n\t/Users/xuhuaiyu/.gvm/gos/go1.13/src/runtime/panic.go:679 +0x1b2\ngithub.com/pingcap/tidb/expression.wrapWithIsTrue(0x5cb5680, 0xc000cf0700, 0x1, 0x0, 0x0, 0x0, 0x5c25440, 0xc001727bd0, 0x400e3b6)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/expression.go:722 +0x37\ngithub.com/pingcap/tidb/expression.(*logicOrFunctionClass).getFunction(0xc00031e300, 0x5cb5680, 0xc000cf0700, 0xc001708740, 0x2, 0x2, 0x2, 0x2, 0xc001708720, 0xc0015c7301)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/builtin_op.go:120 +0xcc\ngithub.com/pingcap/tidb/expression.newFunctionImpl(0x5cb5680, 0xc000cf0700, 0xc0015c7301, 0x58ff240, 0x2, 0xc001712a80, 0xc0017086c0, 0x2, 0x2, 0x1, ...)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/scalar_function.go:152 +0x21d\ngithub.com/pingcap/tidb/expression.NewFunction(...)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/scalar_function.go:172\ngithub.com/pingcap/tidb/expression.NewFunctionInternal(0x5cb5680, 0xc000cf0700, 0x58ff240, 0x2, 0xc001712a80, 0xc0017086c0, 0x2, 0x2, 0x2, 0x2)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/scalar_function.go:182 +0x92\ngithub.com/pingcap/tidb/expression.EvaluateExprWithNull(0x5cb5680, 0xc000cf0700, 0xc001609890, 0x5cb9b00, 0xc0016b0910, 0xc000cf0700, 0x4ffdaa1)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/expression.go:585 +0x1e7\ngithub.com/pingcap/tidb/expression.EvaluateExprWithNull(0x5cb5680, 0xc000cf0700, 0xc001609890, 0x5cb9b00, 0xc0016b0a00, 0x5cb9b00, 0xc0016b0a00)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/expression/expression.go:583 +0x13e\ngithub.com/pingcap/tidb/planner/core.isNullRejected(0x5cb5680, 0xc000cf0700, 0xc001609890, 0x5cb9b00, 0xc0016b0a00, 0xc001727fe0)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:342 +0xbf\ngithub.com/pingcap/tidb/planner/core.simplifyOuterJoin(0xc001710000, 0xc0015c7380, 0x1, 0x1)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:322 +0x154\ngithub.com/pingcap/tidb/planner/core.(*LogicalJoin).PredicatePushDown(0xc001710000, 0xc0015c7380, 0x1, 0x1, 0x2, 0x2, 0xc001708600, 0x2, 0x2)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:113 +0x6a\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).PredicatePushDown(0xc001673990, 0xc0015c7380, 0x1, 0x1, 0x1, 0x1, 0xc001708401, 0x5cb9b00, 0xc0016b0a00)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:55 +0xa6\ngithub.com/pingcap/tidb/planner/core.(*LogicalProjection).PredicatePushDown(0xc001673970, 0xc0015c7360, 0x1, 0x1, 0x705b448, 0x0, 0x0, 0x0, 0x1)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:374 +0x278\ngithub.com/pingcap/tidb/planner/core.(*LogicalSelection).PredicatePushDown(0xc00168f680, 0x705b448, 0x0, 0x0, 0x404869c, 0x0, 0x5832540, 0x5cb9701, 0x705b448)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:76 +0x166\ngithub.com/pingcap/tidb/planner/core.(*baseLogicalPlan).PredicatePushDown(0xc001673af0, 0x705b448, 0x0, 0x0, 0xc001673af0, 0xc0015c7310, 0x1, 0x1, 0x1)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:55 +0xa6\ngithub.com/pingcap/tidb/planner/core.(*LogicalProjection).PredicatePushDown(0xc001673ad0, 0x0, 0x0, 0x0, 0x705c7c0, 0xc001609f00, 0xc000d6d950, 0x5707c40, 0xc000d6d950)\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/planner/core/rule_predicate_push_down.go:374 +0x278\ngithub.com/pingcap/tidb/planner/core.(*ppdSolver).optimize(0x705b000, 0x5c6"]

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
Release Version: v4.0.0-alpha-1373-g74bc00dfa
Git Commit Hash: 74bc00dfa953da06d8e5823d0acbf6bf1858a680
Git Branch: master
UTC Build Time: 2020-01-17 04:49:16
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/planner SIG: Planner type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants