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

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2.2
    • Component/s: None
    • Labels:
      None
    • Sprint:
      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

              Assignee:
              dleeyh Daniel Lee
              Reporter:
              drrtuy Roman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration