{"action":"created","issue":{"url":"https://api.github.com/repos/brianmario/mysql2/issues/791","repository_url":"https://api.github.com/repos/brianmario/mysql2","labels_url":"https://api.github.com/repos/brianmario/mysql2/issues/791/labels{/name}","comments_url":"https://api.github.com/repos/brianmario/mysql2/issues/791/comments","events_url":"https://api.github.com/repos/brianmario/mysql2/issues/791/events","html_url":"https://github.com/brianmario/mysql2/pull/791","id":182280680,"number":791,"title":"Avoid type error when using connect_timeout, read_timeout and write_timeout in a DATABASE_URL env variable","user":{"login":"helgeblod","id":2901515,"avatar_url":"https://avatars.githubusercontent.com/u/2901515?v=3","gravatar_id":"","url":"https://api.github.com/users/helgeblod","html_url":"https://github.com/helgeblod","followers_url":"https://api.github.com/users/helgeblod/followers","following_url":"https://api.github.com/users/helgeblod/following{/other_user}","gists_url":"https://api.github.com/users/helgeblod/gists{/gist_id}","starred_url":"https://api.github.com/users/helgeblod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/helgeblod/subscriptions","organizations_url":"https://api.github.com/users/helgeblod/orgs","repos_url":"https://api.github.com/users/helgeblod/repos","events_url":"https://api.github.com/users/helgeblod/events{/privacy}","received_events_url":"https://api.github.com/users/helgeblod/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/brianmario/mysql2/milestones/17","html_url":"https://github.com/brianmario/mysql2/milestones/0.4.5","labels_url":"https://api.github.com/repos/brianmario/mysql2/milestones/17/labels","id":1624690,"number":17,"title":"0.4.5","description":"","creator":{"login":"sodabrew","id":39406,"avatar_url":"https://avatars.githubusercontent.com/u/39406?v=3","gravatar_id":"","url":"https://api.github.com/users/sodabrew","html_url":"https://github.com/sodabrew","followers_url":"https://api.github.com/users/sodabrew/followers","following_url":"https://api.github.com/users/sodabrew/following{/other_user}","gists_url":"https://api.github.com/users/sodabrew/gists{/gist_id}","starred_url":"https://api.github.com/users/sodabrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodabrew/subscriptions","organizations_url":"https://api.github.com/users/sodabrew/orgs","repos_url":"https://api.github.com/users/sodabrew/repos","events_url":"https://api.github.com/users/sodabrew/events{/privacy}","received_events_url":"https://api.github.com/users/sodabrew/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":3,"state":"open","created_at":"2016-03-06T19:12:35Z","updated_at":"2016-10-11T14:39:31Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-10-11T14:34:50Z","updated_at":"2016-10-11T14:49:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/brianmario/mysql2/pulls/791","html_url":"https://github.com/brianmario/mysql2/pull/791","diff_url":"https://github.com/brianmario/mysql2/pull/791.diff","patch_url":"https://github.com/brianmario/mysql2/pull/791.patch"},"body":"Why:\r\n\r\n* When using a DATABASE_URL env variable with one or more of  these\r\n  params, a type-error is triggered\r\n\r\nExample: \r\n\r\n`DATABASE_URL=\"mysql2://<database>:<password>@<host>:<port>/<db>?encoding=utf8&pool=1&connect_timeout=2&read_timeout=5&write_timeout=5\"`\r\n\r\nResults in:\r\n\r\n```\r\nTypeError: wrong argument type String (expected Fixnum)\r\n/usr/local/bundle/gems/mysql2-0.4.4/lib/mysql2/client.rb:39:in `connect_timeout='\r\n/usr/local/bundle/gems/mysql2-0.4.4/lib/mysql2/client.rb:39:in `block in initialize'\r\n/usr/local/bundle/gems/mysql2-0.4.4/lib/mysql2/client.rb:33:in `each'\r\n/usr/local/bundle/gems/mysql2-0.4.4/lib/mysql2/client.rb:33:in `initialize'\r\n...\r\n```\r\n\r\nThis fix solves this issue. I have reproduced this in alpine-linux inside a docker container, and as far as I can see it should not break anything. "},"comment":{"url":"https://api.github.com/repos/brianmario/mysql2/issues/comments/252939848","html_url":"https://github.com/brianmario/mysql2/pull/791#issuecomment-252939848","issue_url":"https://api.github.com/repos/brianmario/mysql2/issues/791","id":252939848,"user":{"login":"sodabrew","id":39406,"avatar_url":"https://avatars.githubusercontent.com/u/39406?v=3","gravatar_id":"","url":"https://api.github.com/users/sodabrew","html_url":"https://github.com/sodabrew","followers_url":"https://api.github.com/users/sodabrew/followers","following_url":"https://api.github.com/users/sodabrew/following{/other_user}","gists_url":"https://api.github.com/users/sodabrew/gists{/gist_id}","starred_url":"https://api.github.com/users/sodabrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sodabrew/subscriptions","organizations_url":"https://api.github.com/users/sodabrew/orgs","repos_url":"https://api.github.com/users/sodabrew/repos","events_url":"https://api.github.com/users/sodabrew/events{/privacy}","received_events_url":"https://api.github.com/users/sodabrew/received_events","type":"User","site_admin":false},"created_at":"2016-10-11T14:49:02Z","updated_at":"2016-10-11T14:49:02Z","body":"Turns out you're in good company:\r\nhttps://github.com/rails/rails/issues/26556\r\n https://github.com/rails/rails/pull/26559"}}
{"actor":{"display_login":"sodabrew"}}