Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #120 from ajuckel/master

Merge quick fix for Issue #117
  • Loading branch information...
commit 837cd489591afbb24f6ba4d36a15a6c4da82b063 2 parents 1c9cdab + f885633
@ajuckel ajuckel authored
Showing with 8 additions and 5 deletions.
  1. +4 −1 lib/arjdbc/mysql/adapter.rb
  2. +4 −4 test/simple.rb
View
5 lib/arjdbc/mysql/adapter.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
8 test/simple.rb
@@ -251,11 +251,11 @@ 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
@@ -263,11 +263,11 @@ def test_string
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.