GitHub PullRequestEvent at 2014-12-05 22:45:34
Repository: drush
Actor: weitzman
Payload: {"action":"closed","number":1032,"pull_request":{"url":"https://api.github.com/repos/drush-ops/drush/pulls/1032","id":25433017,"html_url":"https://github.com/drush-ops/drush/pull/1032","diff_url":"https://github.com/drush-ops/drush/pull/1032.diff","patch_url":"https://github.com/drush-ops/drush/pull/1032.patch","issue_url":"https://api.github.com/repos/drush-ops/drush/issues/1032","number":1032,"state":"closed","locked":false,"title":"Only do MySQL GRANT statement if called with db-su","user":{"login":"jeffsheltren","id":880136,"avatar_url":"https://avatars.githubusercontent.com/u/880136?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffsheltren","html_url":"https://github.com/jeffsheltren","followers_url":"https://api.github.com/users/jeffsheltren/followers","following_url":"https://api.github.com/users/jeffsheltren/following{/other_user}","gists_url":"https://api.github.com/users/jeffsheltren/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffsheltren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffsheltren/subscriptions","organizations_url":"https://api.github.com/users/jeffsheltren/orgs","repos_url":"https://api.github.com/users/jeffsheltren/repos","events_url":"https://api.github.com/users/jeffsheltren/events{/privacy}","received_events_url":"https://api.github.com/users/jeffsheltren/received_events","type":"User","site_admin":false},"body":"This is a patch for an old Drupal.org issue: https://www.drupal.org/node/1116566\r\n\r\nFor MySQL, when creating a database, drush always runs a GRANT statement. But if drush is called without 'db-su', the database user most likely won't have access to run the GRANT statement, and for drush 6 (and I believe 5 as well), this outputs an error which, while harmless, makes people think that the DB sync may have failed. For example:\r\n\r\n```\r\n$ drush sql-sync @test.one @test.two --create-db\r\n\r\nYou will destroy data in drupal2 and replace with data from drupal1.\r\n\r\nYou might want to make a backup first, using the sql-dump command.\r\n\r\nDo you really want to continue? (y/n): y\r\nERROR 1044 (42000) at line 1: Access denied for user 'drupal2_rw'@'localhost' to database 'drupal2'\r\n```\r\n\r\nDrush 7.x actually hides this error message although it still attempts to perform the GRANT.\r\n\r\nIn either case, the GRANT is not needed every time a database is dropped and created, since MySQL stores user information separately from the database.  So my patch makes it so that the GRANT is only called when 'db-su' in used -- implying that the DB is being created for the first time and therefore the Drupal site's MySQL user needs to be created with the GRANT statement.\r\n\r\nI've tested this, and it works fine without db-su, and in the case that db-su is used, I can confirm that the GRANT is run and the user is created successfully.\r\n\r\nI have a separate patch for 6.x, I'll open a second PR for that.","created_at":"2014-12-03T16:47:42Z","updated_at":"2014-12-05T22:45:33Z","closed_at":"2014-12-05T22:45:33Z","merged_at":"2014-12-05T22:45:33Z","merge_commit_sha":"93de34d0eccee94358fec72feb071321c0178792","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/drush-ops/drush/pulls/1032/commits","review_comments_url":"https://api.github.com/repos/drush-ops/drush/pulls/1032/comments","review_comment_url":"https://api.github.com/repos/drush-ops/drush/pulls/comments/{number}","comments_url":"https://api.github.com/repos/drush-ops/drush/issues/1032/comments","statuses_url":"https://api.github.com/repos/drush-ops/drush/statuses/11468036f9c08e71d83700f36ccfc0873bef3f89","head":{"label":"jeffsheltren:conditional-mysql-grant-drush7","ref":"conditional-mysql-grant-drush7","sha":"11468036f9c08e71d83700f36ccfc0873bef3f89","user":{"login":"jeffsheltren","id":880136,"avatar_url":"https://avatars.githubusercontent.com/u/880136?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffsheltren","html_url":"https://github.com/jeffsheltren","followers_url":"https://api.github.com/users/jeffsheltren/followers","following_url":"https://api.github.com/users/jeffsheltren/following{/other_user}","gists_url":"https://api.github.com/users/jeffsheltren/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffsheltren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffsheltren/subscriptions","organizations_url":"https://api.github.com/users/jeffsheltren/orgs","repos_url":"https://api.github.com/users/jeffsheltren/repos","events_url":"https://api.github.com/users/jeffsheltren/events{/privacy}","received_events_url":"https://api.github.com/users/jeffsheltren/received_events","type":"User","site_admin":false},"repo":{"id":27492502,"name":"drush","full_name":"jeffsheltren/drush","owner":{"login":"jeffsheltren","id":880136,"avatar_url":"https://avatars.githubusercontent.com/u/880136?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffsheltren","html_url":"https://github.com/jeffsheltren","followers_url":"https://api.github.com/users/jeffsheltren/followers","following_url":"https://api.github.com/users/jeffsheltren/following{/other_user}","gists_url":"https://api.github.com/users/jeffsheltren/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffsheltren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffsheltren/subscriptions","organizations_url":"https://api.github.com/users/jeffsheltren/orgs","repos_url":"https://api.github.com/users/jeffsheltren/repos","events_url":"https://api.github.com/users/jeffsheltren/events{/privacy}","received_events_url":"https://api.github.com/users/jeffsheltren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jeffsheltren/drush","description":"Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.","fork":true,"url":"https://api.github.com/repos/jeffsheltren/drush","forks_url":"https://api.github.com/repos/jeffsheltren/drush/forks","keys_url":"https://api.github.com/repos/jeffsheltren/drush/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jeffsheltren/drush/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jeffsheltren/drush/teams","hooks_url":"https://api.github.com/repos/jeffsheltren/drush/hooks","issue_events_url":"https://api.github.com/repos/jeffsheltren/drush/issues/events{/number}","events_url":"https://api.github.com/repos/jeffsheltren/drush/events","assignees_url":"https://api.github.com/repos/jeffsheltren/drush/assignees{/user}","branches_url":"https://api.github.com/repos/jeffsheltren/drush/branches{/branch}","tags_url":"https://api.github.com/repos/jeffsheltren/drush/tags","blobs_url":"https://api.github.com/repos/jeffsheltren/drush/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jeffsheltren/drush/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jeffsheltren/drush/git/refs{/sha}","trees_url":"https://api.github.com/repos/jeffsheltren/drush/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jeffsheltren/drush/statuses/{sha}","languages_url":"https://api.github.com/repos/jeffsheltren/drush/languages","stargazers_url":"https://api.github.com/repos/jeffsheltren/drush/stargazers","contributors_url":"https://api.github.com/repos/jeffsheltren/drush/contributors","subscribers_url":"https://api.github.com/repos/jeffsheltren/drush/subscribers","subscription_url":"https://api.github.com/repos/jeffsheltren/drush/subscription","commits_url":"https://api.github.com/repos/jeffsheltren/drush/commits{/sha}","git_commits_url":"https://api.github.com/repos/jeffsheltren/drush/git/commits{/sha}","comments_url":"https://api.github.com/repos/jeffsheltren/drush/comments{/number}","issue_comment_url":"https://api.github.com/repos/jeffsheltren/drush/issues/comments/{number}","contents_url":"https://api.github.com/repos/jeffsheltren/drush/contents/{+path}","compare_url":"https://api.github.com/repos/jeffsheltren/drush/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jeffsheltren/drush/merges","archive_url":"https://api.github.com/repos/jeffsheltren/drush/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jeffsheltren/drush/downloads","issues_url":"https://api.github.com/repos/jeffsheltren/drush/issues{/number}","pulls_url":"https://api.github.com/repos/jeffsheltren/drush/pulls{/number}","milestones_url":"https://api.github.com/repos/jeffsheltren/drush/milestones{/number}","notifications_url":"https://api.github.com/repos/jeffsheltren/drush/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jeffsheltren/drush/labels{/name}","releases_url":"https://api.github.com/repos/jeffsheltren/drush/releases{/id}","created_at":"2014-12-03T15:04:47Z","updated_at":"2014-12-03T15:04:50Z","pushed_at":"2014-12-03T16:40:48Z","git_url":"git://github.com/jeffsheltren/drush.git","ssh_url":"git@github.com:jeffsheltren/drush.git","clone_url":"https://github.com/jeffsheltren/drush.git","svn_url":"https://github.com/jeffsheltren/drush","homepage":"","size":11028,"stargazers_count":0,"watchers_count":0,"language":"PHP","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":"drush-ops:master","ref":"master","sha":"86faf1f2706edcf150c9320e70f52c210900684a","user":{"login":"drush-ops","id":931201,"avatar_url":"https://avatars.githubusercontent.com/u/931201?v=3","gravatar_id":"","url":"https://api.github.com/users/drush-ops","html_url":"https://github.com/drush-ops","followers_url":"https://api.github.com/users/drush-ops/followers","following_url":"https://api.github.com/users/drush-ops/following{/other_user}","gists_url":"https://api.github.com/users/drush-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/drush-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drush-ops/subscriptions","organizations_url":"https://api.github.com/users/drush-ops/orgs","repos_url":"https://api.github.com/users/drush-ops/repos","events_url":"https://api.github.com/users/drush-ops/events{/privacy}","received_events_url":"https://api.github.com/users/drush-ops/received_events","type":"Organization","site_admin":false},"repo":{"id":3193843,"name":"drush","full_name":"drush-ops/drush","owner":{"login":"drush-ops","id":931201,"avatar_url":"https://avatars.githubusercontent.com/u/931201?v=3","gravatar_id":"","url":"https://api.github.com/users/drush-ops","html_url":"https://github.com/drush-ops","followers_url":"https://api.github.com/users/drush-ops/followers","following_url":"https://api.github.com/users/drush-ops/following{/other_user}","gists_url":"https://api.github.com/users/drush-ops/gists{/gist_id}","starred_url":"https://api.github.com/users/drush-ops/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drush-ops/subscriptions","organizations_url":"https://api.github.com/users/drush-ops/orgs","repos_url":"https://api.github.com/users/drush-ops/repos","events_url":"https://api.github.com/users/drush-ops/events{/privacy}","received_events_url":"https://api.github.com/users/drush-ops/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/drush-ops/drush","description":"Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.","fork":false,"url":"https://api.github.com/repos/drush-ops/drush","forks_url":"https://api.github.com/repos/drush-ops/drush/forks","keys_url":"https://api.github.com/repos/drush-ops/drush/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drush-ops/drush/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drush-ops/drush/teams","hooks_url":"https://api.github.com/repos/drush-ops/drush/hooks","issue_events_url":"https://api.github.com/repos/drush-ops/drush/issues/events{/number}","events_url":"https://api.github.com/repos/drush-ops/drush/events","assignees_url":"https://api.github.com/repos/drush-ops/drush/assignees{/user}","branches_url":"https://api.github.com/repos/drush-ops/drush/branches{/branch}","tags_url":"https://api.github.com/repos/drush-ops/drush/tags","blobs_url":"https://api.github.com/repos/drush-ops/drush/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drush-ops/drush/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drush-ops/drush/git/refs{/sha}","trees_url":"https://api.github.com/repos/drush-ops/drush/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drush-ops/drush/statuses/{sha}","languages_url":"https://api.github.com/repos/drush-ops/drush/languages","stargazers_url":"https://api.github.com/repos/drush-ops/drush/stargazers","contributors_url":"https://api.github.com/repos/drush-ops/drush/contributors","subscribers_url":"https://api.github.com/repos/drush-ops/drush/subscribers","subscription_url":"https://api.github.com/repos/drush-ops/drush/subscription","commits_url":"https://api.github.com/repos/drush-ops/drush/commits{/sha}","git_commits_url":"https://api.github.com/repos/drush-ops/drush/git/commits{/sha}","comments_url":"https://api.github.com/repos/drush-ops/drush/comments{/number}","issue_comment_url":"https://api.github.com/repos/drush-ops/drush/issues/comments/{number}","contents_url":"https://api.github.com/repos/drush-ops/drush/contents/{+path}","compare_url":"https://api.github.com/repos/drush-ops/drush/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drush-ops/drush/merges","archive_url":"https://api.github.com/repos/drush-ops/drush/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drush-ops/drush/downloads","issues_url":"https://api.github.com/repos/drush-ops/drush/issues{/number}","pulls_url":"https://api.github.com/repos/drush-ops/drush/pulls{/number}","milestones_url":"https://api.github.com/repos/drush-ops/drush/milestones{/number}","notifications_url":"https://api.github.com/repos/drush-ops/drush/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drush-ops/drush/labels{/name}","releases_url":"https://api.github.com/repos/drush-ops/drush/releases{/id}","created_at":"2012-01-16T20:26:51Z","updated_at":"2014-12-05T21:30:58Z","pushed_at":"2014-12-05T22:45:33Z","git_url":"git://github.com/drush-ops/drush.git","ssh_url":"git@github.com:drush-ops/drush.git","clone_url":"https://github.com/drush-ops/drush.git","svn_url":"https://github.com/drush-ops/drush","homepage":"","size":19368,"stargazers_count":939,"watchers_count":939,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":424,"mirror_url":null,"open_issues_count":241,"forks":424,"open_issues":241,"watchers":939,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1032"},"html":{"href":"https://github.com/drush-ops/drush/pull/1032"},"issue":{"href":"https://api.github.com/repos/drush-ops/drush/issues/1032"},"comments":{"href":"https://api.github.com/repos/drush-ops/drush/issues/1032/comments"},"review_comments":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1032/comments"},"review_comment":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/drush-ops/drush/pulls/1032/commits"},"statuses":{"href":"https://api.github.com/repos/drush-ops/drush/statuses/11468036f9c08e71d83700f36ccfc0873bef3f89"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"weitzman","id":7740,"avatar_url":"https://avatars.githubusercontent.com/u/7740?v=3","gravatar_id":"","url":"https://api.github.com/users/weitzman","html_url":"https://github.com/weitzman","followers_url":"https://api.github.com/users/weitzman/followers","following_url":"https://api.github.com/users/weitzman/following{/other_user}","gists_url":"https://api.github.com/users/weitzman/gists{/gist_id}","starred_url":"https://api.github.com/users/weitzman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weitzman/subscriptions","organizations_url":"https://api.github.com/users/weitzman/orgs","repos_url":"https://api.github.com/users/weitzman/repos","events_url":"https://api.github.com/users/weitzman/events{/privacy}","received_events_url":"https://api.github.com/users/weitzman/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":6,"deletions":3,"changed_files":1}}