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

28 lines
958 B
Plaintext

DROP DATABASE IF EXISTS mcs57_db;
CREATE DATABASE mcs57_db;
USE mcs57_db;
CREATE TABLE t1(col INT COMMENT'autoincrement')ENGINE=Columnstore;
INSERT INTO t1 VALUES(NULL);
INSERT INTO t1 VALUES();
SELECT * FROM t1;
col
1
2
CREATE TABLE t2(t2_int INT COMMENT'autoincrement', t2_varchar VARCHAR(10) NOT NULL DEFAULT 'a')ENGINE=Columnstore;
INSERT INTO t2 VALUES();
INSERT INTO t2 VALUES(NULL,'');
INSERT INTO t2(t2_varchar) VALUES('bb'),('ccc'),('dddd'),('eeeee');
SELECT * FROM t2;
t2_int t2_varchar
1 a
2
3 bb
4 ccc
5 dddd
6 eeeee
CREATE TABLE t3(a INT auto_increment) ENGINE=Columnstore;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
CREATE TABLE t3(a INT autoincrement) ENGINE=Columnstore;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') ENGINE=Columnstore' at line 1
DROP DATABASE mcs57_db;