1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-05-02 19:24:47 +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

33 lines
1.2 KiB
Plaintext

--source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS regr_fe_conv;
--enable_warnings
CREATE DATABASE regr_fe_conv;
USE regr_fe_conv;
--disable_query_log
--source ../include/regression_create_dtypes.inc
--enable_query_log
select conv(dt, -10, -8) from dtypes where conv(dt, -10, -8) > 3731;
select dtm from dtypes where conv(dtm, -10, -8) > 3731 order by dtm, conv(dtm, 10, 8);
select conv(db, 10, 16), conv(ti, 8,16), conv(si, 16, 8), conv(i, 4, 8), conv(bi, 10, 8) from dtypes;
select conv (c1, 5, 10), conv(substr(c8,2,4), 8, 10), conv(concat(vc1, vc2), 10,8) from dtypes;
select substr(vc255,2,3), conv(substr(vc255,2,3),16,10) from dtypes where id < 50 ;
#select conv(max(d182), 10, 20) from dtypes;
#select conv(bi, 10, 24) from dtypes where id < 20;
select conv (c1, 5, 2), conv(substr(c8,2,4), 8, 2), conv(concat(vc1, vc2), 10, 2) from dtypes;
--disable_warnings
drop table if exists bug3509;
--enable_warnings
create table bug3509 (cookie varchar(32), d_datekey date) engine=columnstore;
insert into bug3509 values ('f48d2dce907ce3c54a9c12855754c0b5', 19980404);
select conv(substr(cookie,1,12),16,10), conv(substr(cookie,1,16),16,10), conv(substr(cookie,1,16),18,10) from bug3509;
drop table bug3509;
DROP DATABASE regr_fe_conv;