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

SELECT NULL,NULL IN (SUBQUERY) returns 0 instead of NULL

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Queries with IN predicates operating on NULL values could sometimes return wrong results.
    • Q1/2026 Server Maintenance, Q2/2026 Server Maintenance

    Description

      Those SELECTs must return NULL but they return 0.

      CREATE TABLE s (s INT);
      INSERT INTO s VALUES(1);
       
      SELECT (SELECT NULL, NULL) IN (SELECT 1, 2 FROM s) FROM s;
      0
      

      CREATE TABLE u(a INT, b INT);
      INSERT INTO u VALUES (NULL, NULL);
      SELECT (SELECT * FROM u) IN (SELECT 1, 2 FROM s) FROM s;
      0
      

      Attachments

        Activity

          People

            oleg.smirnov Oleg Smirnov
            oleg.smirnov Oleg Smirnov
            Oleg Smirnov Oleg Smirnov
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.