1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-5992: fix NULLIF if first param is NULL

This commit is contained in:
Leonid Fedorov
2025-03-27 14:43:50 +00:00
committed by Leonid Fedorov
parent 16904ab97d
commit 1fdeb740c9
4 changed files with 78 additions and 1 deletions

View File

@ -97,7 +97,7 @@ c NULL
d d
SELECT b, NULLIF(b, 15) FROM t1;
b NULLIF(b, 15)
NULL -2147483648
NULL NULL
12 12
13 13
14 14

View File

@ -0,0 +1,9 @@
DROP DATABASE IF EXISTS mcol5992;
CREATE DATABASE mcol5992;
USE mcol5992;
CREATE TABLE `CS_LEG` (`ID` bigint(20) DEFAULT NULL, `sess_count` smallint(6) DEFAULT NULL) ENGINE=Columnstore;
insert into CS_LEG(ID) values(1);
select NULLIF(sess_count,0) from CS_LEG;
NULLIF(sess_count,0)
NULL
DROP DATABASE mcol5992;

View File

@ -0,0 +1,16 @@
# MCOL-5992: NULLIF() returns NULL when NULL is the first argument
--source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcol5992;
--enable_warnings
CREATE DATABASE mcol5992;
USE mcol5992;
CREATE TABLE `CS_LEG` (`ID` bigint(20) DEFAULT NULL, `sess_count` smallint(6) DEFAULT NULL) ENGINE=Columnstore;
insert into CS_LEG(ID) values(1);
select NULLIF(sess_count,0) from CS_LEG;
DROP DATABASE mcol5992;