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

Equal field propagation is not performed any longer for the IN list when multiple comparison types

    Details

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1),(2);
      EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=1 AND 1 IN (1,a,'3');
      SHOW WARNINGS;
      

      used to return:

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

      Now it returns:

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

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              There are no comments yet on this issue.

                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: