1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00
mariadb-columnstore-engine/mysql-test/columnstore/basic/r/mcs224_repeat_function.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

80 lines
2.1 KiB
Plaintext

DROP DATABASE IF EXISTS mcs224_db;
CREATE DATABASE mcs224_db;
USE mcs224_db;
CREATE TABLE t1
(
t1_INT INT,
t1_DOUBLE DOUBLE,
t1_FLOAT FLOAT,
t1_TEXT TEXT,
t1_CHAR_1 CHAR(1),
t1_DATETIME DATETIME
)ENGINE=Columnstore;
INSERT INTO t1 VALUES(NULL, NULL, NULL, NULL, NULL, NULL);
INSERT INTO t1 VALUES(25, -3.797, -7.402866, 'abcd', 'p', '2020-10-18 11:22:33');
SELECT t1_INT, REPEAT(t1_INT, 2) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_INT, 2)
NULL NULL
25 2525
SELECT t1_INT, REPEAT(t1_INT, 4) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_INT, 4)
NULL NULL
25 25252525
SELECT t1_INT, REPEAT(t1_INT, -1) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_INT, -1)
NULL NULL
25 NULL
SELECT t1_DOUBLE, REPEAT(t1_DOUBLE, 2) FROM t1 ORDER BY 1;
t1_DOUBLE REPEAT(t1_DOUBLE, 2)
NULL NULL
-3.797 -3.797e00-3.797e00
SELECT t1_DOUBLE, REPEAT(t1_DOUBLE, 4) FROM t1 ORDER BY 1;
t1_DOUBLE REPEAT(t1_DOUBLE, 4)
NULL NULL
-3.797 -3.797e00-3.797e00-3.797e00-3.797e00
SELECT t1_DOUBLE, REPEAT(t1_DOUBLE, -1) FROM t1 ORDER BY 1;
t1_DOUBLE REPEAT(t1_DOUBLE, -1)
NULL NULL
-3.797 NULL
SELECT t1_INT, REPEAT(t1_FLOAT, 2) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_FLOAT, 2)
NULL NULL
25 -7.40287e00-7.40287e00
SELECT t1_INT, REPEAT(t1_FLOAT, -1) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_FLOAT, -1)
NULL NULL
25 NULL
SELECT t1_INT, REPEAT(t1_TEXT, 2) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_TEXT, 2)
NULL NULL
25 abcdabcd
SELECT t1_INT, REPEAT(t1_TEXT, 4) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_TEXT, 4)
NULL NULL
25 abcdabcdabcdabcd
SELECT t1_INT, REPEAT(t1_TEXT, -1) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_TEXT, -1)
NULL NULL
25 NULL
SELECT t1_INT, REPEAT(t1_CHAR_1, 2) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_CHAR_1, 2)
NULL NULL
25 pp
SELECT t1_INT, REPEAT(t1_CHAR_1, 4) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_CHAR_1, 4)
NULL NULL
25 pppp
SELECT t1_INT, REPEAT(t1_CHAR_1, -1) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_CHAR_1, -1)
NULL NULL
25 NULL
SELECT t1_INT, REPEAT(t1_DATETIME, 2) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_DATETIME, 2)
NULL NULL
25 2020-10-18 11:22:332020-10-18 11:22:33
SELECT t1_INT, REPEAT(t1_DATETIME, -1) FROM t1 ORDER BY 1;
t1_INT REPEAT(t1_DATETIME, -1)
NULL NULL
25 NULL
DROP DATABASE mcs224_db;