[CSHARP-61] Error in MongoDB.Bson.BsonReader.ReadElementType(Int32 typeNumber) when reading type Timestamp Created: 03/Sep/10 Updated: 19/Oct/16 Resolved: 07/Sep/10 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical - P2 |
| Reporter: | Syed Saleem Javid Brahmanapalli | Assignee: | Steve Wagner |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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 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 , But the BsonReader throws an ArgumentOutOfRangeException exception. Adding (case BsonType.Timestamp Thanks, |
| Comments |
| Comment by Steve Wagner [ 07/Sep/10 ] |
|
Timestamps are now supported. To map a timestamp you need to set the property to type MongoTimestamp. The deserializer can also convert it back to long. But be aware that when you write such document, the values is written as long instead of timestamp. You can find the change in my unstable branch. |
| Comment by Steve Wagner [ 05/Sep/10 ] |
|
I hope to start with that tomorrow. |