You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-5237 Proper handle DATETIME column for "ifnull" function. (#3201)
This commit is contained in:
16
mysql-test/columnstore/bugfixes/mcol-5237.result
Normal file
16
mysql-test/columnstore/bugfixes/mcol-5237.result
Normal file
@ -0,0 +1,16 @@
|
||||
DROP DATABASE IF EXISTS mcol_5237;
|
||||
CREATE DATABASE mcol_5237;
|
||||
USE mcol_5237;
|
||||
create table t1 (a varchar(1000), b datetime, c int) ENGINE=Columnstore DEFAULT CHARSET=utf8;
|
||||
insert into t1 values
|
||||
('abc', null, 1),
|
||||
('xyz', str_to_date('2022-09-22 00:00:00', '%Y-%m-%d %H:%i:%s'), 1);
|
||||
create view v1 as
|
||||
select a, NVL(b, str_to_date('1970-01-01 00:00:00', '%Y-%m-%d %H:%i:%s')) as b, c from t1;
|
||||
select count(*) from v1 where YEAR(b) = 2022;
|
||||
count(*)
|
||||
1
|
||||
select count(*) from v1 where YEAR(b) = 1970;
|
||||
count(*)
|
||||
1
|
||||
DROP DATABASE mcol_5237;
|
26
mysql-test/columnstore/bugfixes/mcol-5237.test
Normal file
26
mysql-test/columnstore/bugfixes/mcol-5237.test
Normal file
@ -0,0 +1,26 @@
|
||||
#
|
||||
# MCOL-5237
|
||||
#
|
||||
|
||||
--source ../include/have_columnstore.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE IF EXISTS mcol_5237;
|
||||
--enable_warnings
|
||||
CREATE DATABASE mcol_5237;
|
||||
USE mcol_5237;
|
||||
create table t1 (a varchar(1000), b datetime, c int) ENGINE=Columnstore DEFAULT CHARSET=utf8;
|
||||
|
||||
insert into t1 values
|
||||
('abc', null, 1),
|
||||
('xyz', str_to_date('2022-09-22 00:00:00', '%Y-%m-%d %H:%i:%s'), 1);
|
||||
|
||||
create view v1 as
|
||||
select a, NVL(b, str_to_date('1970-01-01 00:00:00', '%Y-%m-%d %H:%i:%s')) as b, c from t1;
|
||||
|
||||
select count(*) from v1 where YEAR(b) = 2022;
|
||||
select count(*) from v1 where YEAR(b) = 1970;
|
||||
|
||||
--disable_warnings
|
||||
DROP DATABASE mcol_5237;
|
||||
--enable_warnings
|
Reference in New Issue
Block a user