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

json_extract returns null is any (even nested) data contains 0 written in scientific notation (0E-10)

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3.11, 10.2, 10.3
    • 10.4
    • JSON
    • None

    Description

      Hi, the scientific notation handling was partially fixed in MDEV-15561

      But this still fails

      MariaDB [(none)]> select json_extract('{"test":0e-10}','$.test') from dual;
      +-----------------------------------------+
      | json_extract('{"test":0e-10}','$.test') |
      +-----------------------------------------+
      | NULL                                    |
      +-----------------------------------------+
      1 row in set, 1 warning (0.000 sec)
       
      MariaDB [(none)]> select json_extract('{"test":0E-10}','$.test') from dual;
      +-----------------------------------------+
      | json_extract('{"test":0E-10}','$.test') |
      +-----------------------------------------+
      | NULL                                    |
      +-----------------------------------------+
      1 row in set, 1 warning (0.000 sec)
       
      MariaDB [(none)]> show warnings;
      +---------+------+-----------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                           |
      +---------+------+-----------------------------------------------------------------------------------+
      | Warning | 4038 | Syntax error in JSON text in argument 1 to function 'json_extract' at position 10 |
      +---------+------+-----------------------------------------------------------------------------------+
      1 row in set (0.000 sec)
      

      although this works

       
      MariaDB [(none)]> select json_extract('{"test":1E-10}','$.test') from dual;
      +-----------------------------------------+
      | json_extract('{"test":1E-10}','$.test') |
      +-----------------------------------------+
      | 1E-10                                   |
      +-----------------------------------------+
      1 row in set (0.000 sec)
      

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            tlamr Tomas Lamr
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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