{"action":"closed","issue":{"url":"https://api.github.com/repos/pingcap/tidb/issues/5339","repository_url":"https://api.github.com/repos/pingcap/tidb","labels_url":"https://api.github.com/repos/pingcap/tidb/issues/5339/labels{/name}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/5339/comments","events_url":"https://api.github.com/repos/pingcap/tidb/issues/5339/events","html_url":"https://github.com/pingcap/tidb/issues/5339","id":280085487,"number":5339,"title":"unsupported aggregate function caused a \"nil pointer dereference\" panic","user":{"login":"XuHuaiyu","id":9039012,"avatar_url":"https://avatars1.githubusercontent.com/u/9039012?v=4","gravatar_id":"","url":"https://api.github.com/users/XuHuaiyu","html_url":"https://github.com/XuHuaiyu","followers_url":"https://api.github.com/users/XuHuaiyu/followers","following_url":"https://api.github.com/users/XuHuaiyu/following{/other_user}","gists_url":"https://api.github.com/users/XuHuaiyu/gists{/gist_id}","starred_url":"https://api.github.com/users/XuHuaiyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XuHuaiyu/subscriptions","organizations_url":"https://api.github.com/users/XuHuaiyu/orgs","repos_url":"https://api.github.com/users/XuHuaiyu/repos","events_url":"https://api.github.com/users/XuHuaiyu/events{/privacy}","received_events_url":"https://api.github.com/users/XuHuaiyu/received_events","type":"User","site_admin":false},"labels":[{"id":256872086,"url":"https://api.github.com/repos/pingcap/tidb/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":{"login":"zz-jason","id":5268763,"avatar_url":"https://avatars0.githubusercontent.com/u/5268763?v=4","gravatar_id":"","url":"https://api.github.com/users/zz-jason","html_url":"https://github.com/zz-jason","followers_url":"https://api.github.com/users/zz-jason/followers","following_url":"https://api.github.com/users/zz-jason/following{/other_user}","gists_url":"https://api.github.com/users/zz-jason/gists{/gist_id}","starred_url":"https://api.github.com/users/zz-jason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zz-jason/subscriptions","organizations_url":"https://api.github.com/users/zz-jason/orgs","repos_url":"https://api.github.com/users/zz-jason/repos","events_url":"https://api.github.com/users/zz-jason/events{/privacy}","received_events_url":"https://api.github.com/users/zz-jason/received_events","type":"User","site_admin":false},"assignees":[{"login":"zz-jason","id":5268763,"avatar_url":"https://avatars0.githubusercontent.com/u/5268763?v=4","gravatar_id":"","url":"https://api.github.com/users/zz-jason","html_url":"https://github.com/zz-jason","followers_url":"https://api.github.com/users/zz-jason/followers","following_url":"https://api.github.com/users/zz-jason/following{/other_user}","gists_url":"https://api.github.com/users/zz-jason/gists{/gist_id}","starred_url":"https://api.github.com/users/zz-jason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zz-jason/subscriptions","organizations_url":"https://api.github.com/users/zz-jason/orgs","repos_url":"https://api.github.com/users/zz-jason/repos","events_url":"https://api.github.com/users/zz-jason/events{/privacy}","received_events_url":"https://api.github.com/users/zz-jason/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2017-12-07T10:55:27Z","updated_at":"2018-03-20T11:44:42Z","closed_at":"2018-03-20T11:44:42Z","author_association":"CONTRIBUTOR","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n1. What did you do?\r\n```\r\n./gentest.pl --dsn dbi:mysql:host=127.0.0.1:port=4000:user=root:database=test --grammar=conf/subquery_semijoin.yy --gendata --thread=1\r\n```\r\n\r\n``` sql\r\n\r\nSELECT DISTINCT BIT_OR( OUTR . `col_varchar_key` ) AS X FROM C AS OUTR WHERE ( OUTR . `col_int_key` , OUTR . `col_int_nokey` ) IN ( SELECT DISTINCT INNR . `col_int_nokey` AS X , INNR . `col_int_key` AS Y FROM CC AS INNR2 LEFT JOIN BB AS INNR ON ( INNR2 . `col_varchar_key` < INNR . `col_varchar_nokey` ) WHERE OUTR . `col_time_nokey` >= '2003-04-22' ORDER BY INNR . `col_int_nokey` ) AND OUTR . `col_varchar_nokey` IS NULL  ORDER BY OUTR . `col_varchar_nokey` , OUTR . `pk`;\r\n```\r\n[aggissue.txt](https://github.com/pingcap/tidb/files/1538764/aggissue.txt)\r\n2. What did you expect to see?\r\n\r\nno error\r\n\r\n3. What did you see instead?\r\n\r\n```\r\nruntime error: invalid memory address or nil pointer dereference, goroutine 30848 [running]:\r\ngithub.com/pingcap/tidb/server.(*clientConn).Run.func1(0xc420b04b00)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/conn.go:389 +0xfd\r\npanic(0x1c4fa20, 0x274d2f0)\r\n\t/Users/xuhuaiyu/.gvm/gos/go1.9/src/runtime/panic.go:491 +0x283\r\ngithub.com/pingcap/tidb/plan.(*planBuilder).buildAggregation(0xc4211ac1e0, 0x2561980, 0xc420c46780, 0xc421646290, 0x1, 0x1, 0x0, 0x0, 0x0, 0xc420cbae01, ...)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:100 +0x837\r\ngithub.com/pingcap/tidb/plan.(*planBuilder).buildSelect(0xc4211ac1e0, 0xc4211ac140, 0x0, 0x0)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/plan/logical_plan_builder.go:1503 +0x992\r\ngithub.com/pingcap/tidb/plan.(*planBuilder).build(0xc4211ac1e0, 0x253d900, 0xc4211ac140, 0x0, 0xc420c46660)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/plan/planbuilder.go:189 +0x55b\r\ngithub.com/pingcap/tidb/plan.Optimize(0x254b7a0, 0xc4213b7a70, 0x253d900, 0xc4211ac140, 0x25497c0, 0xc4211e3950, 0x27be900, 0x0, 0x0, 0xc4205b3870)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/plan/optimizer.go:66 +0x12c\r\ngithub.com/pingcap/tidb/executor.(*Compiler).Compile(0xc4205b3aa0, 0x2b571c8, 0xc420cbadc0, 0x2541740, 0xc4211ac140, 0x0, 0x0, 0x0)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/executor/compiler.go:44 +0x1eb\r\ngithub.com/pingcap/tidb.(*session).Execute(0xc4213b7a70, 0x2b57208, 0xc420c46120, 0xc4201505a1, 0x1d9, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/session.go:761 +0xb8c\r\ngithub.com/pingcap/tidb/server.(*TiDBContext).Execute(0xc421057650, 0x2b57208, 0xc420c46120, 0xc4201505a1, 0x1d9, 0xc4205b3c60, 0x1029ee9, 0xc4209b07b0, 0xc4205b3c80, 0x20)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/driver_tidb.go:196 +0x7c\r\ngithub.com/pingcap/tidb/server.(*clientConn).handleQuery(0xc420b04b00, 0x2b57208, 0xc420c46120, 0xc4201505a1, 0x1d9, 0x0, 0x0)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/conn.go:741 +0x8d\r\ngithub.com/pingcap/tidb/server.(*clientConn).dispatch(0xc420b04b00, 0xc4201505a1, 0x1da, 0x1da, 0x0, 0x0)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/conn.go:530 +0x511\r\ngithub.com/pingcap/tidb/server.(*clientConn).Run(0xc420b04b00)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/conn.go:412 +0x18a\r\ngithub.com/pingcap/tidb/server.(*Server).onConn(0xc4203fce40, 0x2547620, 0xc4202dbb60)\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/server.go:315 +0x144\r\ncreated by github.com/pingcap/tidb/server.(*Server).Run\r\n\t/Users/xuhuaiyu/Development/GOPATH/src/github.com/pingcap/tidb/server/server.go:261 +0x496\r\n```\r\n\r\n4. What version of TiDB are you using (`tidb-server -V`)?\r\n\r\n`648e51d19e51120e9158f6333c060f17260b7ea6`"}}
{"actor":{"display_login":"zz-jason"}}