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

Document support for binary representation of JSON documents

    XMLWordPrintable

Details

    Description

      Unlike MySQL, MariaDB allows JSON documents be binary:

      10.2 ba7d86a6

      MariaDB [test]> select json_valid(convert('{"a":"b"}' using binary));
      +-----------------------------------------------+
      | json_valid(convert('{"a":"b"}' using binary)) |
      +-----------------------------------------------+
      |                                             1 |
      +-----------------------------------------------+
      1 row in set (0.001 sec)
      

      MySQL 8.0.23

      MySQL [test]> select json_valid(convert('{"a":"b"}' using binary));
      +-----------------------------------------------+
      | json_valid(convert('{"a":"b"}' using binary)) |
      +-----------------------------------------------+
      |                                             0 |
      +-----------------------------------------------+
      1 row in set (0.000 sec)
      

      The standard mostly talks about JSON texts as being Unicode; but if I interpret it correctly (while reading ISO/IEC TR 19075-6 "3.2 Representations of JSON data"), it allows implementation-specific support of binary formats.

      If it is indeed allowed or at least doesn't cause any important discrepancies, supporting it nice, especially when it comes to the use of LOAD_FILE for defining a JSON document. But since it's implementation-specific, I think it needs to be documented.

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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