Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-1716

GROUP BY handler incorrectly process filters with subquery as IN predicate

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.2
    • 1.2.2
    • None
    • None
    • 2018-17, 2018-18, 2018-19, 2018-20

    Description

      The handler builds an incorrect execution plan and the mentioned type of queries returns incorrect results. Here are a number of examples with their counterparts taken when vtable is enabled.

      select sum(i) from cs2 where cs2.i not in ( select i from cs3 );
      +--------+
      | sum(i) |
      +--------+
      |     45 |
      +--------+
      1 row in set (0.216 sec)
       
      MariaDB [test]>   set infinidb_vtable_mode=0;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select sum(i) from cs2 where cs2.i not in ( select i from cs3 );
      +--------+
      | sum(i) |
      +--------+
      |     66 |
      +--------+
      1 row in set (0.028 sec)
      

      MariaDB [test]> set infinidb_vtable_mode=0;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select sum(i) from cs2 where cs2.i in ( select i from cs3 );
      ERROR 1815 (HY000): Internal error: IDB-1000: 'cs2' and 'cs3' are not joined.
       
      MariaDB [test]> set infinidb_vtable_mode=1;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select sum(i) from cs2 where cs2.i in ( select i from cs3 );
      +--------+
      | sum(i) |
      +--------+
      |     21 |
      +--------+
      1 row in set (0.023 sec)
      

      MariaDB [test]> set infinidb_vtable_mode=1;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select sum(i) from cs2 where cs2.i not in ( select sum(i) from cs3 );
      +--------+
      | sum(i) |
      +--------+
      |     66 |
      +--------+
      1 row in set (0.057 sec)
       
      MariaDB [test]> set infinidb_vtable_mode=0;
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [test]> select sum(i) from cs2 where cs2.i not in ( select sum(i) from cs3 );
      +--------+
      | sum(i) |
      +--------+
      |   NULL |
      +--------+
      1 row in set (0.026 sec)
      

      Attachments

        Issue Links

          Activity

            People

              dleeyh Daniel Lee (Inactive)
              drrtuy Roman
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.