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

JSON_MERGE returns nullwhen merging empty array

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2, 10.3, 10.2.12
    • Fix Version/s: 10.2.18
    • Component/s: JSON
    • Labels:
      None
    • Environment:
      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

              Assignee:
              holyfoot Alexey Botchkov
              Reporter:
              bubasscs@gmail.com Buba
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: