payload: {"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/305208033","pull_request_review_id":264021829,"id":305208033,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMwNTIwODAzMw==","diff_hunk":"@@ -591,12 +591,10 @@ func (b *PlanBuilder) buildSelection(p LogicalPlan, where ast.ExprNode, AggMappe\n }\n \n // buildProjectionFieldNameFromColumns builds the field name, table name and database name when field expression is a column reference.\n-func (b *PlanBuilder) buildProjectionFieldNameFromColumns(field *ast.SelectField, c *expression.Column) (colName, origColName, tblName, origTblName, dbName model.CIStr) {\n-\tif astCol, ok := getInnerFromParenthesesAndUnaryPlus(field.Expr).(*ast.ColumnNameExpr); ok {\n-\t\torigColName, tblName, dbName = astCol.Name.Name, astCol.Name.Table, astCol.Name.Schema\n-\t}\n-\tif field.AsName.L != \"\" {\n-\t\tcolName = field.AsName\n+func (b *PlanBuilder) buildProjectionFieldNameFromColumns(origField *ast.SelectField, colNameField *ast.ColumnNameExpr, c *expression.Column) (colName, origColName, tblName, origTblName, dbName model.CIStr) {","path":"planner/core/logical_plan_builder.go","position":10,"original_position":10,"commit_id":"e0fbef222d3d9b227deb5d46ded25b7883cb6aeb","original_commit_id":"e0fbef222d3d9b227deb5d46ded25b7883cb6aeb","user":{"login":"winoros","id":7846227,"node_id":"MDQ6VXNlcjc4NDYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/7846227?v=4","gravatar_id":"","url":"https://api.github.com/users/winoros","html_url":"https://github.com/winoros","followers_url":"https://api.github.com/users/winoros/followers","following_url":"https://api.github.com/users/winoros/following{/other_user}","gists_url":"https://api.github.com/users/winoros/gists{/gist_id}","starred_url":"https://api.github.com/users/winoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winoros/subscriptions","organizations_url":"https://api.github.com/users/winoros/orgs","repos_url":"https://api.github.com/users/winoros/repos","events_url":"https://api.github.com/users/winoros/events{/privacy}","received_events_url":"https://api.github.com/users/winoros/received_events","type":"User","site_admin":false},"body":"I prefer not to change the ast's content :joy:","created_at":"2019-07-19T05:42:13Z","updated_at":"2019-07-19T05:42:13Z","html_url":"https://github.com/pingcap/tidb/pull/11324#discussion_r305208033","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/11324","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/305208033"},"html":{"href":"https://github.com/pingcap/tidb/pull/11324#discussion_r305208033"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11324"}},"in_reply_to_id":305184009},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/11324","id":298888040,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjk4ODg4MDQw","html_url":"https://github.com/pingcap/tidb/pull/11324","diff_url":"https://github.com/pingcap/tidb/pull/11324.diff","patch_url":"https://github.com/pingcap/tidb/pull/11324.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/11324","number":11324,"state":"open","locked":false,"title":"planner: correct the generation of the field name","user":{"login":"winoros","id":7846227,"node_id":"MDQ6VXNlcjc4NDYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/7846227?v=4","gravatar_id":"","url":"https://api.github.com/users/winoros","html_url":"https://github.com/winoros","followers_url":"https://api.github.com/users/winoros/followers","following_url":"https://api.github.com/users/winoros/following{/other_user}","gists_url":"https://api.github.com/users/winoros/gists{/gist_id}","starred_url":"https://api.github.com/users/winoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winoros/subscriptions","organizations_url":"https://api.github.com/users/winoros/orgs","repos_url":"https://api.github.com/users/winoros/repos","events_url":"https://api.github.com/users/winoros/events{/privacy}","received_events_url":"https://api.github.com/users/winoros/received_events","type":"User","site_admin":false},"body":"<!--\r\nThank you for contributing to TiDB! Please read TiDB's [CONTRIBUTING](https://github.com/pingcap/tidb/blob/master/CONTRIBUTING.md) document **BEFORE** filing this PR.\r\n-->\r\n\r\n### What problem does this PR solve? <!--add issue link with summary if exists-->\r\n\r\nfix #11313 \r\n\r\n### What is changed and how it works?\r\n\r\n`*expression.Column` may be generated from a simplified expression.\r\nBut one `ast.ColumnNameExpr` must refer to a column, though it may be a correlated column.\r\nSo check the ast instead of the expr.\r\n\r\n### Check List <!--REMOVE the items that are not applicable-->\r\n\r\nTests <!-- At least one of them must be included. -->\r\n\r\n - Unit test\r\n","created_at":"2019-07-18T12:21:06Z","updated_at":"2019-07-19T05:42:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afb57629ae327940a04f157f5eb597bc6842ce3b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"zz-jason","id":5268763,"node_id":"MDQ6VXNlcjUyNjg3NjM=","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},{"login":"eurekaka","id":6261973,"node_id":"MDQ6VXNlcjYyNjE5NzM=","avatar_url":"https://avatars2.githubusercontent.com/u/6261973?v=4","gravatar_id":"","url":"https://api.github.com/users/eurekaka","html_url":"https://github.com/eurekaka","followers_url":"https://api.github.com/users/eurekaka/followers","following_url":"https://api.github.com/users/eurekaka/following{/other_user}","gists_url":"https://api.github.com/users/eurekaka/gists{/gist_id}","starred_url":"https://api.github.com/users/eurekaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eurekaka/subscriptions","organizations_url":"https://api.github.com/users/eurekaka/orgs","repos_url":"https://api.github.com/users/eurekaka/repos","events_url":"https://api.github.com/users/eurekaka/events{/privacy}","received_events_url":"https://api.github.com/users/eurekaka/received_events","type":"User","site_admin":false},{"login":"qw4990","id":7499936,"node_id":"MDQ6VXNlcjc0OTk5MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/7499936?v=4","gravatar_id":"","url":"https://api.github.com/users/qw4990","html_url":"https://github.com/qw4990","followers_url":"https://api.github.com/users/qw4990/followers","following_url":"https://api.github.com/users/qw4990/following{/other_user}","gists_url":"https://api.github.com/users/qw4990/gists{/gist_id}","starred_url":"https://api.github.com/users/qw4990/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qw4990/subscriptions","organizations_url":"https://api.github.com/users/qw4990/orgs","repos_url":"https://api.github.com/users/qw4990/repos","events_url":"https://api.github.com/users/qw4990/events{/privacy}","received_events_url":"https://api.github.com/users/qw4990/received_events","type":"User","site_admin":false},{"login":"lamxTyler","id":16222711,"node_id":"MDQ6VXNlcjE2MjIyNzEx","avatar_url":"https://avatars1.githubusercontent.com/u/16222711?v=4","gravatar_id":"","url":"https://api.github.com/users/lamxTyler","html_url":"https://github.com/lamxTyler","followers_url":"https://api.github.com/users/lamxTyler/followers","following_url":"https://api.github.com/users/lamxTyler/following{/other_user}","gists_url":"https://api.github.com/users/lamxTyler/gists{/gist_id}","starred_url":"https://api.github.com/users/lamxTyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lamxTyler/subscriptions","organizations_url":"https://api.github.com/users/lamxTyler/orgs","repos_url":"https://api.github.com/users/lamxTyler/repos","events_url":"https://api.github.com/users/lamxTyler/events{/privacy}","received_events_url":"https://api.github.com/users/lamxTyler/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":667671533,"node_id":"MDU6TGFiZWw2Njc2NzE1MzM=","url":"https://api.github.com/repos/pingcap/tidb/labels/component/planner","name":"component/planner","color":"1d76db","default":false},{"id":1433635220,"node_id":"MDU6TGFiZWwxNDMzNjM1MjIw","url":"https://api.github.com/repos/pingcap/tidb/labels/needs-cherry-pick-2.1","name":"needs-cherry-pick-2.1","color":"000000","default":false},{"id":1433635481,"node_id":"MDU6TGFiZWwxNDMzNjM1NDgx","url":"https://api.github.com/repos/pingcap/tidb/labels/needs-cherry-pick-3.0","name":"needs-cherry-pick-3.0","color":"000000","default":false},{"id":630229257,"node_id":"MDU6TGFiZWw2MzAyMjkyNTc=","url":"https://api.github.com/repos/pingcap/tidb/labels/type/bug-fix","name":"type/bug-fix","color":"fc2929","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/11324/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/11324/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/11324/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/e0fbef222d3d9b227deb5d46ded25b7883cb6aeb","head":{"label":"winoros:fix-column-name","ref":"fix-column-name","sha":"e0fbef222d3d9b227deb5d46ded25b7883cb6aeb","user":{"login":"winoros","id":7846227,"node_id":"MDQ6VXNlcjc4NDYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/7846227?v=4","gravatar_id":"","url":"https://api.github.com/users/winoros","html_url":"https://github.com/winoros","followers_url":"https://api.github.com/users/winoros/followers","following_url":"https://api.github.com/users/winoros/following{/other_user}","gists_url":"https://api.github.com/users/winoros/gists{/gist_id}","starred_url":"https://api.github.com/users/winoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winoros/subscriptions","organizations_url":"https://api.github.com/users/winoros/orgs","repos_url":"https://api.github.com/users/winoros/repos","events_url":"https://api.github.com/users/winoros/events{/privacy}","received_events_url":"https://api.github.com/users/winoros/received_events","type":"User","site_admin":false},"repo":{"id":107362799,"node_id":"MDEwOlJlcG9zaXRvcnkxMDczNjI3OTk=","name":"tidb","full_name":"winoros/tidb","private":false,"owner":{"login":"winoros","id":7846227,"node_id":"MDQ6VXNlcjc4NDYyMjc=","avatar_url":"https://avatars1.githubusercontent.com/u/7846227?v=4","gravatar_id":"","url":"https://api.github.com/users/winoros","html_url":"https://github.com/winoros","followers_url":"https://api.github.com/users/winoros/followers","following_url":"https://api.github.com/users/winoros/following{/other_user}","gists_url":"https://api.github.com/users/winoros/gists{/gist_id}","starred_url":"https://api.github.com/users/winoros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winoros/subscriptions","organizations_url":"https://api.github.com/users/winoros/orgs","repos_url":"https://api.github.com/users/winoros/repos","events_url":"https://api.github.com/users/winoros/events{/privacy}","received_events_url":"https://api.github.com/users/winoros/received_events","type":"User","site_admin":false},"html_url":"https://github.com/winoros/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":true,"url":"https://api.github.com/repos/winoros/tidb","forks_url":"https://api.github.com/repos/winoros/tidb/forks","keys_url":"https://api.github.com/repos/winoros/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/winoros/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/winoros/tidb/teams","hooks_url":"https://api.github.com/repos/winoros/tidb/hooks","issue_events_url":"https://api.github.com/repos/winoros/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/winoros/tidb/events","assignees_url":"https://api.github.com/repos/winoros/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/winoros/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/winoros/tidb/tags","blobs_url":"https://api.github.com/repos/winoros/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/winoros/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/winoros/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/winoros/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/winoros/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/winoros/tidb/languages","stargazers_url":"https://api.github.com/repos/winoros/tidb/stargazers","contributors_url":"https://api.github.com/repos/winoros/tidb/contributors","subscribers_url":"https://api.github.com/repos/winoros/tidb/subscribers","subscription_url":"https://api.github.com/repos/winoros/tidb/subscription","commits_url":"https://api.github.com/repos/winoros/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/winoros/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/winoros/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/winoros/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/winoros/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/winoros/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/winoros/tidb/merges","archive_url":"https://api.github.com/repos/winoros/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/winoros/tidb/downloads","issues_url":"https://api.github.com/repos/winoros/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/winoros/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/winoros/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/winoros/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/winoros/tidb/labels{/name}","releases_url":"https://api.github.com/repos/winoros/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/winoros/tidb/deployments","created_at":"2017-10-18T05:29:31Z","updated_at":"2018-08-30T09:16:21Z","pushed_at":"2019-07-19T02:40:01Z","git_url":"git://github.com/winoros/tidb.git","ssh_url":"git@github.com:winoros/tidb.git","clone_url":"https://github.com/winoros/tidb.git","svn_url":"https://github.com/winoros/tidb","homepage":"https://pingcap.com","size":76137,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"3217bff3d04358c85168b5fbbab6a41e6c85e82b","user":{"login":"pingcap","id":11855343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODU1MzQz","avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":41986369,"node_id":"MDEwOlJlcG9zaXRvcnk0MTk4NjM2OQ==","name":"tidb","full_name":"pingcap/tidb","private":false,"owner":{"login":"pingcap","id":11855343,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExODU1MzQz","avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pingcap/tidb","description":"TiDB is a distributed HTAP database compatible with the MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2019-07-19T04:47:26Z","pushed_at":"2019-07-19T05:39:56Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"https://pingcap.com","size":135733,"stargazers_count":19768,"watchers_count":19768,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2870,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":984,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2870,"open_issues":984,"watchers":19768,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11324"},"html":{"href":"https://github.com/pingcap/tidb/pull/11324"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/11324"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/11324/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11324/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/11324/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/e0fbef222d3d9b227deb5d46ded25b7883cb6aeb"}},"author_association":"MEMBER"}}
other: {"actor":{"display_login":"winoros"}}