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

incorrect results for NOT operator on DATE_FORMAT with invalid arguments

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8, 12.1, 12.0.2
    • 10.11, 11.4, 11.8, 12.1
    • Optimizer
    • None

    Description

      The logical NOT operator produces inconsistent and incorrect results when applied to the DATE_FORMAT function if the function is given invalid (non-date/string) arguments.

      CREATE TABLE t80 (c2 DECIMAL(10,10));
      INSERT INTO t80 (c2) VALUES (0.1);
       
      select not DATE_FORMAT(c2, c2) FROM t80;
      -- return 0.1
      select not DATE_FORMAT(c2, c2) FROM t80;
      -- return 0
      select not(not DATE_FORMAT(c2, c2)) FROM t80;
      -- return 0 ,expected 1
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              zhouhongtao zzz
              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.