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.
28 lines
604 B
Plaintext
28 lines
604 B
Plaintext
DROP DATABASE IF EXISTS mcs95_db;
|
|
CREATE DATABASE mcs95_db;
|
|
USE mcs95_db;
|
|
CREATE TABLE t1 (a CHAR(1), b INT)ENGINE=Columnstore;
|
|
INSERT INTO t1 VALUES (NULL, NULL),('a', 12),('a', 13),('b', 14),('c', 15),('d', 16),('d', 17),('b', 18),('a', 19);
|
|
SELECT a, VARIANCE(b) FROM t1 GROUP BY a ORDER BY a;
|
|
a VARIANCE(b)
|
|
NULL NULL
|
|
a 9.5556
|
|
b 4.0000
|
|
c 0.0000
|
|
d 0.2500
|
|
SELECT a, VAR_POP(b) FROM t1 GROUP BY a ORDER BY a;
|
|
a VAR_POP(b)
|
|
NULL NULL
|
|
a 9.5556
|
|
b 4.0000
|
|
c 0.0000
|
|
d 0.2500
|
|
SELECT a, VAR_SAMP(b) FROM t1 GROUP BY a ORDER BY a;
|
|
a VAR_SAMP(b)
|
|
NULL NULL
|
|
a 14.3333
|
|
b 8.0000
|
|
c NULL
|
|
d 0.5000
|
|
DROP DATABASE mcs95_db;
|