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

BETWEEN not working in certain cases

    Details

      Description

      In MariaDB 10.2.14 the following SQLs do not work as intended, specifically BETWEEN seems to be broken. In 10.2.13 everything works as expected.

      -- Not work
      SELECT
        *
      FROM (SELECT  date('2018-01-01') AS DAT
        UNION ALL
        SELECT  date('2018-01-01') AS DAT) AS t
      WHERE t.DAT BETWEEN date ('2017-01-01') AND date ('2019-01-01');
       
      -- not work
      SELECT
        *
      FROM (SELECT  date('2018-01-01') AS d) AS t
      WHERE t.d BETWEEN date ('2017-01-01') AND date ('2019-01-01');
      -- work
       SELECT 'aaaa' AS d FROM dual
       WHERE date('2018-01-01') BETWEEN date ('2017-01-01') AND date ('2019-01-01');
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                igor Igor Babaev
                Reporter:
                Ravenheart Toshko Andreev
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: