[CSHARP-1777] Regression 2.3 driver- Nullible List Contains operator Created: 05/Oct/16 Updated: 07/Mar/17 Resolved: 06/Mar/17 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | Linq |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.4.3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Bret Ferrier | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Windows |
||
| Issue Links: |
|
||||||||
| Description |
|
I have a fairly simple method shown below that worked with the 2.2.x driver but now throws an error
Exception Message: Unable to cast object of type 'MongoDB.Bson.Serialization.Serializers.ImpliedImplementationInterfaceSerializer`2[System.Collections.Generic.IEnumerable`1[System.Nullable`1[System.Int64]],System.Collections.Generic.List`1[System.Nullable`1[System.Int64]]]' to type 'MongoDB.Bson.Serialization.IBsonSerializer`1[System.Int64]'. Stack Trace: at MongoDB.Bson.Serialization.Serializers.NullableSerializer`1.MongoDB.Bson.Serialization.IChildSerializerConfigurable.WithChildSerializer(IBsonSerializer childSerializer) |
| Comments |
| Comment by Robert Stam [ 06/Mar/17 ] | |||||||||||||||||||||||||||
|
The change made in 2.3 was intended to address a particular scenario but was inadvertently being applied in other scenarios were it did not apply (and therefore ended up throwing an exception). The fix made for 2.4.3 is a low impact change which basically verifies in advance that an exception won't be thrown before applying the new behavior, and falls back to pre 2.3 behavior for scenarios were an exception would have been thrown by the new code. It's possible a more comprehensive fix might be warranted at some future time. That might depend partly on whether any further bugs are reported. | |||||||||||||||||||||||||||
| Comment by Githook User [ 06/Mar/17 ] | |||||||||||||||||||||||||||
|
Author: {u'username': u'rstam', u'name': u'rstam', u'email': u'robert@robertstam.org'}Message: | |||||||||||||||||||||||||||
| Comment by Robert Stam [ 02/Mar/17 ] | |||||||||||||||||||||||||||
|
I am able to reproduce this using this minimal test program:
With 2.2.4 the output is:
With 2.3+ an exception is thrown. |