Fixed that postgresql adapter would fails when reading bytea fields with null...

Fixed that postgresql adapter would fails when reading bytea fields with null value #771 [rodrigo k]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@849 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 00fe726a
......@@ -143,11 +143,11 @@ def quote_bytea(s)
end
def escape_bytea(s)
s.gsub(/\\/) { '\\\\\\\\' }.gsub(/[^\\]/) { |c| sprintf('\\\\%03o', c[0].to_i) }
s.gsub(/\\/) { '\\\\\\\\' }.gsub(/[^\\]/) { |c| sprintf('\\\\%03o', c[0].to_i) } unless s.nil?
end
def unescape_bytea(s)
s.gsub(/\\([0-9][0-9][0-9])/) { $1.oct.chr }.gsub(/\\\\/) { '\\' }
s.gsub(/\\([0-9][0-9][0-9])/) { $1.oct.chr }.gsub(/\\\\/) { '\\' } unless s.nil?
end
def split_table_schema(table_name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册