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

Non-standard syntaxe for JSON_OBJECT function

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
    • 10.4, 10.5, 10.6
    • JSON
    • None
    • Linux Mint 20.3 (Una)
      Docker 20.10.12

    Description

      MariaDB has a non-standard syntaxe for JSON_OBJECT, and also does not accept the standard syntaxe (as defined in ISO/IEC 9075:2016):

      Example 1:

      select json_object('first_name', 'John', 'last_name', 'Doe');
      

      MariaDB Result:

      {"last_name": "Doe", "first_name": "John"}

      MySQL Result:

      {"last_name": "Doe", "first_name": "John"}

      Example 2:

      select json_object('first_name': 'John', 'last_name': 'Doe');
      

      MariaDB Result: not works (You have an error in your SQL syntax)
      MySQL Result: not works (bad SQL grammar)

      1. Example 3:

      select json_object(key 'first_name' value 'John', key 'last_name' value 'Doe');
      

      MariaDB Result: not works (You have an error in your SQL syntax)
      MySQL Result: not works (bad SQL grammar)

      It would be nice to have MariaDB support the standard json_object syntaxe.

      https://github.com/h2database/h2database/issues/3575
      https://en.wikipedia.org/wiki/SQL:2016
      https://www.iso.org/standard/78937.html?browse=tc

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            bazoocaze Jose F
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.