Skip to content

Commit 360f357

Browse files
committed
[mysql] fix incompatible character encodings: ASCII-8BIT and UTF-8
... triggered with Rails 4.1 (master)
1 parent 77e154f commit 360f357

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/arjdbc/mysql/adapter.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def quote(value, column = nil)
152152
return value if sql_literal?(value)
153153
return value.to_s if column && column.type == :primary_key
154154

155-
if value.kind_of?(String) && column && column.type == :binary && column.class.respond_to?(:string_to_binary)
156-
"x'#{column.class.string_to_binary(value).unpack("H*")[0]}'"
155+
if value.kind_of?(String) && column && column.type == :binary
156+
"x'#{value.unpack("H*")[0]}'"
157157
elsif value.kind_of?(BigDecimal)
158158
value.to_s("F")
159159
else

0 commit comments

Comments
 (0)