mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-18 21:44:02 +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.
25 lines
892 B
Plaintext
25 lines
892 B
Plaintext
DROP DATABASE IF EXISTS mcs97_db;
|
|
CREATE DATABASE mcs97_db;
|
|
USE mcs97_db;
|
|
CREATE TABLE t1 (a INT, b CHAR(5))ENGINE=Columnstore;
|
|
INSERT INTO t1 VALUES (NULL, NULL),(1, 'aaa'),(2, 'aaa'),(3, 'ccc'),(4, 'ddd'),(5, 'aaa'),(6, 'ddd'),(7, 'eee');
|
|
SELECT GROUP_CONCAT(a) FROM t1;
|
|
GROUP_CONCAT(a)
|
|
1,2,3,4,5,6,7
|
|
SELECT GROUP_CONCAT(a SEPARATOR ';') FROM t1 ORDER BY a DESC;
|
|
GROUP_CONCAT(a SEPARATOR ';')
|
|
1;2;3;4;5;6;7
|
|
SELECT GROUP_CONCAT(a ORDER BY a DESC SEPARATOR ';') FROM t1;
|
|
GROUP_CONCAT(a ORDER BY a DESC SEPARATOR ';')
|
|
7;6;5;4;3;2;1
|
|
SELECT GROUP_CONCAT(b) FROM t1;
|
|
GROUP_CONCAT(b)
|
|
aaa,aaa,ccc,ddd,aaa,ddd,eee
|
|
SELECT GROUP_CONCAT(DISTINCT b SEPARATOR ';') FROM t1 ORDER BY b ASC;
|
|
GROUP_CONCAT(DISTINCT b SEPARATOR ';')
|
|
eee;ccc;ddd;aaa
|
|
SELECT GROUP_CONCAT(b ORDER BY b DESC SEPARATOR ';') FROM t1;
|
|
GROUP_CONCAT(b ORDER BY b DESC SEPARATOR ';')
|
|
eee;ddd;ddd;ccc;aaa;aaa;aaa
|
|
DROP DATABASE mcs97_db;
|