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

Wrong results for a query with two NAME_CONST()

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
    • Fix Version/s: 10.4
    • Component/s: Optimizer
    • Labels:
      None

      Description

      This script:

      CREATE OR REPLACE TABLE t1 (a INT, KEY(a));
      INSERT INTO t1 VALUES (1),(2),(3);
      SELECT * FROM t1 WHERE a BETWEEN NAME_CONST('x',1) AND NAME_CONST('y',2);
      

      returns a correct result:

      +------+
      | a    |
      +------+
      |    1 |
      |    2 |
      +------+
      

      Now I change the name in the second NAME_CONST() from 'x' to 'y', the script returns a wrong result:

      CREATE OR REPLACE TABLE t1 (a INT, KEY(a));
      INSERT INTO t1 VALUES (1),(2),(3);
      SELECT * FROM t1 WHERE a BETWEEN NAME_CONST('x',1) AND NAME_CONST('x',2);
      

      +------+
      | a    |
      +------+
      |    1 |
      +------+
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: