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

Applying NOT twice on an integer results in wrong result in WHERE condition

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.2
    • 11.4
    • None
    • None
    • ubuntu 20.04

    Description

      CREATE TABLE t0(c0 INT);
      INSERT INTO t0(c0) VALUES(1);
      SELECT * FROM t0 WHERE 123 != (NOT (NOT 123)); 
      --  Empty set 
      

      Here is an equivalent execution. The results are inconsistent.

      CREATE TABLE t0(c0 INT);
      INSERT INTO t0(c0) VALUES(1);
       
      SELECT (NOT (NOT 123)); 
      -- 1
      SELECT * FROM t0 WHERE 123 != 1; 
      --1
      

      Attachments

        Issue Links

          Activity

            People

              oleg.smirnov Oleg Smirnov
              Wangdada HeShan
              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.