Skip to content

Commit

Permalink
Merge pull request TalentBox#5 from radicaled/master
Browse files Browse the repository at this point in the history
FIX: MySQL Storage adapter passing malformed arguments to mysql binary.
  • Loading branch information
JonathanTron committed Dec 7, 2012
2 parents aab9432 + 9848368 commit 3103e6b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/sequel-rails/storage.rb
@@ -1,3 +1,4 @@
require 'shellwords'
module Rails
module Sequel

Expand Down Expand Up @@ -140,9 +141,9 @@ def _drop

def execute(statement)
commands = ["mysql"]
commands << "--user" << username unless username.blank?
commands << "--password" << password unless password.blank?
commands << "--host" << host unless host.blank?
commands << "--user=#{Shellwords.escape(username)}" unless username.blank?
commands << "--password=#{Shellwords.escape(password)}" unless password.blank?
commands << "--host=#{host}" unless host.blank?
commands << "-e" << statement
system(*commands)
end
Expand Down

0 comments on commit 3103e6b

Please sign in to comment.