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

The patch for MDEV-8688 disabled equal field propagation for temporal column and BETWEEN and IN

    Details

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DATE);
      INSERT INTO t1 VALUES ('2001-01-01');
      EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01' AND '2001-01-02';
      SHOW WARNINGS;
      EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02');
      SHOW WARNINGS;

      used to return

      +-------+------+---------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                               |
      +-------+------+---------------------------------------------------------------------------------------+
      | Note  | 1003 | select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01') |
      +-------+------+---------------------------------------------------------------------------------------+
      +-------+------+---------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                               |
      +-------+------+---------------------------------------------------------------------------------------+
      | Note  | 1003 | select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01') |
      +-------+------+---------------------------------------------------------------------------------------+

      After the patch for MDEV-8688 the same script returns:

      +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                                                                                             |
      +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
      | Note  | 1003 | select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01') and (`test`.`t1`.`a` between '2001-01-01' and '2001-01-02')) |
      +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------+
      +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                                                                                      |
      +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
      | Note  | 1003 | select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = '2001-01-01') and (`test`.`t1`.`a` in ('2001-01-01','2001-01-02'))) |
      +-------+------+----------------------------------------------------------------------------------------------------------------------------------------------+

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: