{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/36515302","id":36515302,"diff_hunk":"@@ -87,3 +88,67 @@ func (p *planner) DropTable(n *parser.DropTable) (planNode, error) {\n \t}\n \treturn &valuesNode{}, nil\n }\n+\n+// DropDatabase drops a database.\n+func (p *planner) DropDatabase(n *parser.DropDatabase) (planNode, error) {\n+\tif n.Name == \"\" {\n+\t\treturn nil, errEmptyDatabaseName\n+\t}\n+","path":"sql/drop.go","position":18,"original_position":18,"commit_id":"397affc28842aded5c5073133136650fa3e98927","original_commit_id":"397affc28842aded5c5073133136650fa3e98927","user":{"login":"MBerhault","id":5901480,"avatar_url":"https://avatars.githubusercontent.com/u/5901480?v=3","gravatar_id":"","url":"https://api.github.com/users/MBerhault","html_url":"https://github.com/MBerhault","followers_url":"https://api.github.com/users/MBerhault/followers","following_url":"https://api.github.com/users/MBerhault/following{/other_user}","gists_url":"https://api.github.com/users/MBerhault/gists{/gist_id}","starred_url":"https://api.github.com/users/MBerhault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MBerhault/subscriptions","organizations_url":"https://api.github.com/users/MBerhault/orgs","repos_url":"https://api.github.com/users/MBerhault/repos","events_url":"https://api.github.com/users/MBerhault/events{/privacy}","received_events_url":"https://api.github.com/users/MBerhault/received_events","type":"User","site_admin":false},"body":"actually, not root. we should check that WRITE privilege on the database descriptor.\r\nCould you also add a \"privileges\" comment similar to other statements?\r\n```\r\nprivileges: WRITE on database\r\n   notes: postgres requires the database owner\r\n          mysql requires DROP privileges on the database\r\n```","created_at":"2015-08-07T12:53:14Z","updated_at":"2015-08-07T12:53:14Z","html_url":"https://github.com/cockroachdb/cockroach/pull/2015#discussion_r36515302","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/36515302"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2015#discussion_r36515302"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015","id":41856294,"html_url":"https://github.com/cockroachdb/cockroach/pull/2015","diff_url":"https://github.com/cockroachdb/cockroach/pull/2015.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/2015.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2015","number":2015,"state":"open","locked":false,"title":"add drop database.","user":{"login":"XisiHuang","id":13212267,"avatar_url":"https://avatars.githubusercontent.com/u/13212267?v=3","gravatar_id":"","url":"https://api.github.com/users/XisiHuang","html_url":"https://github.com/XisiHuang","followers_url":"https://api.github.com/users/XisiHuang/followers","following_url":"https://api.github.com/users/XisiHuang/following{/other_user}","gists_url":"https://api.github.com/users/XisiHuang/gists{/gist_id}","starred_url":"https://api.github.com/users/XisiHuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XisiHuang/subscriptions","organizations_url":"https://api.github.com/users/XisiHuang/orgs","repos_url":"https://api.github.com/users/XisiHuang/repos","events_url":"https://api.github.com/users/XisiHuang/events{/privacy}","received_events_url":"https://api.github.com/users/XisiHuang/received_events","type":"User","site_admin":false},"body":"fixes #1895.\r\nIn postgres, drop database can  only be executed when no one is connected to the target database. \r\nWe should figure out how to do something similar later, or there would be problems if some other user is concurrently adding a table to the database when the database is being dropped.","created_at":"2015-08-07T03:14:49Z","updated_at":"2015-08-07T12:53:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1d8ff36935df569d07f2169389f9b6cb0ba3734","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/2015/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/397affc28842aded5c5073133136650fa3e98927","head":{"label":"XisiHuang:drop_database","ref":"drop_database","sha":"397affc28842aded5c5073133136650fa3e98927","user":{"login":"XisiHuang","id":13212267,"avatar_url":"https://avatars.githubusercontent.com/u/13212267?v=3","gravatar_id":"","url":"https://api.github.com/users/XisiHuang","html_url":"https://github.com/XisiHuang","followers_url":"https://api.github.com/users/XisiHuang/followers","following_url":"https://api.github.com/users/XisiHuang/following{/other_user}","gists_url":"https://api.github.com/users/XisiHuang/gists{/gist_id}","starred_url":"https://api.github.com/users/XisiHuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XisiHuang/subscriptions","organizations_url":"https://api.github.com/users/XisiHuang/orgs","repos_url":"https://api.github.com/users/XisiHuang/repos","events_url":"https://api.github.com/users/XisiHuang/events{/privacy}","received_events_url":"https://api.github.com/users/XisiHuang/received_events","type":"User","site_admin":false},"repo":{"id":39671857,"name":"cockroach","full_name":"XisiHuang/cockroach","owner":{"login":"XisiHuang","id":13212267,"avatar_url":"https://avatars.githubusercontent.com/u/13212267?v=3","gravatar_id":"","url":"https://api.github.com/users/XisiHuang","html_url":"https://github.com/XisiHuang","followers_url":"https://api.github.com/users/XisiHuang/followers","following_url":"https://api.github.com/users/XisiHuang/following{/other_user}","gists_url":"https://api.github.com/users/XisiHuang/gists{/gist_id}","starred_url":"https://api.github.com/users/XisiHuang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/XisiHuang/subscriptions","organizations_url":"https://api.github.com/users/XisiHuang/orgs","repos_url":"https://api.github.com/users/XisiHuang/repos","events_url":"https://api.github.com/users/XisiHuang/events{/privacy}","received_events_url":"https://api.github.com/users/XisiHuang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/XisiHuang/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":true,"url":"https://api.github.com/repos/XisiHuang/cockroach","forks_url":"https://api.github.com/repos/XisiHuang/cockroach/forks","keys_url":"https://api.github.com/repos/XisiHuang/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/XisiHuang/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/XisiHuang/cockroach/teams","hooks_url":"https://api.github.com/repos/XisiHuang/cockroach/hooks","issue_events_url":"https://api.github.com/repos/XisiHuang/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/XisiHuang/cockroach/events","assignees_url":"https://api.github.com/repos/XisiHuang/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/XisiHuang/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/XisiHuang/cockroach/tags","blobs_url":"https://api.github.com/repos/XisiHuang/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/XisiHuang/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/XisiHuang/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/XisiHuang/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/XisiHuang/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/XisiHuang/cockroach/languages","stargazers_url":"https://api.github.com/repos/XisiHuang/cockroach/stargazers","contributors_url":"https://api.github.com/repos/XisiHuang/cockroach/contributors","subscribers_url":"https://api.github.com/repos/XisiHuang/cockroach/subscribers","subscription_url":"https://api.github.com/repos/XisiHuang/cockroach/subscription","commits_url":"https://api.github.com/repos/XisiHuang/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/XisiHuang/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/XisiHuang/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/XisiHuang/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/XisiHuang/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/XisiHuang/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/XisiHuang/cockroach/merges","archive_url":"https://api.github.com/repos/XisiHuang/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/XisiHuang/cockroach/downloads","issues_url":"https://api.github.com/repos/XisiHuang/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/XisiHuang/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/XisiHuang/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/XisiHuang/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/XisiHuang/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/XisiHuang/cockroach/releases{/id}","created_at":"2015-07-25T03:59:58Z","updated_at":"2015-07-25T04:00:02Z","pushed_at":"2015-08-07T12:28:50Z","git_url":"git://github.com/XisiHuang/cockroach.git","ssh_url":"git@github.com:XisiHuang/cockroach.git","clone_url":"https://github.com/XisiHuang/cockroach.git","svn_url":"https://github.com/XisiHuang/cockroach","homepage":null,"size":26768,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"ad02940ea9c8b094dd35b815ad3e48088c4d37bc","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","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,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","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},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","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}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-08-06T19:03:49Z","pushed_at":"2015-08-07T12:39:27Z","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":null,"size":46120,"stargazers_count":4968,"watchers_count":4968,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":390,"mirror_url":null,"open_issues_count":127,"forks":390,"open_issues":127,"watchers":4968,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/2015"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2015"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/2015/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/2015/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/397affc28842aded5c5073133136650fa3e98927"}}}}