[
https://issues.apache.org/jira/browse/DERBY-4658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12879809#action_12879809
]
Rick Hillegas commented on DERBY-4658:
--------------------------------------
Hi Knut. Thanks for taking a look at the new patch. I don't think that the
changes in BooleanConstantNode affect the line in CastNode which you're
referring to. The problem there is that the nullability of the CastNode is
copied from the nullability of the source cast operand. In the following
statement
cast ( 'unknown' as boolean )
the source operand is a string constant which is not nullable, but the result
of the cast is nullable--in fact, it is NULL.
> Allow explicit casts of string values to BOOLEAN
> ------------------------------------------------
>
> Key: DERBY-4658
> URL: https://issues.apache.org/jira/browse/DERBY-4658
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Reporter: Rick Hillegas
> Assignee: Rick Hillegas
> Attachments: derby-4658-01-aa-booleanCasts.diff,
> derby-4658-01-ab-booleanCasts.diff
>
>
> The SQL Standard allows strings to be explicitly cast to BOOLEAN values.
> Strings are the only type (other than BOOLEAN itself) which can be cast to
> BOOLEAN. As part of our expanding support for the BOOLEAN datatype, we should
> allow these casts.
> Casting string types to boolean is defined by part 2, section 6.12 (<cast
> specification>), general rule 20:
> a) Trim whitespace off the string
> b) Then apply the rules in section 5.3 (<literal>). This means that the
> trimmed string must be 'TRUE', 'FALSE', or 'UNKNOWN', regardless of case.
> c) Otherwise, raise an exception.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.