You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (Closed) (JIRA)" <ji...@apache.org> on 2011/12/25 17:00:30 UTC
[jira] [Closed] (DERBY-5556) NULLIF and CASE return different
result
[ https://issues.apache.org/jira/browse/DERBY-5556?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Knut Anders Hatlen closed DERBY-5556.
-------------------------------------
Resolution: Invalid
> 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
> Labels: case, nullif
>
> 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