[MCOL-1155] NOT with null safe operator fails Created: 2018-01-10  Updated: 2018-07-17  Resolved: 2018-07-17

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.2
Fix Version/s: 1.1.6

Type: Bug Priority: Major
Reporter: David Thompson (Inactive) Assignee: Daniel Lee (Inactive)
Resolution: Fixed Votes: 1
Labels: community

Attachments: File q1.out     File q1.sql     File setup.sql     File t1.out     File t1.sql    
Sprint: 2018-10, 2018-11, 2018-12, 2018-13, 2018-14

 Description   

I can work around with colum1 is not null and column2 is null... but should it work with NOT (column1 <=> column2)? Here's an example.

MariaDB> CREATE TABLE cs1 (
    ->     id              INT(10) UNSIGNED NOT NULL,
    ->     `timestamp_`    DATETIME,
    ->     numeric_val     DOUBLE DEFAULT NULL
    -> ) ENGINE=columnstore;
Query OK, 0 rows affected (0.44 sec)
 
MariaDB> CREATE TABLE cs2 (
    ->     id              INT(10) UNSIGNED NOT NULL,
    ->     `timestamp_`    DATETIME,
    ->     numeric_val     DOUBLE DEFAULT NULL
    -> ) ENGINE=columnstore;
Query OK, 0 rows affected (0.25 sec)
 
MariaDB> SELECT @@version,@@version_comment;
+---------------------+---------------------+
| @@version           | @@version_comment   |
+---------------------+---------------------+
| 10.2.10-MariaDB-log | Columnstore 1.1.2-1 |
+---------------------+---------------------+
1 row in set (0.00 sec)
 
MariaDB]> INSERT INTO cs1 VALUES (1, '2018-01-09 21:59:02', 11.11);
Query OK, 1 row affected (0.11 sec)
 
MariaDB> INSERT INTO cs2 VALUES (1, '2018-01-09 21:59:02', 22.22);
Query OK, 1 row affected (0.10 sec)
 
MariaDB> SELECT * FROM cs1
    ->     JOIN cs2 USING(id,timestamp_)
    -> ;
+----+---------------------+-------------+-------------+
| id | timestamp_          | numeric_val | numeric_val |
+----+---------------------+-------------+-------------+
|  1 | 2018-01-09 21:59:02 |       11.11 |       22.22 |
+----+---------------------+-------------+-------------+
1 row in set (0.04 sec)
 
MariaDB> SELECT * FROM cs1
    ->     JOIN cs2 USING(id,timestamp_)
    ->     WHERE cs1.numeric_val <=> cs2.numeric_val
    -> ;
Empty set (0.02 sec)
 
MariaDB> SELECT * FROM cs1
    ->     JOIN cs2 USING(id,timestamp_)
    ->     WHERE NOT (cs1.numeric_val = cs2.numeric_val)
    -> ;
+----+---------------------+-------------+-------------+
| id | timestamp_          | numeric_val | numeric_val |
+----+---------------------+-------------+-------------+
|  1 | 2018-01-09 21:59:02 |       11.11 |       22.22 |
+----+---------------------+-------------+-------------+
1 row in set (0.02 sec)
 
MariaDB> SELECT * FROM cs1
    ->     JOIN cs2 USING(id,timestamp_)
    ->     WHERE NOT (cs1.numeric_val <=> cs2.numeric_val)
    -> ;
ERROR 1815 (HY000): Internal error: IDB-2030: Predicate and Logic operators can not be used where an expression is expected.



 Comments   
Comment by Ravi Prakash (Inactive) [ 2018-06-27 ]

Pushed the code fix to MCOL_1155 branch and have requested Andrew to review it.

Comment by Ravi Prakash (Inactive) [ 2018-06-28 ]

I tested the issue using the attached SQL files. I used setup.sql to create the tables and q1.sql and t1.sql to test the feature. I captured the output of running the queries as follows:
mcsmysql test -v -f <q1.sql >q1.out
mcsmysql test -v -f >t1,sql >t1.out

Then I changed the "engine" parameters for the table to innodb and tested it again. I compared the outputs from both engines and made sure they are same.

Comment by Daniel Lee (Inactive) [ 2018-07-17 ]

Build verified: 1.1.6-1 source

/root/columnstore/mariadb-columnstore-server
commit 1741c7e7d522d1245ec9c1e4c7c7474574f09bd2
Merge: 2adc4b5 6abef48
Author: benthompson15 <ben.thompson@mariadb.com>
Date: Tue Jun 19 09:51:48 2018 -0500

Merge pull request #113 from mariadb-corporation/davidhilldallas-patch-3

update readme

/root/columnstore/mariadb-columnstore-server/mariadb-columnstore-engine
commit 32bd7d4e270f46a6052df64cff871f2c3371bb3a
Merge: af6108d 400ae51
Author: benthompson15 <ben.thompson@mariadb.com>
Date: Thu Jul 12 15:36:42 2018 -0500

Merge pull request #518 from mariadb-corporation/MCOL-1146

Mcol 1146 - multi node quick install

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