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

Unexpected result of SELECT query

    XMLWordPrintable

Details

    Description

      Hi,

      I found a logic bug in MariaDB.

      In the following test case, the where condition is true, however, the query returns an empty result:

      CREATE TABLE t0(c1 VARCHAR(100));
      CREATE TABLE t1(c0 VARCHAR(100));
      INSERT INTO t1 VALUES ('1');
      SELECT t0.c1 FROM t0 RIGHT JOIN t1 ON true; – this query returns NULL, so the t0.c1 has only one value NULL
      SELECT (NULL IS TRUE) IS NOT NULL; – this query returns 1, meaning this expression returns true
      SELECT t0.c1 FROM t0 RIGHT JOIN t1 ON true WHERE (((t0.c1 IS TRUE) IS NOT NULL)); – this query returns empty result, however, its where condition is true, so I expect it returns one row

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            ChiZhang Chi Zhang
            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.