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

GREATEST should return NULL but returns date.

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      Documentation says GREATEST() returns NULL if any argument is NULL.

      Test Query:

      SELECT 
       DATE(''),
       
       GREATEST(DATE(''), CURDATE()),
       GREATEST(NULL, CURDATE()),
       
       LEAST(DATE(''), CURDATE()),
       LEAST(NULL, CURDATE())
      

      All selects in this query should return NULL, as DATE('') returns NULL. But the query GREATEST(DATE(''), CURDATE()) returns the current date.

      Attachments

        Issue Links

          Activity

            People

              raghunandan.bhat Raghunandan Bhat
              lbuchs Lukas Buchs
              Raghunandan Bhat Raghunandan Bhat
              Raghunandan Bhat Raghunandan Bhat
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 4.75h
                  4.75h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.