db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A B (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-1620) SQL CASE statement returns ERROR 42X89 when including NULL as a return value
Date Wed, 06 Jun 2007 22:30:26 GMT

     [ https://issues.apache.org/jira/browse/DERBY-1620?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

A B updated DERBY-1620:

    Attachment: derby1620_test_v2.patch

Thank you for the revised patch, John.  I applied it to my codeline and ran the regression
tests (derbyall and suites.All) as a sanity check.  I then did some cleanup of the new CaseExpressionTest
to a) keep lines under 80 characters, and b) move common code into a single testCaseExpressionQuery()
method, to avoid code duplication.  I also verified that the new test fails if the fix for
this issue is reverted, and passes with the fix applied.  So everything looks good.

Committed derby1620_test_v2.patch (which has the changes I mentioned above) with svn # 544974:

  URL: http://svn.apache.org/viewvc?view=rev&rev=544974

Marking issue as resolved in 10.3.  I'll leave it up to you close it if everything looks okay.

Thanks for fixing this bug!

> SQL CASE statement returns ERROR 42X89 when including NULL as a return value
> ----------------------------------------------------------------------------
>                 Key: DERBY-1620
>                 URL: https://issues.apache.org/jira/browse/DERBY-1620
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>         Environment: Windows XP
>            Reporter: John Peterson
>            Assignee: John Peterson
>            Priority: Minor
>             Fix For:
>         Attachments: ConditionalNode.diff, ConditionalNode.diff, ConditionalNode.diff,
ConditionalNode.diff, derby1620_test.patch, derby1620_test_v2.patch, Derby_Community_Discussion.doc,
derbyall_report.txt, resultset.tmp, resultset.tmp, sysinfo_and_example.txt
> This bug appears to be related to the DERBY-7 bug (NULLIF() function).   When NULL is
used during a CASE statement, Derby requires the NULL to be CAST to the appropriate type.
 This does not appear to meet the SQL 2003 Standard for the Case Expression (see attached
Word document).   See the attached Word document to view the Derby Community Discussion about
this issue.  See the attached .TXT to view the SYSINFO and to see an example of the steps
to reproduce using IJ.
> Steps to Reproduce:
> ij>values case when 1=2 then 3 else NULL end;
> ERROR 42X89:  Types 'INTEGER' and 'CHAR' are not type compatible.  Neither type is assignable
to the other type.
> Current Workaround:
> ij>values case when 1=2 then 3 else cast(NULL as INT) end;

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message