Permalink
Browse files

Fix connection in mysql adapter with :port=>"1234"

This can happen if the connection information is stored in yaml.
When a connection string is used, the URI library turns the port
into an integer, but that does not happen if an options hash is
used directly, and parsing yaml to get an options hash will
generally result in string values.
  • Loading branch information...
1 parent 749f0ba commit acf3eef7a315a1a7d4c86d97f08f27f7e82afe1d @jeremyevans committed Jul 29, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/sequel/adapters/mysql.rb
@@ -139,7 +139,7 @@ def connect(server)
opts[:user],
opts[:password],
opts[:database],
- opts[:port],
+ (opts[:port].to_i if opts[:port]),
opts[:socket],
Mysql::CLIENT_MULTI_RESULTS +
Mysql::CLIENT_MULTI_STATEMENTS +

0 comments on commit acf3eef

Please sign in to comment.