[CDRIVER-1472] NaN handling difference between C and C++ driver Created: 11/Aug/16 Updated: 25/Apr/17 Resolved: 25/Apr/17 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | json |
| Affects Version/s: | 1.3.5 |
| Fix Version/s: | 1.7.0 |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Almansour Belleh Blanco [X] | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||
| Description |
|
The NaN handling is different between the C driver and older versions of the C++ driver. for example, using this code:
we will obtain the desired BSONObj with NaN
In this case, the code will enter to the error case and doc will be empty |
| Comments |
| Comment by Githook User [ 25/Apr/17 ] |
|
Author: {'name': 'A. Jesse Jiryu Davis', 'username': 'ajdavis', 'email': 'jesse@mongodb.com'}Message: |
| Comment by Githook User [ 11/Apr/17 ] |
|
Author: {'username': 'ajdavis', 'email': 'jesse@mongodb.com', 'name': 'A. Jesse Jiryu Davis'}Message: |
| Comment by Githook User [ 11/Apr/17 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: |
| Comment by A. Jesse Jiryu Davis [ 11/Apr/17 ] |
|
Closed too soon: Must still consider Infinity and -Infinity. |
| Comment by A. Jesse Jiryu Davis [ 06/Apr/17 ] |
|
I've updated JSONSL's behavior upstream for NaN: https://github.com/mnunberg/jsonsl/issues/24 Maybe we should do the same for Infinity and -Infinity. |
| Comment by Luke Lovett [ 11/Oct/16 ] |
|
jesse The spec will discuss non-JSONable numerics like NaN and Inf. It's likely that parsers and generators will be required to deal with them. |
| Comment by A. Jesse Jiryu Davis [ 10/Oct/16 ] |
|
luke.lovett do you expect the forthcoming Extended JSON Spec to tell us whether to parse or generate NaN? Will the spec's ruling be that we must deal with NaN, or must not deal with NaN, or will the spec not have any rule about Nan? |
| Comment by A. Jesse Jiryu Davis [ 11/Aug/16 ] |
|
I am well aware that YAJL isn't maintained! We plan to migrate from it this quarter, |
| Comment by Almansour Belleh Blanco [X] [ 11/Aug/16 ] |
|
Isn't there a workaround in the meantime, even the yajl library doesn't seem to be actively maintained |
| Comment by A. Jesse Jiryu Davis [ 11/Aug/16 ] |
|
Not all MongoDB drivers' JSON parsers support NaN, since NaN is not included in the formal JSON spec. This may have to sit in the backlog for a bit, but I do understand that it would be useful to parse NaN. |