This project is archived and is in readonly mode.

#1395 ✓resolved
pfagiani (at gmail)

dbconsole crashes if you have a numeric password

Reported by pfagiani (at gmail) | November 17th, 2008 @ 10:14 PM | in 2.x

if you are using MySQL and try to run script/dbconsole without the "-p" flag and you have a number [0-9] only password on database.yml then somehow it gets parsed as Fixnum and it will trigger an exception at line 44 of vendor/rails/railties/lib/commands/dbconsole.rb complaining that a number doesn't have the empty? method (NoMethodError).

The quick fix for that is to append .to_s in that to ensure that even it is a number it will get parsed ok. Here goes how i think it should be:

elsif config['password'] && !config['password'].to_s.empty?

instead of

elsif config['password'] && !config['password'].empty?

I've attached a git patch for fixing that.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href=""></a>

People watching this ticket


Referenced by