Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit acf3eef7a315a1a7d4c86d97f08f27f7e82afe1d 1 parent 749f0ba
@jeremyevans authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/sequel/adapters/mysql.rb
View
2  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 +
Please sign in to comment.
Something went wrong with that request. Please try again.