Details
-
Bug
-
Resolution: Done
-
Critical - P2
-
None
-
None
-
None
-
None
Description
The method ReadElementType does not handle BsonType.Timestamp.
This issue shows ups when the mongodb server is running in replication mode and the driver queries the GetLastError from the DB after performing a save/update operation.
The server responds (with the result as per the spec for OP_REPLY http://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPREPLY) with 1 document
The hex dump for the BSON document is
3F-00-00-00-0A-65-72-72-00-08-75-70-64-61-74-65-64-45-78-69-73-74-69-6E-67-00-01-10-6E-00-01-00-00-00-11-6C-61-73-74-4F-70-00-01-00-00-00-84-2F-81-4C-01-6F-6B-00-00-00-00-00-00-00-F0-3F-00
which when translate to JSON should look like
{
"err" : null,
"updatedExisting" : true,
"n" : 1,
"lastOp" :
,
"ok" : 1
}
But the BsonReader throws an ArgumentOutOfRangeException exception.
Adding (case BsonType.Timestamp
at line 143 in the file samus-mongodb-csharp-85d3524\source\MongoDB\Bson\BsonReader.cs would solve the issue.
Thanks,
Saleem