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

JSON_EQUALS validates invalid JSON and valid JSON as being equal when using a backslash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Not a Bug
    • Affects Version/s: 10.7
    • Fix Version/s: N/A
    • Component/s: Parser
    • Labels:
      None

      Description

      JSON_EQUALS validates invalid JSON and valid JSON as being equal when using a backslash:

      10.7.0 d552e092c9f3e20da078d1b62b976f629f73d3a4 (Debug)

      10.7.0-dbg>SELECT JSON_EQUALS('{"A": 1}', '{"A": 1\}');
      +--------------------------------------+
      | JSON_EQUALS('{"A": 1}', '{"A": 1\}') |
      +--------------------------------------+
      |                                    1 |
      +--------------------------------------+
      1 row in set (0.001 sec)
      

      A simplified version is this (though '{}' is not valid JSON by itself):

      10.7.0 d552e092c9f3e20da078d1b62b976f629f73d3a4 (Debug)

      10.7.0-dbg>SELECT JSON_EQUALS('{}', '{\}');
      +--------------------------+
      | json_equals('{}', '{\}') |
      +--------------------------+
      |                        1 |
      +--------------------------+
      1 row in set (0.000 sec)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration