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.
42 lines
1.1 KiB
Plaintext
42 lines
1.1 KiB
Plaintext
DROP DATABASE IF EXISTS mcs259_db;
|
|
CREATE DATABASE mcs259_db;
|
|
USE mcs259_db;
|
|
CREATE TABLE t1 (a INT, b VARCHAR(30))ENGINE=Columnstore;
|
|
INSERT INTO t1 VALUES (NULL, NULL),(1, 'mariadb'),(2, 'columnstore'),(3, 'mariadb columnstore');
|
|
SELECT INSTR('abcdefghi', 'i') FROM t1 LIMIT 1;
|
|
INSTR('abcdefghi', 'i')
|
|
9
|
|
SELECT INSTR('abcdefghi', 'z') FROM t1 LIMIT 1;
|
|
INSTR('abcdefghi', 'z')
|
|
0
|
|
SELECT INSTR('pqrstuvwxyz', 'u') FROM t1 LIMIT 1;
|
|
INSTR('pqrstuvwxyz', 'u')
|
|
6
|
|
SELECT INSTR('mnopmm', 'm') FROM t1 LIMIT 1;
|
|
INSTR('mnopmm', 'm')
|
|
1
|
|
SELECT INSTR('mnopmm', 'mm') FROM t1 LIMIT 1;
|
|
INSTR('mnopmm', 'mm')
|
|
5
|
|
SELECT b, INSTR(b, 'mariadb') FROM t1 ORDER BY 1;
|
|
b INSTR(b, 'mariadb')
|
|
NULL NULL
|
|
columnstore 0
|
|
mariadb 1
|
|
mariadb columnstore 1
|
|
SELECT b, INSTR(concat(b,'pqr'), 'qr') FROM t1 ORDER BY 1;
|
|
b INSTR(concat(b,'pqr'), 'qr')
|
|
NULL NULL
|
|
columnstore 13
|
|
mariadb 9
|
|
mariadb columnstore 21
|
|
SELECT b, INSTR(concat('pqr', b), 'qr') FROM t1 ORDER BY 1;
|
|
b INSTR(concat('pqr', b), 'qr')
|
|
NULL NULL
|
|
columnstore 2
|
|
mariadb 2
|
|
mariadb columnstore 2
|
|
SELECT b, INSTR(b) FROM t1 ORDER BY 1;
|
|
ERROR 42000: Incorrect parameter count in the call to native function 'INSTR'
|
|
DROP DATABASE mcs259_db;
|