diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-03-03 18:44:10 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-03-05 16:25:29 +0100 |
commit | ff93b77fd62bdb708e2b2b34f4e2202c12e727c4 (patch) | |
tree | 47b0e1bac37b65480da19faabd2fb85e3a947a58 /mysql-test/r/null.result | |
parent | 5a3a79ce5f20a862abdde505a683df1148e0dc37 (diff) | |
download | mariadb-git-ff93b77fd62bdb708e2b2b34f4e2202c12e727c4.tar.gz |
MDEV-9641 MDEV-9644 NULLIF assertions
* only copy args[0] to args[2] after fix_fields (when all item
substitutions have already happened)
* change QT_ITEM_FUNC_NULLIF_TO_CASE (that allows to print NULLIF
as CASE) to QT_ITEM_ORIGINAL_FUNC_NULLIF (that prohibits it).
So that NULLIF-to-CASE is allowed by default and only disabled
explicitly for SHOW VIEW|FUNCTION|PROCEDURE and mysql_make_view.
By default it is allowed (in particular in error messages and
debug output, that can happen anytime before or after optimizer).
Diffstat (limited to 'mysql-test/r/null.result')
-rw-r--r-- | mysql-test/r/null.result | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 382551b39ff..b8acc3e7319 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -1542,6 +1542,22 @@ 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; # # End of 10.1 tests # |