{"action":"closed","number":30470,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30470","id":217055084,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3MDU1MDg0","html_url":"https://github.com/cockroachdb/cockroach/pull/30470","diff_url":"https://github.com/cockroachdb/cockroach/pull/30470.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/30470.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30470","number":30470,"state":"closed","locked":false,"title":"opt: fix panic with correlated subquery in WHERE","user":{"login":"rytaft","id":3288732,"node_id":"MDQ6VXNlcjMyODg3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/3288732?v=4","gravatar_id":"","url":"https://api.github.com/users/rytaft","html_url":"https://github.com/rytaft","followers_url":"https://api.github.com/users/rytaft/followers","following_url":"https://api.github.com/users/rytaft/following{/other_user}","gists_url":"https://api.github.com/users/rytaft/gists{/gist_id}","starred_url":"https://api.github.com/users/rytaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rytaft/subscriptions","organizations_url":"https://api.github.com/users/rytaft/orgs","repos_url":"https://api.github.com/users/rytaft/repos","events_url":"https://api.github.com/users/rytaft/events{/privacy}","received_events_url":"https://api.github.com/users/rytaft/received_events","type":"User","site_admin":false},"body":"This commit fixes a panic which was occuring when a correlated\r\naggregate was contained in a subquery in the `WHERE` clause, and\r\nthe level of aggregation was the outer query. For example:\r\n\r\n  `SELECT s FROM a WHERE (SELECT COUNT(i) >= 100) GROUP BY s`\r\n\r\nIn this case, `COUNT(i)` in the subquery is scoped at the level of\r\nthe outer query. Since it's not legal to have aggregates in the\r\nWHERE clause, this now causes an error instead of a panic.\r\n\r\nFixes #29114\r\nFixes #30424\r\n\r\nRelease note (bug fix): Fixed a panic when a correlated subquery\r\nin the WHERE clause contained an aggregate referencing the outer query.\r\nThis now causes an error since aggregates are not allowed in WHERE.","created_at":"2018-09-20T17:48:14Z","updated_at":"2018-09-21T20:57:43Z","closed_at":"2018-09-21T20:57:43Z","merged_at":"2018-09-21T20:57:43Z","merge_commit_sha":"6a2c90a9476584e13af51ed1394ac3960a4b2da0","assignee":null,"assignees":[],"requested_reviewers":[{"login":"justinj","id":409075,"node_id":"MDQ6VXNlcjQwOTA3NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/409075?v=4","gravatar_id":"","url":"https://api.github.com/users/justinj","html_url":"https://github.com/justinj","followers_url":"https://api.github.com/users/justinj/followers","following_url":"https://api.github.com/users/justinj/following{/other_user}","gists_url":"https://api.github.com/users/justinj/gists{/gist_id}","starred_url":"https://api.github.com/users/justinj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinj/subscriptions","organizations_url":"https://api.github.com/users/justinj/orgs","repos_url":"https://api.github.com/users/justinj/repos","events_url":"https://api.github.com/users/justinj/events{/privacy}","received_events_url":"https://api.github.com/users/justinj/received_events","type":"User","site_admin":false},{"login":"andy-kimball","id":32096062,"node_id":"MDQ6VXNlcjMyMDk2MDYy","avatar_url":"https://avatars0.githubusercontent.com/u/32096062?v=4","gravatar_id":"","url":"https://api.github.com/users/andy-kimball","html_url":"https://github.com/andy-kimball","followers_url":"https://api.github.com/users/andy-kimball/followers","following_url":"https://api.github.com/users/andy-kimball/following{/other_user}","gists_url":"https://api.github.com/users/andy-kimball/gists{/gist_id}","starred_url":"https://api.github.com/users/andy-kimball/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andy-kimball/subscriptions","organizations_url":"https://api.github.com/users/andy-kimball/orgs","repos_url":"https://api.github.com/users/andy-kimball/repos","events_url":"https://api.github.com/users/andy-kimball/events{/privacy}","received_events_url":"https://api.github.com/users/andy-kimball/received_events","type":"User","site_admin":false}],"requested_teams":[{"name":"sql-rest-prs","id":2437982,"node_id":"MDQ6VGVhbTI0Mzc5ODI=","slug":"sql-rest-prs","description":"Join this team for notifications about SQL PRs that do not fall in other buckets","privacy":"closed","url":"https://api.github.com/teams/2437982","members_url":"https://api.github.com/teams/2437982/members{/member}","repositories_url":"https://api.github.com/teams/2437982/repos","permission":"pull"}],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30470/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30470/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/30470/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/6a2c90a9476584e13af51ed1394ac3960a4b2da0","head":{"label":"rytaft:groupby-panic","ref":"groupby-panic","sha":"6a2c90a9476584e13af51ed1394ac3960a4b2da0","user":{"login":"rytaft","id":3288732,"node_id":"MDQ6VXNlcjMyODg3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/3288732?v=4","gravatar_id":"","url":"https://api.github.com/users/rytaft","html_url":"https://github.com/rytaft","followers_url":"https://api.github.com/users/rytaft/followers","following_url":"https://api.github.com/users/rytaft/following{/other_user}","gists_url":"https://api.github.com/users/rytaft/gists{/gist_id}","starred_url":"https://api.github.com/users/rytaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rytaft/subscriptions","organizations_url":"https://api.github.com/users/rytaft/orgs","repos_url":"https://api.github.com/users/rytaft/repos","events_url":"https://api.github.com/users/rytaft/events{/privacy}","received_events_url":"https://api.github.com/users/rytaft/received_events","type":"User","site_admin":false},"repo":{"id":105816605,"node_id":"MDEwOlJlcG9zaXRvcnkxMDU4MTY2MDU=","name":"cockroach","full_name":"rytaft/cockroach","private":false,"owner":{"login":"rytaft","id":3288732,"node_id":"MDQ6VXNlcjMyODg3MzI=","avatar_url":"https://avatars2.githubusercontent.com/u/3288732?v=4","gravatar_id":"","url":"https://api.github.com/users/rytaft","html_url":"https://github.com/rytaft","followers_url":"https://api.github.com/users/rytaft/followers","following_url":"https://api.github.com/users/rytaft/following{/other_user}","gists_url":"https://api.github.com/users/rytaft/gists{/gist_id}","starred_url":"https://api.github.com/users/rytaft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rytaft/subscriptions","organizations_url":"https://api.github.com/users/rytaft/orgs","repos_url":"https://api.github.com/users/rytaft/repos","events_url":"https://api.github.com/users/rytaft/events{/privacy}","received_events_url":"https://api.github.com/users/rytaft/received_events","type":"User","site_admin":false},"html_url":"https://github.com/rytaft/cockroach","description":"CockroachDB - the open source, cloud-native SQL database.","fork":true,"url":"https://api.github.com/repos/rytaft/cockroach","forks_url":"https://api.github.com/repos/rytaft/cockroach/forks","keys_url":"https://api.github.com/repos/rytaft/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rytaft/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rytaft/cockroach/teams","hooks_url":"https://api.github.com/repos/rytaft/cockroach/hooks","issue_events_url":"https://api.github.com/repos/rytaft/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/rytaft/cockroach/events","assignees_url":"https://api.github.com/repos/rytaft/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/rytaft/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/rytaft/cockroach/tags","blobs_url":"https://api.github.com/repos/rytaft/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rytaft/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rytaft/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/rytaft/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rytaft/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/rytaft/cockroach/languages","stargazers_url":"https://api.github.com/repos/rytaft/cockroach/stargazers","contributors_url":"https://api.github.com/repos/rytaft/cockroach/contributors","subscribers_url":"https://api.github.com/repos/rytaft/cockroach/subscribers","subscription_url":"https://api.github.com/repos/rytaft/cockroach/subscription","commits_url":"https://api.github.com/repos/rytaft/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/rytaft/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/rytaft/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/rytaft/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/rytaft/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/rytaft/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rytaft/cockroach/merges","archive_url":"https://api.github.com/repos/rytaft/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rytaft/cockroach/downloads","issues_url":"https://api.github.com/repos/rytaft/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/rytaft/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/rytaft/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/rytaft/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rytaft/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/rytaft/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/rytaft/cockroach/deployments","created_at":"2017-10-04T20:45:53Z","updated_at":"2018-09-21T14:56:15Z","pushed_at":"2018-09-21T19:59:38Z","git_url":"git://github.com/rytaft/cockroach.git","ssh_url":"git@github.com:rytaft/cockroach.git","clone_url":"https://github.com/rytaft/cockroach.git","svn_url":"https://github.com/rytaft/cockroach","homepage":"https://www.cockroachlabs.com","size":543143,"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,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"e34357b82626586ba83716ecfbcb2bb5f12917f5","user":{"login":"cockroachdb","id":6748139,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NDgxMzk=","avatar_url":"https://avatars3.githubusercontent.com/u/6748139?v=4","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"node_id":"MDEwOlJlcG9zaXRvcnkxNjU2MzU4Nw==","name":"cockroach","full_name":"cockroachdb/cockroach","private":false,"owner":{"login":"cockroachdb","id":6748139,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY3NDgxMzk=","avatar_url":"https://avatars3.githubusercontent.com/u/6748139?v=4","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/cockroachdb/cockroach","description":"CockroachDB - the open source, cloud-native SQL database.","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","deployments_url":"https://api.github.com/repos/cockroachdb/cockroach/deployments","created_at":"2014-02-06T00:18:47Z","updated_at":"2018-09-21T19:30:29Z","pushed_at":"2018-09-21T20:57:05Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":"https://www.cockroachlabs.com","size":1037802,"stargazers_count":14319,"watchers_count":14319,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1512,"mirror_url":null,"archived":false,"open_issues_count":1961,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1512,"open_issues":1961,"watchers":14319,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30470"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/30470"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/30470"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/30470/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30470/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/30470/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/6a2c90a9476584e13af51ed1394ac3960a4b2da0"}},"author_association":"CONTRIBUTOR","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"craig[bot]","id":37807150,"node_id":"MDM6Qm90Mzc4MDcxNTA=","avatar_url":"https://avatars0.githubusercontent.com/in/10419?v=4","gravatar_id":"","url":"https://api.github.com/users/craig%5Bbot%5D","html_url":"https://github.com/apps/craig","followers_url":"https://api.github.com/users/craig%5Bbot%5D/followers","following_url":"https://api.github.com/users/craig%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/craig%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/craig%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/craig%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/craig%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/craig%5Bbot%5D/repos","events_url":"https://api.github.com/users/craig%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/craig%5Bbot%5D/received_events","type":"Bot","site_admin":false},"comments":6,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":97,"deletions":3,"changed_files":3}}
{"actor":{"display_login":"craig"}}