Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-39981

Different order of JSON items causes different results

    XMLWordPrintable

Details

    • Unexpected results
    • Hide
      ST_GEOMFROMGEOJSON when passed a JSON object that specified its "type" after all of the other GeoJSON objects that define it would previously return NULL rather than the object.

      Thanks to Akshat Nehra of AWS for providing a solution to this.
      Show
      ST_GEOMFROMGEOJSON when passed a JSON object that specified its "type" after all of the other GeoJSON objects that define it would previously return NULL rather than the object. Thanks to Akshat Nehra of AWS for providing a solution to this.

    Description

      Hi,

      In JSON, the order of items should has no influence on the results; however, the following test case shows a counterexample:

      SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"type":"GeometryCollection","geometries":[]}')); -- GEOMETRYCOLLECTION EMPTY
      SELECT ST_ASTEXT(ST_GEOMFROMGEOJSON('{"geometries":[],"type":"GeometryCollection"}')); -- NULL
      SHOW WARNINGS; -- Warning	4038	Syntax error in JSON text in argument 1 to function 'st_geomfromgeojson' at position 18
      

      Attachments

        Issue Links

          Activity

            People

              danblack Daniel Black
              ChiZhang Chi Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 0.25d
                  0.25d

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.