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

JSON_SCHEMA_VALID rejects duplicate array elements when uniqueItems is false

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.3.2
    • None
    • JSON
    • None
    • MariaDB Server 12.3.2, Windows x64
    • JSON Schema Draft 2020-12 says an instance validates successfully when uniqueItems is false, regardless of whether the array contains duplicates. MariaDB returns false for a valid instance.

    Description

      Description

      JSON Schema Draft 2020-12 says an instance validates successfully when uniqueItems is false, regardless of whether the array contains duplicates. MariaDB returns false for a valid instance.

      How to repeat

      SELECT VERSION();

      SELECT JSON_SCHEMA_VALID('

      {"uniqueItems":false}

      ', '[1,1]') AS duplicate_items;
      SELECT JSON_SCHEMA_VALID('{}', '[1,1]') AS omitted_keyword_control;
      SELECT JSON_SCHEMA_VALID('

      {"uniqueItems":true}

      ', '[1,1]') AS true_keyword_control;

      Actual result

      MariaDB returns 0, 1, 0.

      Expected result

      The results should be 1, 1, 0. Duplicate strings and duplicate objects are also incorrectly rejected with uniqueItems:false.

      Attachments

        Activity

          People

            gkodinov Georgi Kodinov
            123 zhang hanshuo
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.