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

Wrong results for a query with two NAME_CONST()

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10
    • 10.3
    • Data types, Optimizer
    • 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

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.