summaryrefslogtreecommitdiff
path: root/mysql-test/r/null.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/null.result')
-rw-r--r--mysql-test/r/null.result40
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result
index cd4fa259b3f..3da7e4805c2 100644
--- a/mysql-test/r/null.result
+++ b/mysql-test/r/null.result
@@ -1531,6 +1531,46 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select nullif(count(distinct `t1`.`col1`),0) AS `nullif(count(distinct col1),0)` from `t1` latin1 latin1_swedish_ci
drop view v1;
drop table t1;
+create table t1 (col1 varchar(50) default null);
+insert into t1 (col1) values ('hello'), ('hello'), ('hello');
+create view v1 as select nullif(count(col1),0) from t1;
+select * from v1;
+nullif(count(col1),0)
+3
+select nullif(count(col1),0) from t1;
+nullif(count(col1),0)
+3
+drop view v1;
+drop table t1;
+select nullif((select 1), (select 2));
+nullif((select 1), (select 2))
+1
+create table t1 (f int);
+insert into t1 values (1),(2);
+select nullif( not f, 1 ) from t1;
+nullif( not f, 1 )
+0
+0
+drop table t1;
+set names utf8;
+create table t1 (f1 varchar(10));
+insert into t1 values ('2015-12-31');
+select power( timestamp( nullif( '2002-09-08', f1 ) ), 24 ) from t1;
+ERROR 22003: DOUBLE value is out of range in 'pow(cast((case when '2002-09-08' = '2015-12-31' then NULL else '2002-09-08' end) as datetime(6)),24)'
+drop table t1;
+CREATE TABLE t1 (f1 INT);
+INSERT INTO t1 VALUES (1),(2);
+PREPARE stmt FROM "SELECT * FROM t1 WHERE NULLIF( ( 1, 2 ) IN ( SELECT 3, 4 ), 1 )";
+EXECUTE stmt;
+f1
+EXECUTE stmt;
+f1
+DROP TABLE t1;
+CREATE TABLE t1 (i INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(i = ROUND(0), 14), 13), 12), 11), 10), 9), 8), 7), 6), 5), 4), 3), 2), 1);
+i
+DROP TABLE t1;
#
# End of 10.1 tests
#