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

LP:736780 - BETWEEN with datetime + NULL does not return NULL in 5.1-micro

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Not repeatable in mysql-5.1. In 5.1-micro, BETWEEN expressions that contain a datetime and NULL do not return NULL. Instead, they return FALSE, which is incorrect.

      To repeat:

      MySQL [test]> SELECT NOW() BETWEEN NULL AND '2011-01-01' ;
      -------------------------------------

      NOW() BETWEEN NULL AND '2011-01-01'

      -------------------------------------

      0

      -------------------------------------
      1 row in set (0.01 sec)

      should have returned NULL

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            Re: BETWEEN with datetime + NULL does not return NULL in 5.1-micro
            This is intentional and correct.

            Compare with SELECT 10 BETWEEN NULL AND 5;
            Or with SELECT "Z" BETWEEN NULL AND "A";

            Because the compared value is larger than the upper bound, the value of BETWEEN is false, even if the lower bound is unknown.

            Show
            serg Sergei Golubchik added a comment - Re: BETWEEN with datetime + NULL does not return NULL in 5.1-micro This is intentional and correct. Compare with SELECT 10 BETWEEN NULL AND 5; Or with SELECT "Z" BETWEEN NULL AND "A"; Because the compared value is larger than the upper bound, the value of BETWEEN is false, even if the lower bound is unknown.
            Hide
            ratzpo Rasmus Johansson added a comment -

            Launchpad bug id: 736780

            Show
            ratzpo Rasmus Johansson added a comment - Launchpad bug id: 736780

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                philipstoev Philip Stoev
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: