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

JSON_VALUE and null values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.3, 10.4.5
    • Fix Version/s: 10.3, 10.4
    • Component/s: JSON
    • Labels:
      None
    • Environment:
      Windows

      Description

      I have found the following bug:

      > set @xxx= JSON_INSERT('{}', '$.C', NULL);
      > select @xxx
      +-------------+
      | @xxx        |
      +-------------+
      | {"C": null} |
      +-------------+
      1 row in set (0.001 sec){quote}
       
      > select nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE');
      +-----------------------------------------------+
      | nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE') |
      +-----------------------------------------------+
      | null                                          |
      +-----------------------------------------------+
      1 row in set (0.001 sec)
      

      I was expecting

      > select nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE');
      +-----------------------------------------------+
      | nvl(json_value(@xxx, '$.C'),'NVL-NULL-VALUE') |
      +-----------------------------------------------+
      | NVL-NULL-VALUE                                |
      +-----------------------------------------------+
      1 row in set (0.001 sec)
      

        Attachments

          Activity

            People

            Assignee:
            holyfoot Alexey Botchkov
            Reporter:
            wodrsoftware Wolfgang Draxler
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated: