[ 
https://issues.apache.org/jira/browse/CASSANDRA-14377?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Lerer updated CASSANDRA-14377:
---------------------------------------
       Resolution: Fixed
    Fix Version/s: 4.0
                   3.11.4
                   3.0.18
                   2.2.14
    Reproduced In: 3.11.2, 2.2.12  (was: 2.2.12, 3.11.2)
           Status: Resolved  (was: Patch Available)

Committed in to 2.2 at 2bd733264ea0a30f2d62f62195a9bb7860904f83 and merged into 
3.0, 3.11 and trunk.

> Returning invalid JSON for NaN and Infinity float values
> --------------------------------------------------------
>
>                 Key: CASSANDRA-14377
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14377
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Piotr Sarna
>            Assignee: Benjamin Lerer
>            Priority: Minor
>             Fix For: 2.2.14, 3.0.18, 3.11.4, 4.0
>
>
> After inserting special float values like NaN and Infinity into a table:
> {{CREATE TABLE testme (t1 bigint, t2 float, t3 float, PRIMARY KEY (t1));}}
> {{INSERT INTO testme (t1, t2, t3) VALUES (7, NaN, Infinity);}}
> and returning them as JSON...
> {{cqlsh:demodb> select json * from testme;}}
> {{ [json]}}
> {{--------------------------------------}}
> {{ \{"t1": 7, "t2": NaN, "t3": Infinity}}}
>  
> ... the result will not be validated (e.g. with 
> [https://jsonlint.com/|https://jsonlint.com/)] ) because neither NaN nor 
> Infinity is a valid JSON value. The consensus seems to be returning JSON's 
> `null` in these cases, based on this article 
> [https://stackoverflow.com/questions/1423081/json-left-out-infinity-and-nan-json-status-in-ecmascript]
>  and other similar ones.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to