NULLIF and CASE return different result ---------------------------------------
Key: DERBY-5556 URL: https://issues.apache.org/jira/browse/DERBY-5556 Project: Derby Issue Type: Bug Components: SQL Affects Versions: 10.8.1.2 Environment: $ uname -a Linux hleemus 3.1.4-1-ARCH #1 SMP PREEMPT Tue Nov 29 08:55:45 CET 2011 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5000+ AuthenticAMD GNU/Linux $ java -version java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode) $ java -Dij.database=jdbc:derby:dbase -classpath /home/hleem/.m2/repository/org/apache/derby/derbytools/10.8.1.2/derbytools-10.8.1.2.jar:/home/hleem/.m2/repository/org/apache/derby/derby/10.8.1.2/derby-10.8.1.2.jar org.apache.derby.tools.ij ij version 10.8 CONNECTION0* - jdbc:derby:dbase * = current connection ij> select pr_parent FROM SDB.PARAMS; PR_PARENT ----------- 10 10 10 NULL 4 rows selected ij> select case when pr_parent is null then 0 else pr_parent end FROM SDB.PARAMS; 1 ----------- 10 10 10 0 4 rows selected ij> select nullif(pr_parent,0) FROM SDB.PARAMS; 1 ----------- 10 10 10 NULL 4 rows selected ij> exit; $ Reporter: hleem NULLIF and CASE return different result with null INTEGER value. 'pr_parent' in query is INTEGER type. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira