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

    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.

      Attachments

        Issue Links

          Activity

            bar Alexander Barkov created issue -
            bar Alexander Barkov made changes -
            Field Original Value New Value
            bar Alexander Barkov made changes -
            Description {code}
            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_swedish_ci AND a='A';
            SHOW WARNINGS;
            {code}
            returns
            {noformat}
            +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
            | 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_swedish_ci)))) |
            +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
            {noformat}
            The equality a='A' was not propagated into >=. It safely could.
            {code}
            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;
            {code}
            returns
            {noformat}
            +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
            | 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)))) |
            +-------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
            {noformat}
            The equality a='A' was not propagated into >=. It safely could.
            bar Alexander Barkov made changes -
            Summary Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_swedish_ci AND varbinary_column='A'; Equal field propagation is not applied for WHERE varbinary_column>=_utf8'a' COLLATE utf8_general_ci AND varbinary_column='A';
            bar Alexander Barkov made changes -
            Fix Version/s 10.1.8 [ 19605 ]
            Fix Version/s 10.1 [ 16100 ]
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            bar Alexander Barkov made changes -
            Labels propagation
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 71655 ] MariaDB v4 [ 149622 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.