db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: [jira] Commented: (DERBY-7) Bug in NULLIF Function
Date Mon, 27 Dec 2004 23:25:01 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
But it should work even without the cast... Derby compiler should be
able to cast the untyped NULL to the other operand type.<br>
Christian d'Heureuse (JIRA) wrote:
<blockquote cite="mid897643317.1104187868197.JavaMail.apache@nagoya"
  <pre wrap="">     [ <a class="moz-txt-link-freetext" href="http://nagoya.apache.org/jira/browse/DERBY-7?page=comments#action_57077">http://nagoya.apache.org/jira/browse/DERBY-7?page=comments#action_57077</a>
Christian d'Heureuse commented on DERBY-7:

I think this is the same problem, because NULLIF() and CASE (whenThenExpression) both are
implemented using CONDITIONAL_NODE.

But for CASE, the error can be avoided by using "CAST(NULL as INT)" instead of an untyped

  values (case when 1.0=1.0 then cast(null as int) else 10 end);

For NULLIF() this is not possible.

  <blockquote type="cite">
    <pre wrap="">Bug in NULLIF Function

         Key: DERBY-7
         URL: <a class="moz-txt-link-freetext" href="http://nagoya.apache.org/jira/browse/DERBY-7">http://nagoya.apache.org/jira/browse/DERBY-7</a>
     Project: Derby
        Type: Bug
  Components: SQL
    Reporter: Tulika Agrawal
    Priority: Minor
  <pre wrap=""><!---->
  <blockquote type="cite">
    <pre wrap="">Reporting for Christian d'Heureuse, filed on derby-dev list.
The NULLIF built-in function of Cloudscape beta seems to accept
only string values.
 values nullif('a','b');
 --&gt; OK
 values nullif(1,2);
 --&gt; Error message: "ERROR 42X89: Types 'CHAR' and
     'INTEGER' are not type compatible. (Neither type
     is assignable to the other type.)"
  <pre wrap=""><!---->

View raw message