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

GREATEST() and LEAST() malfunction for NULL

    XMLWordPrintable

Details

    Description

      Hi everyone,

      On the latest trunk version (0308de9), GREATEST() and LEAST() seem to malfunction for NULL values:

      CREATE TABLE t0(c0 INT);
      INSERT INTO t0 VALUES (1);
      SELECT * FROM t0 WHERE GREATEST(c0, NULL); -- unexpected: row is fetched
      

      I would not expect the row to be fetched, because the WHERE condition should evaluate to NULL for that row:

      SELECT GREATEST(c0, NULL) FROM t0; -- NULL
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              mrigger Manuel Rigger
              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.