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

Optimizer Error with = SOME on UNIQUE Column Using Decimal/Integer Types

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.6, 10.11, 11.4, 11.8, 12.0.2, 12.1.2
    • 10.6, 10.11, 11.4, 12.2, 11.8
    • Optimizer
    • None

    Description

      A query using the = SOME (or = ANY) operator produces an incorrect result when the subquery's column is an integer type (e.g., INT, BIGINT, or DECIMAL) with a UNIQUE index and is compared against a literal.

      drop TABLE IF EXISTS t6;
      CREATE TABLE t6 (c2 int);
      INSERT t6 () VALUES (1.009);
      SELECT (0.9 = SOME (SELECT t6.c2 FROM t6))FROM t6;
      -- 0
      drop TABLE IF EXISTS t6;
      CREATE TABLE t6 (c2 int UNIQUE);
      INSERT t6 () VALUES (1.009);
      SELECT (0.9 = SOME (SELECT t6.c2 FROM t6))FROM t6;
      -- 1
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              zzz5248 zzz5248
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.