Permalink
Browse files

Merge pull request #120 from ajuckel/master

Merge quick fix for Issue #117
  • Loading branch information...
ajuckel committed Oct 7, 2011
2 parents 1c9cdab + f885633 commit 837cd489591afbb24f6ba4d36a15a6c4da82b063
Showing with 8 additions and 5 deletions.
  1. +4 −1 lib/arjdbc/mysql/adapter.rb
  2. +4 −4 test/simple.rb
@@ -432,7 +432,10 @@ def exec_insert(sql, name, binds)
binds = binds.dup
# Pretend to support bind parameters
- execute sql.gsub('?') { quote(*binds.shift.reverse) }, name
+ unless binds.empty?
+ sql = sql.gsub('?') { quote(*binds.shift.reverse) }
+ end
+ execute sql, name
end
alias :exec_update :exec_insert
alias :exec_delete :exec_insert
View
@@ -251,23 +251,23 @@ def test_text
# so they all have a initial value of an empty string ''
assert_equal(nil, e.sample_text) unless ActiveRecord::Base.connection.adapter_name =~ /oracle/i
- e.sample_text = "ooop"
+ e.sample_text = "ooop?"
e.save!
e = DbType.find(:first)
- assert_equal("ooop", e.sample_text)
+ assert_equal("ooop?", e.sample_text)
end
def test_string
e = DbType.find(:first)
# An empty string is treated as a null value in Oracle: http://www.techonthenet.com/oracle/questions/empty_null.php
assert_equal('', e.sample_string) unless ActiveRecord::Base.connection.adapter_name =~ /oracle/i
- e.sample_string = "ooop"
+ e.sample_string = "ooop?"
e.save!
e = DbType.find(:first)
- assert_equal("ooop", e.sample_string)
+ assert_equal("ooop?", e.sample_string)
end
def test_save_binary

0 comments on commit 837cd48

Please sign in to comment.