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

wrong result with json_overlaps when one of the arguments has an empty nested array element

    XMLWordPrintable

Details

    • Unexpected results
    • Q4/2026 Server Maintenance

    Description

      probably affecting earlier versions too.

      MariaDB [test]> select json_overlaps('[[1]]', '[[]]');
      +--------------------------------+
      | json_overlaps('[[1]]', '[[]]') |
      +--------------------------------+
      |                              1 |
      +--------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [test]> select json_overlaps('[[1]]', '[[],123]');
      +------------------------------------+
      | json_overlaps('[[1]]', '[[],123]') |
      +------------------------------------+
      |                                  1 |
      +------------------------------------+
      1 row in set (0.001 sec)
      
      

      MySQL 9.6:

      mysql>  select json_overlaps('[[1]]', '[[]]');
      +--------------------------------+
      | json_overlaps('[[1]]', '[[]]') |
      +--------------------------------+
      |                              0 |
      +--------------------------------+
      1 row in set (0.002 sec)
      

      mysql>  select json_overlaps('[[1]]', '[[],123]');
      +------------------------------------+
      | json_overlaps('[[1]]', '[[],123]') |
      +------------------------------------+
      |                                  0 |
      +------------------------------------+
      1 row in set (0.001 sec)
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              External_Contributor External_Contributor
              Yuchen Pei Yuchen Pei
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 4h 38m
                  1d 4h 38m
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 5h 11m Time Not Required
                  5h 11m

                  Git Integration

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