[MCOL-4642] NOT IN subquery containing an isnull in the OR predicate crashes server Created: 2021-03-26  Updated: 2021-12-10  Resolved: 2021-06-11

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 5.5.1
Fix Version/s: 5.6.3, 6.1.1

Type: Bug Priority: Blocker
Reporter: Gagan Goel (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

The following query crashes the server:

MariaDB [test]> create table cs1 (a int)engine=columnstore;
Query OK, 0 rows affected (0.661 sec)
 
MariaDB [test]> insert into cs1 values (1), (2), (3), (4), (null);
Query OK, 5 rows affected (0.291 sec)
Records: 5  Duplicates: 0  Warnings: 0
 
MariaDB [test]> create table cs2 (b int, c int)engine=columnstore;
Query OK, 0 rows affected (0.597 sec)
 
MariaDB [test]> insert into cs2 values (1, 100), (1, 101), (2, 200),
    -> (3, 300), (3, 301), (3, 302), (null, null);
Query OK, 7 rows affected (0.250 sec)
Records: 7  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select * from cs1 where a not in (select b from cs2 where b is not null or b is null);
ERROR 2013 (HY000): Lost connection to MySQL server during query

However, if the OR arguments are interchanged, the crash does not happen:

MariaDB [test]> select * from cs1 where a not in (select b from cs2 where b is null or b is not null);
Empty set (0.020 sec)

In addition, the following 2 queries return inconsistent results:

MariaDB [test]> select * from cs1 where a not in (select b from cs2 where b=123 or b is null);
+------+
| a    |
+------+
|    1 |
|    2 |
|    3 |
|    4 |
| NULL |
+------+
5 rows in set (0.152 sec)
 
MariaDB [test]> select * from cs1 where a not in (select b from cs2 where b is null or b=123);
Empty set (0.021 sec)



 Comments   
Comment by Daniel Lee (Inactive) [ 2021-06-11 ]

Build verified: 6.1.1 ( Drone #2573)

Generated at Thu Feb 08 02:51:54 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.