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

JSON_SCHEMA_VALID does not properly validate the maximum/minimum value of a number

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Won't Fix
    • 11.1(EOL)
    • 11.1.0
    • JSON
    • None

    Description

      11.1.0-dbg>SET @schema='{"maximum": 18446744073709551}';
      Query OK, 0 rows affected (0.000 sec)
       
      11.1.0-dbg>
      

      Actual result

      11.1.0-dbg>SELECT JSON_SCHEMA_VALID(@schema,18446744073709552);
      +----------------------------------------------+
      | JSON_SCHEMA_VALID(@schema,18446744073709552) |
      +----------------------------------------------+
      |                                            1 |
      +----------------------------------------------+
      1 row in set (0.000 sec)
       
      11.1.0-dbg>
      

      Expected result

      11.1.0-dbg>SELECT JSON_SCHEMA_VALID(@schema,18446744073709552);
      +----------------------------------------------+
      | JSON_SCHEMA_VALID(@schema,18446744073709552) |
      +----------------------------------------------+
      |                                            0 |
      +----------------------------------------------+
      1 row in set (0.000 sec)
       
      11.1.0-dbg>
      

      11.1.0-dbg>SET @schema='{"minimum": 18446744073709551}';
      Query OK, 0 rows affected (0.000 sec)
       
      11.1.0-dbg>
      

      Actual result

      11.1.0-dbg>SELECT JSON_SCHEMA_VALID(@schema,18446744073709550);
      +----------------------------------------------+
      | JSON_SCHEMA_VALID(@schema,18446744073709550) |
      +----------------------------------------------+
      |                                            1 |
      +----------------------------------------------+
      1 row in set (0.000 sec)
       
      11.1.0-dbg>
      

      Expected result

      11.1.0-dbg>SELECT JSON_SCHEMA_VALID(@schema,18446744073709550);
      +----------------------------------------------+
      | JSON_SCHEMA_VALID(@schema,18446744073709550) |
      +----------------------------------------------+
      |                                            0 |
      +----------------------------------------------+
      1 row in set (0.000 sec)
       
      11.1.0-dbg>
      

      Attachments

        Issue Links

          Activity

            People

              rucha174 Rucha Deodhar
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.