Skip to content

Commit

Permalink
Fix connection in mysql adapter with :port=>"1234"
Browse files Browse the repository at this point in the history
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
jeremyevans committed Jul 29, 2011
1 parent 749f0ba commit acf3eef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/sequel/adapters/mysql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down

0 comments on commit acf3eef

Please sign in to comment.