Details

    Description

      I run the following statements, in which the query returns an incorrect result.

      CREATE TABLE t1 (c1 TINYBLOB, UNIQUE (c1(2)));
      INSERT INTO t1 (c1) VALUES (1);
      SELECT c1 FROM t1 WHERE 'a' BETWEEN 0 AND (c1); -- actual: {}, expected: {1}
      

      I got the following query plan.

      mysql> EXPLAIN SELECT c1 FROM t1 WHERE 'a' BETWEEN 0 AND (c1);
      +------+-------------+-------+-------+---------------+------+---------+------+------+-------------+
      | id   | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | Extra       |
      +------+-------------+-------+-------+---------------+------+---------+------+------+-------------+
      |    1 | SIMPLE      | t1    | range | c1            | c1   | 5       | NULL | 1    | Using where |
      +------+-------------+-------+-------+---------------+------+---------+------+------+-------------+
      

      Attachments

        Issue Links

          Activity

            People

              Gosselin Dave Gosselin
              John Jove John Jove
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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