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.
30 lines
820 B
Plaintext
30 lines
820 B
Plaintext
#
|
|
# Test POSITION() function
|
|
# Author: Bharath, bharath.bokka@mariadb.com
|
|
#
|
|
-- source ../include/have_columnstore.inc
|
|
|
|
--disable_warnings
|
|
DROP DATABASE IF EXISTS mcs222_db;
|
|
--enable_warnings
|
|
|
|
CREATE DATABASE mcs222_db;
|
|
USE mcs222_db;
|
|
|
|
CREATE TABLE t1 (a INT, b CHAR(15))ENGINE=Columnstore;
|
|
INSERT INTO t1 VALUES (NULL, NULL),(1, 'a'),(2, 'aqaaqq'),(3, 'cqcqqcq'),(4, 'qdqdqqdq'),(5, 'aaaqq');
|
|
|
|
SELECT POSITION('zz' IN 'aazazazapq');
|
|
SELECT POSITION('zz' IN 'zzaazapq');
|
|
SELECT POSITION('zz' IN 'aazzzazzaq');
|
|
|
|
SELECT b, POSITION('a' IN b) FROM t1 ORDER BY b;
|
|
SELECT b, POSITION('aa' IN b) FROM t1 ORDER BY b;
|
|
SELECT b, POSITION('aaa' IN b) FROM t1 ORDER BY b;
|
|
SELECT b, POSITION('qq' IN b) FROM t1 ORDER BY b;
|
|
|
|
SELECT b, POSITION(concat(b, 'zzz') IN 'azzzghijk') FROM t1 ORDER BY b;
|
|
|
|
# Clean UP
|
|
DROP DATABASE mcs222_db;
|