Datatype range issues and roundtripping #10

Open
jguerin opened this Issue Jun 8, 2012 · 1 comment

Projects

None yet

2 participants

@jguerin
Contributor
jguerin commented Jun 8, 2012

Values like double.MinValue, double.MaxValue, double.PositiveInfinity, double.NegativeInfinity, double.NaN, etc. In my case, I was sending these values from a .NET client (the above constants are .NET constants), but the issue is general if the corresponding json string values are sent.

For example, the .NET value Double.MinValue.ToString() yields “1.79769313486232E+308”. Calling parseFloat in JS on that string returns the JS constant -Infinity. Similarly Double.MaxValue yields Infinity. When -Infinity is passed to sql node as a parameter value on insert, the value roundtrips back as -9223372036854776000. Numbers outside of the range of JS Number (5e-324 (negative) to 1.7976931348623157e+308 (positive)) result in -Infinity/Infinity (overflow).

Seems like any values that cannot be stored/roundtripped properly should result in an error. Otherwise the truncation is silent.

@jkint jkint was assigned Jun 8, 2012
@jguerin
Contributor
jguerin commented Oct 11, 2012

This is a known issue that we are investigating for the next release.

@jkint jkint was unassigned by jguerin Apr 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment