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

Inconsistent results involving JSON operations

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.6.16, 10.4.33
    • N/A
    • JSON
    • None
    • Windows 11

    Description

      When executing the following statments on MariaDB 10.6.14

      SET @json_1 = JSON_OBJECT('id', 'name');
      SET @json_result_1 = JSON_OBJECT('test', @json_1);
      SELECT @json_result_1;
      SET @json_result_2 = JSON_OBJECT('test', JSON_OBJECT('id', 'name'));
      SELECT @json_result_2;
      

      I receive the following results:

      For @json_result_1:

      {"test": "{\"id\": \"name\"}"}
      

      And for @json_result_2:

      {"test": {"id": "name"}}
      

      How does it come that I retrieve different result? Aren't those JSON string supposed to be internally all treated as TEXT?

      Attachments

        Activity

          People

            bar Alexander Barkov
            neuronet Andreas Hinderberger
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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