[CSHARP-258] The 1.0 and 1.1 versions of the C# driver write a different value to the database for DateTime.MaxValue Created: 27/Jun/11 Updated: 02/Apr/15 Resolved: 05/Jul/11 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.0, 1.1 |
| Fix Version/s: | 1.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Description |
|
Version 1.0 wrote a value of 253402300800000 for DateTime.MaxValue. Version 1.1 writes the correct value of 253402300799999. The problem is that existing DateTime.MaxValue values written with the 1.0 version can now not be read by the 1.1 version. There needs to be some kind of backward compatibility mode with existing data in the 1.1 version. It is probably OK if the 1.0 version doesn't correctly handle data written by the 1.1 version (comments?). |
| Comments |
| Comment by Robert Stam [ 05/Jul/11 ] |
|
Added FixOldDateTimeMaxValueOnInput property to BsonBinaryReaderSettings and modified BsonBinaryReader to fix old DateTime.MaxValues on input if FixOldDateTimeMaxValueOnInput is true. Note that while this fix is backward compatible, the v1.0 driver is NOT forward compatible with the way v1.1 represents DateTime.MaxValue. What that means is that if you write a DateTime.MaxValue to a collection using the v1.1 driver then only the v1.1 driver can be used with that collection. |
| Comment by Gabriel Duford [ 27/Jun/11 ] |
|
I personally don't mind about "forward compatibility" (1.0 not handling 1.1 data) in that case. |