mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-20 09:07:44 +03:00
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.
23 lines
546 B
Plaintext
23 lines
546 B
Plaintext
DROP DATABASE IF EXISTS mcs189_db;
|
|
CREATE DATABASE mcs189_db;
|
|
USE mcs189_db;
|
|
CREATE TABLE t1 (a INT, b CHAR(5))ENGINE=Columnstore;
|
|
INSERT INTO t1 VALUES (NULL, NULL),(1, 'aaa'),(2, 'aaa'),(1, 'ccc'),(4, 'ddd'),(5, 'aaa'),(6, 'ddd'),(7, 'eee');
|
|
SELECT SUM(DISTINCT a) FROM t1;
|
|
SUM(DISTINCT a)
|
|
25
|
|
SELECT SUM(DISTINCT a) FROM t1 GROUP BY b HAVING b = 'aaa';
|
|
SUM(DISTINCT a)
|
|
8
|
|
SELECT b, SUM(DISTINCT a) FROM t1 GROUP BY b ORDER BY b DESC;
|
|
b SUM(DISTINCT a)
|
|
eee 7
|
|
ddd 10
|
|
ccc 1
|
|
aaa 8
|
|
NULL NULL
|
|
SELECT SUM(a) FROM t1;
|
|
SUM(a)
|
|
26
|
|
DROP DATABASE mcs189_db;
|