[MCOL-4729] ColumnStore treating NULL and empty strings as the same Created: 2021-05-18  Updated: 2023-04-25  Resolved: 2023-04-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: DMLProc, PrimProc
Affects Version/s: 5.5.2
Fix Version/s: 23.02

Type: Bug Priority: Major
Reporter: Maria M Pflaum Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Environment:

Relh8


Issue Links:
Duplicate
duplicates MCOL-271 Improved support for NULL for Varchar... Closed

 Description   

1.) Location, Call, and Code default to NULL instead of '' (as in innodb).

CREATE TABLE `test_table1` (
`Site` varchar(5) DEFAULT '',
`Location` varchar(55) DEFAULT '',
`Call` varchar(25) DEFAULT '',
`Code` varchar(4) DEFAULT ''
) ENGINE=Columnstore;

INSERT INTO test_table1(Site) VALUES ('tst');

MariaDB [mpcol]> SELECT * FROM test_table1\G
----------------- 1. row ---------------------
Site: tst
Location: NULL
Call: NULL
Code: NULL
1 row in set (0.043 sec)

=================== INNODB ==================================
CREATE TABLE `test_table1_innodb` (
`Site` varchar(5) DEFAULT '',
`Location` varchar(55) DEFAULT '',
`Call` varchar(25) DEFAULT '',
`Code` varchar(4) DEFAULT ''
);

INSERT INTO test_table1_innodb(Site) VALUES ('tst');

SELECT * FROM test_table1_innodb\G
------------------- 1. row --------------------
Site: tst
Location:
Call:
Code:
1 row in set (0.000 sec)

2). Updating a field to an empty string updates the field to NULL

UPDATE test_table1 SET Location='loc';
--------------
Site: tst
Location: loc
Call: NULL
Code: NULL
1 row in set (0.008 sec)

UPDATE test_table1 SET Location='';

MariaDB [my.test]> select * from test_table1\G
----------------------------
Site: tst
Location: NULL
Call: NULL
Code: NULL
1 row in set (0.008 sec)

3). Searching for an empty string returns records with NULL:

select Code from test_table1 where Code=''\G
---------------
Code: NULL
1 row in set (0.008 sec)



 Comments   
Comment by Daniel Lee (Inactive) [ 2023-04-25 ]

Build verified:
engine: 1e56a0b557efb677d07533d05eb02ad723955317
server: 11c83d9ae9eb249d00589cc6ab71e7f4e67ffa27
buildNo: 7534

This scenario has been fixed as part of MCOL-271. ColumnStore and InnoDB results matched.

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