-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Passing a String argument to BSON_C.deserialize is broken. It sticks the String argument "buf" into a ByteBuffer and stores that buffer in to_deserialize. Then buf.rewind is called but String has no such method. I haven't looked too closely, but you probably want s/to_deserialze/buf ?
http://github.com/mongodb/mongo-ruby-driver/blob/master/lib/bson/bson_c.rb
def self.deserialize(buf=nil)
if buf.is_a? String
to_deserialize = ByteBuffer.new(buf) if buf
else
buf = ByteBuffer.new(buf.to_a) if buf
end
buf.rewind
CBson.deserialize(buf.to_s)
end