Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#9 port specification in mysql.rb results in TypeError

open
nobody
None
5
2003-02-04
2003-02-04
Anonymous
No

My name is David Landrith. My email is dlandrith@mac.com.

The following type of URL:

DBI:Mysql:database=dbname;host=hostname;port=3307

results in the following error:

site_ruby/1.6/DBD/Mysql/Mysql.rb:61:in `connect': no implicit conversion from string (TypeError)

The solution is to edit Mysql.rb line 61 as follows:

before:
handle = ::Mysql.connect(hash['host'], user, auth, hash['database'], hash['port'], hash['socket'], hash['flag'])

after:
handle = ::Mysql.connect(hash['host'], user, auth, hash['database'], hash['port'].to_i, hash['socket'], hash['flag'])

my ruby interpreter is 1.6.8 and was compiled from source on MacOS 10.2.3. The version string follows:

ruby 1.6.8 (2002-12-24) [powerpc-darwin6.3]

Discussion