[MDEV-8722] The patch for MDEV-8688 disabled equal field propagation for temporal column and BETWEEN and IN Created: 2015-09-01  Updated: 2015-09-12  Resolved: 2015-09-01

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.1.7
Fix Version/s: 10.1.7

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: propagation, upstream-not-affected

Issue Links:
Blocks
blocks MDEV-8728 Fix a number of problems in equal fie... Closed

 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'))) |
+-------+------+----------------------------------------------------------------------------------------------------------------------------------------------+


Generated at Thu Feb 08 07:29:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.