1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-03 08:20:57 +03:00
Files
mariadb-columnstore-engine/mysql-test/columnstore/basic/r/mcs169_bin_functions.result
Sergey Zefirov b53c231ca6 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.
2023-03-30 21:18:29 +03:00

60 lines
1.4 KiB
Plaintext

DROP DATABASE IF EXISTS mcs169_db;
CREATE DATABASE mcs169_db;
USE mcs169_db;
SET default_storage_engine=Columnstore;
CREATE TABLE t1 (a CHAR(1), b INT, c DATETIME, d DOUBLE);
INSERT INTO t1 VALUES (NULL, NULL, '0-0-0', NULL),('a', 12, '1212-12-12', 1.19691E+100),('b', 13, '1313-3-13 13:13:13', 2.1961E+18),('c', 14, '1414-4-14', 0.16191),('d', 15, '2015-5-15 15:15:15', 1.971917);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` char(1) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` datetime DEFAULT NULL,
`d` double DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1
SELECT BIN(2);
BIN(2)
10
SELECT BIN(3);
BIN(3)
11
SELECT a, BIN(a) FROM t1;
a BIN(a)
NULL NULL
a 0
b 0
c 0
d 0
SELECT b, BIN(b) FROM t1;
b BIN(b)
NULL NULL
12 1100
13 1101
14 1110
15 1111
SELECT c, BIN(c) FROM t1;
c BIN(c)
0000-00-00 00:00:00 0
1212-12-12 00:00:00 10010111100
1313-03-13 13:13:13 10100100001
1414-04-14 00:00:00 10110000110
2015-05-15 15:15:15 11111011111
SELECT d, BIN(d) FROM t1;
d BIN(d)
NULL NULL
1.19691e100 1
2.1961e18 10
0.16191 0
1.971917 1
SELECT BINARY "abcd";
BINARY "abcd"
abcd
SELECT BINARY a, BINARY b, BINARY c, BINARY d FROM t1;
BINARY a BINARY b BINARY c BINARY d
NULL NULL 0000-00-00 00:00:00 NULL
a 12 1212-12-12 00:00:00 1196909999999999904341
b 13 1313-03-13 13:13:13 2196100000000000000.00
c 14 1414-04-14 00:00:00 0.161910
d 15 2015-05-15 15:15:15 1.971917
DROP DATABASE mcs169_db;