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

Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_general_ci AND varbinary_column='A';

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1, 10.0
    • Fix Version/s: 10.1.8
    • Component/s: Optimizer
    • Labels:
      None

      Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a VARBINARY(10));
      INSERT INTO t1 VALUES ('a'),('A');
      EXPLAIN EXTENDED SELECT * FROM t1 WHERE a>=_utf8'a' COLLATE utf8_general_ci AND a='A';
      SHOW WARNINGS;
      

      returns

      +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Note  | 1003 | select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'A') and (convert(`test`.`t1`.`a` using utf8) >= <cache>((_utf8'a' collate utf8_general_ci)))) |
      +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      

      The equality a='A' was not propagated into >=. It safely could.

        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: