mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-04-26 11:48:52 +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.
50 lines
1.4 KiB
Plaintext
50 lines
1.4 KiB
Plaintext
#
|
|
# Test REPEAT() function
|
|
# Author: Bharath, bharath.bokka@mariadb.com
|
|
#
|
|
-- source ../include/have_columnstore.inc
|
|
|
|
--disable_warnings
|
|
DROP DATABASE IF EXISTS mcs224_db;
|
|
--enable_warnings
|
|
|
|
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;
|
|
SELECT t1_INT, REPEAT(t1_INT, 4) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_INT, -1) FROM t1 ORDER BY 1;
|
|
|
|
SELECT t1_DOUBLE, REPEAT(t1_DOUBLE, 2) FROM t1 ORDER BY 1;
|
|
SELECT t1_DOUBLE, REPEAT(t1_DOUBLE, 4) FROM t1 ORDER BY 1;
|
|
SELECT t1_DOUBLE, REPEAT(t1_DOUBLE, -1) FROM t1 ORDER BY 1;
|
|
|
|
SELECT t1_INT, REPEAT(t1_FLOAT, 2) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_FLOAT, -1) FROM t1 ORDER BY 1;
|
|
|
|
SELECT t1_INT, REPEAT(t1_TEXT, 2) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_TEXT, 4) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_TEXT, -1) FROM t1 ORDER BY 1;
|
|
|
|
SELECT t1_INT, REPEAT(t1_CHAR_1, 2) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_CHAR_1, 4) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_CHAR_1, -1) FROM t1 ORDER BY 1;
|
|
|
|
SELECT t1_INT, REPEAT(t1_DATETIME, 2) FROM t1 ORDER BY 1;
|
|
SELECT t1_INT, REPEAT(t1_DATETIME, -1) FROM t1 ORDER BY 1;
|
|
|
|
# Clean UP
|
|
DROP DATABASE mcs224_db;
|