[ http://issues.apache.org/jira/browse/DERBY-7?page=history ]

Jeremy Boynes updated DERBY-7:
------------------------------

    Attachment: derby-nullif.patch

A larger patch that also deals with the use of untyped NULLs in CASE 
statements. This allows NULLIF to be implemented as (CASE WHEN L=R THEN NULL 
ELSE L END). Adds a new testcase for various CASE statements and has been 
tested with the derbylang suite on WinXP/Sun JVM 1.4.2.

This patch also checks that the values returned by the different branches are 
compatible using the same check as the COALESCE function. Not sure if this is 
right, but at least it will be consistent. It might be worth exploring if 
COALESCE can be implemented as a large CASE statement.

It also reuses the SQLState codes for a couple of errors as I am not sure of 
the policy for changing the associated text or adding new ones.

> Bug in NULLIF Function
> ----------------------
>
>          Key: DERBY-7
>          URL: http://issues.apache.org/jira/browse/DERBY-7
>      Project: Derby
>         Type: Bug
>   Components: SQL
>     Versions: 10.0.2.0
>     Reporter: Tulika Agrawal
>     Priority: Minor
>  Attachments: Derby-7.txt, derby-nullif.patch
>
> Reporting for Christian d'Heureuse, filed on derby-dev list.
> The NULLIF built-in function of Cloudscape 10.0.1.0 beta seems to accept
> only string values.
> Examples:
>  values nullif('a','b');
>  --> OK
>  values nullif(1,2);
>  --> Error message: "ERROR 42X89: Types 'CHAR' and
>      'INTEGER' are not type compatible. (Neither type
>      is assignable to the other type.)"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to