1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-271 empty strings should not be NULLs (#2794)

This patch improves handling of NULLs in textual fields in ColumnStore.
Previously empty strings were considered NULLs and it could be a problem
if data scheme allows for empty strings. It was also one of major
reasons of behavior difference between ColumnStore and other engines in
MariaDB family.

Also, this patch fixes some other bugs and incorrect behavior, for
example, incorrect comparison for "column <= ''" which evaluates to
constant True for all purposes before this patch.
This commit is contained in:
Sergey Zefirov
2023-03-30 17:26:45 +01:00
committed by Roman Nozdrin
parent 0ea592da80
commit b53c231ca6
417 changed files with 12459 additions and 3520 deletions

View File

@ -3,8 +3,8 @@ CREATE DATABASE mcs82_db;
USE mcs82_db;
CREATE TABLE t1 (t1_int INT, t1_char CHAR(5))ENGINE=Columnstore;
CREATE TABLE t2 (t2_int INT, t2_char CHAR(5))ENGINE=Columnstore;
INSERT INTO t1 VALUES (NULL, ''),(1, 'aaa'),(2, 'bbb'),(3, 'ccc'),(4, 'ddd'),(5, 'aa'),(6, ''),(7, 'aaaaa');
INSERT INTO t2 VALUES (NULL, ''),(1, 'hhhh'),(3, 'iii'),(5, 'jjj'),(6, ''),(7, 'lll'),(9, 'm'),(11, 'nnn');
INSERT INTO t1 VALUES (NULL, NULL),(1, 'aaa'),(2, 'bbb'),(3, 'ccc'),(4, 'ddd'),(5, 'aa'),(6, ''),(7, 'aaaaa');
INSERT INTO t2 VALUES (NULL, NULL),(1, 'hhhh'),(3, 'iii'),(5, 'jjj'),(6, ''),(7, 'lll'),(9, 'm'),(11, 'nnn');
SELECT * FROM t1 ORDER BY t1_int;
t1_int t1_char
NULL NULL
@ -13,7 +13,7 @@ NULL NULL
3 ccc
4 ddd
5 aa
6 NULL
6
7 aaaaa
UPDATE t1 JOIN t2 on t1.t1_int=t2.t2_int SET t1.t1_char='sssss';
SELECT * FROM t1 ORDER BY t1_int;
@ -44,7 +44,7 @@ NULL NULL
1 hhhh
3 iii
5 jjj
6 NULL
6
7 lll
9 m
11 nnn