[MCOL-2051] CS uses 'NULL' literal as NULL when UPDATEs varchar field Created: 2018-12-26  Updated: 2023-10-25  Resolved: 2023-10-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: PrimProc
Affects Version/s: None
Fix Version/s: 23.10

Type: Bug Priority: Minor
Reporter: Roman Assignee: Leonid Fedorov
Resolution: Fixed Votes: 0
Labels: contribution

Sprint: 2019-05, 2019-06

 Description   

CS converts 'NULL' literal into NULL value. Consider the output for Columnstore and InnoDB tables:

MariaDB [test]> create table cs1(v8 varchar(8), t text ) engine=columnstore;
Query OK, 0 rows affected (0.92 sec)
 
MariaDB [test]> insert into cs1 values ('some','other'),('some2','other2');
Query OK, 2 rows affected (0.43 sec)
Records: 2  Duplicates: 0  Warnings: 0
 
MariaDB [test]> create table i1 (v8 varchar(8), t text);
Query OK, 0 rows affected (0.53 sec)
 
MariaDB [test]> insert into i1 select * from cs1;
sQuery OK, 2 rows affected (0.58 sec)
Records: 2  Duplicates: 0  Warnings: 0
 
MariaDB [test]> select * from i1;
+-------+--------+
| v8    | t      |
+-------+--------+
| some  | other  |
| some2 | other2 |
+-------+--------+
2 rows in set (0.00 sec)
 
MariaDB [test]> select * from cs1;
+-------+--------+
| v8    | t      |
+-------+--------+
| some  | other  |
| some2 | other2 |
+-------+--------+
2 rows in set (0.01 sec)
 
MariaDB [test]> update cs1 set v8 = 'NULL' where v8 = 'some';
Query OK, 1 row affected (0.14 sec)
Rows matched: 0  Changed: 0  Warnings: 0
 
MariaDB [test]> select * from cs1 where v8 is null;
+------+-------+
| v8   | t     |
+------+-------+
| NULL | other |
+------+-------+
1 row in set (0.02 sec)
 
MariaDB [test]> update i1 set v8 = 'NULL' where v8 = 'some';
Query OK, 1 row affected (0.15 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
MariaDB [test]> select * from i1 where v8 is null;
Empty set (0.00 sec)
 
MariaDB [test]> update i1 set t = 'NULL' where v8 = 'some2';
Query OK, 1 row affected (0.23 sec)
Rows matched: 1  Changed: 1  Warnings: 0
 
MariaDB [test]> select * from i1 where t is null;
Empty set (0.00 sec)
 
MariaDB [test]> update cs1 set t = 'NULL' where v8 = 'some2';
Query OK, 1 row affected (0.15 sec)
Rows matched: 0  Changed: 0  Warnings: 0
 
MariaDB [test]> select * from cs1 where t is null;
+-------+------+
| v8    | t    |
+-------+------+
| some2 | NULL |
+-------+------+
1 row in set (0.02 sec)



 Comments   
Comment by Roman [ 2019-05-13 ]

For QA: the relevant test is in the description.

Comment by Daniel Lee (Inactive) [ 2019-05-13 ]

Build tested: 1.1.7-1 and 1.2.3-1

Reproduced issue in the above releases.

Comment by Daniel Lee (Inactive) [ 2019-05-15 ]

Build verified: 1.1.8-1 nightly

server commit:
01cc1ef
engine commit:
0af6994

still waiting for a good night build for 1.2.4-1

Comment by Daniel Lee (Inactive) [ 2019-05-17 ]

Build tested: 1.2.4-1 nightly

server commit:
e3d9939
engine commit:
92d6624

[root@localhost ~]# mcsmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 14
Server version: 10.3.15-MariaDB-log Columnstore 1.2.4-1

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

The issue as noted in the bug description still exists.

Comment by Daniel Lee (Inactive) [ 2019-05-21 ]

Build tested: 1.2.4-1 Release candidate

The issue is still not fixed.

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