[
https://issues.apache.org/jira/browse/DERBY-4469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rick Hillegas updated DERBY-4469:
---------------------------------
Attachment: derby-4469-02-ab-illegalCasts.diff
Attaching derby-4469-02-ab-illegalCasts.diff. This implements the full, harsh
behavior described by the functional spec. UDTs can't be cast to other UDTs or
to builtin types. Builtin types can't be cast to UDTs. Both implicit and
explicit casts are forbidden. Regression tests are running.
Touches the following files:
-----------
M java/engine/org/apache/derby/impl/sql/compile/JavaValueNode.java
M java/engine/org/apache/derby/impl/sql/compile/JavaToSQLValueNode.java
M java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
The full type information was being lost on the return values of functions. All
that was being preserved was the name of the class returned by the
corresponding Java method. This is not enough. We need to know the SQL type
returned by the function, that is, the full schema-qualified type.
-----------
M
java/engine/org/apache/derby/impl/sql/compile/UserDefinedTypeCompiler.java
M java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
M java/engine/org/apache/derby/impl/sql/compile/CharTypeCompiler.java
M java/engine/org/apache/derby/impl/sql/compile/BitTypeCompiler.java
Given full type information, prevent illegal implicit and explicit casts
involving UDTs.
-----------
M
java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsHelper.java
M
java/testing/org/apache/derbyTesting/functionTests/tests/lang/UDTTest.java
New tests to verify the harsh rules imposed by the functional spec.
> Fix the CASTing behavior of UDTs
> --------------------------------
>
> Key: DERBY-4469
> URL: https://issues.apache.org/jira/browse/DERBY-4469
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.6.0.0
> Reporter: Rick Hillegas
> Assignee: Rick Hillegas
> Attachments: derby-4469-01-aa-castNullsAndUntypedParameters.diff,
> derby-4469-02-ab-illegalCasts.diff
>
>
> The actual behavior of UDTs, now under construction, does not conform to the
> spec. The spec says that you can't CAST to or from UDTs. This is probably too
> harsh. We should allow the following CAST
> cast ( null as udtType )
> I also think that we should allow at least the implicit casting of subtypes
> to supertypes since Java gives us the ability to discover the type graph. See
> Knut's comment on DERBY-651 on Dec 11, 2009.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.