mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-05-02 19:24:47 +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.
53 lines
828 B
Plaintext
53 lines
828 B
Plaintext
DROP DATABASE IF EXISTS mcs180_db;
|
|
CREATE DATABASE mcs180_db;
|
|
USE mcs180_db;
|
|
SET default_storage_engine=Columnstore;
|
|
CREATE TABLE t1 (a CHAR(1), b INT);
|
|
INSERT INTO t1 VALUES (NULL, NULL), ('m', 6), ('N', 5), ('o', 4);
|
|
SHOW CREATE TABLE t1;
|
|
Table Create Table
|
|
t1 CREATE TABLE `t1` (
|
|
`a` char(1) DEFAULT NULL,
|
|
`b` int(11) DEFAULT NULL
|
|
) ENGINE=Columnstore DEFAULT CHARSET=latin1
|
|
SELECT ASCII(0);
|
|
ASCII(0)
|
|
48
|
|
SELECT ASCII(1);
|
|
ASCII(1)
|
|
49
|
|
SELECT ASCII(9);
|
|
ASCII(9)
|
|
57
|
|
SELECT ASCII('abc');
|
|
ASCII('abc')
|
|
97
|
|
SELECT ASCII('a');
|
|
ASCII('a')
|
|
97
|
|
SELECT ASCII('A');
|
|
ASCII('A')
|
|
65
|
|
SELECT ASCII('z');
|
|
ASCII('z')
|
|
122
|
|
SELECT ASCII('~');
|
|
ASCII('~')
|
|
126
|
|
SELECT ASCII('-');
|
|
ASCII('-')
|
|
45
|
|
SELECT a, ASCII(a) FROM t1;
|
|
a ASCII(a)
|
|
NULL NULL
|
|
m 109
|
|
N 78
|
|
o 111
|
|
SELECT b, ASCII(b) FROM t1;
|
|
b ASCII(b)
|
|
NULL NULL
|
|
6 54
|
|
5 53
|
|
4 52
|
|
DROP DATABASE mcs180_db;
|