mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
Manual merge
This commit is contained in:
parent
d039d345e6
commit
ac42a5f0a6
1 changed files with 15 additions and 2 deletions
|
@ -25,9 +25,10 @@ explain extended select if(u=1,st,binary st) s from t1 where st like "%a%" order
|
||||||
#
|
#
|
||||||
# NULLIF test
|
# NULLIF test
|
||||||
#
|
#
|
||||||
select nullif(u=0, 'test') from t1;
|
select nullif(u, 1) from t1;
|
||||||
explain extended select nullif(u=0, 'test') from t1;
|
explain extended select nullif(u, 1) from t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
select nullif(1,'test');
|
||||||
|
|
||||||
#
|
#
|
||||||
# Bug 2629
|
# Bug 2629
|
||||||
|
@ -62,6 +63,18 @@ drop table t1;
|
||||||
SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
|
SELECT NULLIF(5,5) IS NULL, NULLIF(5,5) IS NOT NULL;
|
||||||
|
|
||||||
#
|
#
|
||||||
|
# Bug #9669 Ordering on IF function with FROM_UNIXTIME function fails
|
||||||
|
#
|
||||||
|
CREATE TABLE `t1` (
|
||||||
|
`id` int(11) NOT NULL ,
|
||||||
|
`date` int(10) default NULL,
|
||||||
|
`text` varchar(32) NOT NULL
|
||||||
|
);
|
||||||
|
INSERT INTO t1 VALUES (1,1110000000,'Day 1'),(2,1111000000,'Day 2'),(3,1112000000,'Day 3');
|
||||||
|
SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord ASC;
|
||||||
|
SELECT id, IF(date IS NULL, '-', FROM_UNIXTIME(date, '%d-%m-%Y')) AS date_ord, text FROM t1 ORDER BY date_ord DESC;
|
||||||
|
DROP TABLE t1;
|
||||||
|
|
||||||
# Test for bug #11142: evaluation of NULLIF when the first argument is NULL
|
# Test for bug #11142: evaluation of NULLIF when the first argument is NULL
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue