Uploaded image for project: 'Lucee Development'
  1. LDEV-1146

deSerializeJSON fail to parse a negative float value

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: New
    • Resolution: Fixed
    • Affects Version/s: 5.1.1.54
    • Fix Version/s: 5.1.1.56
    • Labels:
      None

      Description

      comment copy from LDEV-1126 Deployed

      Lyle Karstensen:
      There is still an issue with this. If the json packet has a float field with a negative value like a longitude you get an error parsing the json.
      sample value -115.155258178711

      bdw429s Brad Wood added a comment - 2 hours ago
      Lyle Karstensen Can you show some actual sample code and tell us the exact version of Lucee 5 you tested with. This code here works fine for me:

      writeDump( deSerializeJSON( '{ "foo" : -115.155258178711 }' ) );
      

      Lyle Karstensen added a comment - 1 hour ago
      I was using version 5.1.1.54 and got the issue since version 5.1.1.53 had the fix. The issue is when you do query of an SQL Server database that has a float column and then serialize it then try to deserialize it.
      Example

      <cfquery name="querywithfloat">
      select floatfield
      from atable
      </cfquery>
      json = SerializeJSON(querywithfloat);
      
      query = DeserializeJSON(json, false);
      
      writedump(query);
      

      I am working with Micha on another project and emailed him the exact json with real data in it (I don't want that on this page). But wanted to note this here for reference.

      Lyle Karstensen added a comment - 1 hour ago - edited
      These are the fields from the Serialized Query and exact data. I was able to replicate the issue by selecting the LON column and then not selecting it

      writeDump( deSerializeJSON( '{"COLUMNS":["LAT","LON"],"DATA":[[36.145317077637,-115.27172088623]]}', false);
      

      Unfortunately I cannot test this on my servers because version 5.1.1.54 crashes my test site because of this issue.

        Attachments

          Activity

            People

            • Assignee:
              michaeloffner Michael Offner
              Reporter:
              michaeloffner Michael Offner
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: