db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DERBY-6567) Incorrect nullability for CASE expression with parameter
Date Sat, 10 May 2014 22:12:30 GMT

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

Knut Anders Hatlen updated DERBY-6567:

    Attachment: d6567-1a.diff

The attached patch [^d6567-1a.diff] fixes the problem by setting the nullability of ConditionalNode
based on the nullability of the THEN and ELSE expressions. If (and only if) at least one of
the THEN and ELSE expressions is nullable, the result of the CASE expression is also nullable.
The patch also adds a test case that verifies the fix.

The regression tests ran cleanly with the patch.

> Incorrect nullability for CASE expression with parameter
> --------------------------------------------------------
>                 Key: DERBY-6567
>                 URL: https://issues.apache.org/jira/browse/DERBY-6567
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>         Attachments: d6567-1a.diff
> This JUnit test code fails because it detects that the query returns null even though
the result column is reported as not nullable:
> {code}
>         PreparedStatement ps = prepareStatement(
>                 "values case when false then 1 else ? end");
>         ps.setNull(1, Types.INTEGER);
>         JDBC.assertSingleValueResultSet(ps.executeQuery(), null);
> {code}

This message was sent by Atlassian JIRA

View raw message