db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DERBY-5959) Territory-based collation is not robust against changes in the collation rules
Date Mon, 22 Oct 2012 14:54:12 GMT
Knut Anders Hatlen created DERBY-5959:
-----------------------------------------

             Summary: Territory-based collation is not robust against changes in the collation
rules
                 Key: DERBY-5959
                 URL: https://issues.apache.org/jira/browse/DERBY-5959
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.10.0.0
            Reporter: Knut Anders Hatlen


When accessing a database with territory-based collation, Derby will use the collation rules
of the collator returned by Collator.getInstance(databaseLocale). However, there is no guarantee
that those rules are consistent across different JVM vendors and versions. This means that
the ordering could vary, and inconsistencies could sneak into the indexes.

One example is that Oracle's JDK changed the collation rules for Turkish between Java 5 and
Java 6, so if you run the following script

connect 'jdbc:derby:memory:db;territory=tr_TR;collation=TERRITORY_BASED;create=true';
create table t(c char(2));
insert into t values 'ıa', 'Ia', 'ia', 'İa', 'ıb', 'Ib', 'ib', 'İb';
select * from t order by c;

you'll get different results on Java 5 and on Java 6 and later.

Java 5 will order the results like this:

ij> select * from t order by c;
C   
----
ıa  
Ia  
ia  
İa  
ıb  
Ib  
ib  
İb  

8 rows selected

Java 6 and later order them like this like this:

ij> select * from t order by c;
C   
----
ıa  
Ia  
ıb  
Ib  
ia  
İa  
ib  
İb  

8 rows selected

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message