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

Rick Hillegas updated DERBY-4470:
---------------------------------

    Attachment: derby-4470-01-aa-forbidOrderingOperations.diff

Attaching derby-4470-01-aa-forbidOrderingOperations.diff. This prevents UDTs 
from being used in contexts which involve ordering operations. Tests passed 
cleanly for me.

This patch makes a couple changes:

1) Disables the logic which allows ordering operations on user defined types 
which implement Comparable. At a later date, we may want to support this useful 
functionality. That is, we may want to implement the SQL Standard syntax for 
UDT ordering (see part 2 of the Standard, section 11.56 <user-defined ordering 
definition> and part 13 of the Standard, section 9.11 <user-defined ordering 
definition>):

CREATE ORDERING FOR typeName ORDER FULL BY RELATIVE WITH COMPARABLE INTERFACE

However, that is an extra chunk of work which will not be included in the first 
rev of UDTs.

2) Prevents you from binding a UDT to a Java class which is already used to 
back one of our system-supplied types (e.g., java.lang.Integer). This 
limitation patches around the problem that various parts of the code assume a 
tight correspondence between those classes and the system-supplied types. If we 
want to lift this limitation later, we must be cautious: the assumptions are 
scattered across the code and it is hard to think up a systematic way to find 
them all.

Touches the following files:

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

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

Support for (2).

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

M      java/engine/org/apache/derby/iapi/types/TypeId.java

Support for both (1) and (2).

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

M      java/engine/org/apache/derby/iapi/types/DataTypeDescriptor.java

Support for (1).

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

M      java/engine/org/apache/derby/loc/messages.xml
M      java/shared/org/apache/derby/shared/common/reference/SQLState.java

New error messages.

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

M      
java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsHelper.java
M      
java/testing/org/apache/derbyTesting/functionTests/tests/lang/UDTTest.java

New tests.


> Forbid ordering operations on UDTs
> ----------------------------------
>
>                 Key: DERBY-4470
>                 URL: https://issues.apache.org/jira/browse/DERBY-4470
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.6.0.0
>            Reporter: Rick Hillegas
>         Attachments: derby-4470-01-aa-forbidOrderingOperations.diff
>
>
> Knut has provided an example of an ordering operation which succeeds on a UDT 
> in his Dec. 11, 2009 comment on DERBY-651.

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

Reply via email to