From: Paul DuBois Date: 2003-02-08T11:49:58+09:00 Subject: Re: Bug in dbd_mysql [fixed] At 7:34 +0900 2/7/03, Paul DuBois wrote: >At 2:06 +0900 2/7/03, David King Landrith wrote: >>There is a bug in the dbd_mysql package. >> >>When I specify a port in the connection (as follows): >> >>DBI.connect('DBI:Mysql:database=dbName;host=hostName;port=3307', 'username') >> >>I get the following error: >> >>/usr/local/lib/ruby/site_ruby/1.6/DBD/Mysql/Mysql.rb:61:in >>`connect': no implicit conversion from string (TypeError) >> >>Line 61 of DBD/Mysql/Mysql.rb reads: >> >>handle = ::Mysql.connect(hash['host'], user, auth, >>hash['database'], hash['port'], hash['socket'], hash['flag']) >> >>The error is fixed by changing line 61 as follows: >> >>handle = ::Mysql.connect(hash['host'], user, auth, >>hash['database'], hash['port'].to_i, hash['socket'], hash['flag']) >> >>My question is, I've reported the bug. What else do I need to do >>to get this fix incorporated into the dbi source? > >It'll be fixed soon. > >Note that hash['flag'] also needs a .to_i or you'll get the same >exception if you pass a flag value. The above changes have been made. A few other changes have been added as well, such as that DatabaseError exceptions return the error number (not just the error message), and transaction support. (If your server is recent enough, the commit and rollback methods now work.) Until the next release, these changes will only be available from the Ruby DBI CVS repository, available at: http://sourceforge.net/cvs/?group_id=43737 It'd be good if people checked out the changes and gave them a try... > >>Best, >> >>Dave >> >>------------------------------------------------------- >>David King Landrith >> (w) 617.227.4469x213 >> (h) 617.696.7133 >> >>One useless man is a disgrace, two >>are called a law firm, and three or more >>become a congress -- John Adams >>------------------------------------------------------- >>public key available upon request