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

JSON_MERGE returns nullwhen merging empty array

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.2.12, 10.2, 10.3
    • 10.2.18
    • JSON
    • None
    • CentOS 7 (64bit)

    Description

      Issue

       SELECT JSON_MERGE('[1]', '[]');
      +-------------------------+
      | JSON_MERGE('[1]', '[]') |
      +-------------------------+
      | NULL                    |
      +-------------------------+
      1 row in set, 1 warning (0.00 sec)
       
      SHOW WARNINGS;
      +---------+------+--------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                        |
      +---------+------+--------------------------------------------------------------------------------+
      | Warning | 4038 | Syntax error in JSON text in argument 1 to function 'json_merge' at position 5 |
      +---------+------+--------------------------------------------------------------------------------+
      

      Expected Result

       SELECT JSON_MERGE('[1]', '[]');
      +-------------------------+
      | JSON_MERGE('[1]', '[]') |
      +-------------------------+
      | [1]                    |
      +-------------------------+
      

      Attachments

        Issue Links

          Activity

            People

              holyfoot Alexey Botchkov
              bubasscs@gmail.com Buba
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.