db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4704) Incorrect nullability when casting non-nullable VARCHAR to BOOLEAN
Date Fri, 18 Jun 2010 13:30:24 GMT

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

Rick Hillegas updated DERBY-4704:
---------------------------------

    Attachment: derby-4704-01-aa-nullability.diff

Attaching derby-4704-01-aa-nullability.diff. This patch forces all casts of strings to booleans
to result in nullable types. That is because the string could be "unknown", which casts to
NULL. I am running the regression tests now.

Touches the following files:

---------------

M      java/engine/org/apache/derby/impl/sql/compile/CastNode.java

The actual change.

---------------

M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java

Enable Knut's test case.


> Incorrect nullability when casting non-nullable VARCHAR to BOOLEAN
> ------------------------------------------------------------------
>
>                 Key: DERBY-4704
>                 URL: https://issues.apache.org/jira/browse/DERBY-4704
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.7.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Rick Hillegas
>         Attachments: derby-4704-01-aa-nullability.diff, repro.diff
>
>
> With the following table definition and query
> CREATE TABLE T (X VARCHAR(10) NOT NULL);
> INSERT INTO T VALUES 'true', 'false', 'unknown';
> SELECT CAST(X AS BOOLEAN) FROM T;
> the meta-data for the returned result will say that the column is not nullable, although
it will contain a NULL value in the third row.

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


Mime
View raw message