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

Logical query with ! (x LIKE x) NOT IN (x LIKE x) returns incorrect empty result set for valid DOUBLE values

    XMLWordPrintable

Details

    Description

      Steps to reproduce

      DROP DATABASE IF EXISTS fuzzDatabase;
      CREATE DATABASE fuzzDatabase;
      USE fuzzDatabase;

      CREATE TABLE t0 (
      c0 DOUBLE DEFAULT NULL
      );
      INSERT INTO t0 VALUES (1067779538);
      INSERT INTO t0 VALUES (608648654);
      INSERT INTO t0 VALUES (2127310953);

      SELECT t0.c0 FROM t0 WHERE ((! (t0.c0 LIKE t0.c0)) NOT IN ((t0.c0 LIKE t0.c0)));

      Actual result: Empty set (0.00 sec)

      Expected result:
      The query should return all 3 rows because:
      t0.c0 LIKE t0.c0 evaluates to TRUE (1) for non-null values
      ! (TRUE) evaluates to FALSE (0)
      0 NOT IN (1) is TRUE → rows should be returned

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              zxtang Jason Tang
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.