db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A B (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2599) Set correct collation type and derivation on DataTypeDescriptor(DTD).
Date Mon, 21 May 2007 19:04:16 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12497546

A B commented on DERBY-2599:

Hi Mamta, quick question on the latest patch.

The aggregate patch includes the following diff in ConcatenationOperatorNode:

+            if (rightOperand.getTypeId().isStringTypeId())
+            {//collation of ? operand should be same as the other operand
+                leftOperand.getTypeServices().setCollationDerivation(
+                    rightOperand.getTypeServices().getCollationDerivation());
+                leftOperand.getTypeServices().setCollationType(
+                    rightOperand.getTypeServices().getCollationType());
+            }

The collation wiki page says the following under "Collation Determination":

  8) JDBC parameters (ie. ?) where the type of the parameter is a character
     type will have the same collation as of the character set of the schema
     where the statement is prepared. The collation derivation will be

Is there a mismatch between the code and the wiki page?

I tried to write a sample case to demonstrate the difference but it looks like Derby always
sets the result of a concatenation operator to LONG VARCHAR if one operand is a char type
and the other is a parameter (that's the behavior I saw with my examples, anyways; maybe I'm
missing something).  Since LONG VARCHARs are not comparable, that preempts any collation behavior
that I was trying to test.  But I thought I'd post the question anyways, in case there's something
here that should be changed (perhaps just the wiki page?).

Apologies if I'm overlooking something obvious...

> Set correct collation type and derivation on DataTypeDescriptor(DTD).
> ---------------------------------------------------------------------
>                 Key: DERBY-2599
>                 URL: https://issues.apache.org/jira/browse/DERBY-2599
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions:
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2599_collationType_default_UCS_BASIC_v1_diff.txt, DERBY2599_collationType_default_UCS_BASIC_v1_stat.txt,
DERBY2599_correct_collation_for_cast_v1_diff.txt, DERBY2599_correct_collation_for_cast_v1_stat.txt,
DERBY2599_IntermediatePatch_v1_diff.txt, DERBY2599_IntermediatePatch_v1_stat.txt, DERBY2599_Set_collation_for_aggregates_v1_diff.txt,
DERBY2599_Set_collation_for_aggregates_v1_stat.txt, DERBY2599_Set_collation_for_aggregates_v1_stat.txt,
> DTD has TypeDescriptorImpl in it which has 2 new fields, namely, collationType and collationDerivation.
These 2 fields are available for all different types of DTDs but only apply to character types.
The other datatypes should ignore these 2 fields.
> This Jira is a placeholder for loading the correct values into collationType and collationDerivation.

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

View raw message