[CSHARP-665] MaxDocuments is Int64 Created: 20/Jan/13 Updated: 20/Mar/14 Resolved: 17/Feb/13 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.7 |
| Fix Version/s: | 1.8 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | ??? | Assignee: | Robert Stam |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
C#Dirver 1.71 |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
When the MaxDocument of Collection is huge,over Int32,there will be a Error } |
| Comments |
| Comment by Robert Stam [ 17/Feb/13 ] |
|
Fixed in version 1.8 (see |
| Comment by Craig Wilson [ 17/Feb/13 ] |
|
Yes, you will still get the issue in version 1.7. 1.8 is the fix version for this. It should come out in 2-3 weeks. Robert was simply pointing you at the commit that fixes this issue. |
| Comment by ??? [ 17/Feb/13 ] |
|
Reply of my client is that: System.InvalidCastException: 无法将类型为“MongoDB.Bson.BsonDouble”的对象强制转换为类型“MongoDB.Bson.BsonInt32”。 I think there is maybe something wrong with get_MaxDocuments..... |
| Comment by Robert Stam [ 07/Feb/13 ] |
|
Thank you. Happy Chinese New Year! |
| Comment by ??? [ 07/Feb/13 ] |
|
Thank you for your reply. |
| Comment by Robert Stam [ 07/Feb/13 ] |
|
This is the commit that fixed this issue for 1.7: https://github.com/rstam/mongo-csharp-driver/commit/4f1050fe7b0a97bfa4aeee4f0a90a0f2afea5306 |
| Comment by Robert Stam [ 07/Feb/13 ] |
|
Can you make sure that you are actually using version 1.7 of the C# driver? The stack trace you provided shows the driver calling AsInt32, but the current version of the driver calls ToInt32 (which could still theoretically overflow, but would not result in the exception shown by your stack trace). |