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

JSON_VALUE and null values

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Duplicate
    • 10.4.5, 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL)
    • 10.3.38, 10.4.28, 10.5.19, 10.6.12, 10.7.8
    • JSON
    • None
    • 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

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              wodrsoftware Wolfgang Draxler
              Votes:
              9 Vote for this issue
              Watchers:
              12 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.