List:Commits« Previous MessageNext Message »
From:V Narayanan Date:June 29 2009 2:02am
Subject:bzr commit into mysql-5.1-bugteam branch (v.narayanan:2982) Bug#45196
View as plain text  
#At file:///home/narayanan/Work/mysql_checkouts/shared_repository_directory/mysql-5.1-bugteam-45196-1/ based on revid:epotemkin@stripped

 2982 V Narayanan	2009-06-29
      Bug#45196  Some collations do not sort correctly with IBMDB2I
      
      Some collations--including cp1250_czech_cs,latin2_czech_cs,
      ucs2/utf8_czech_ci, ucs2/utf8_danish_ci--are not being
      sorted correctly by the IBMDB2I storage engine. This
      was being caused because the sort order used by DB2 is
      incompatible with the order expected by MySQL.
      
      This patch removes support for the cp1250_czech_cs and
      latin2_czech_cs collations because it has been determined
      that the sort order used by DB2 is incompatible with the
      order expected by MySQL. Users needing a czech collation
      with IBMDB2I are encouraged to use a Unicode-based collation 
      instead of these single-byte collations. This patch also
      modifies the DB2 sort sequence used for ucs2/utf8_czech_ci
      and ucs2/utf8_danish_ci collations to better match the
      sorting expected by MySQL. This will only affect indexes
      or tables that are newly created through the IBMDB2I storage
      engine. Existing IBMDB2I tables will retain the old sort
      sequence until recreated.
     @ mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result
        Bug#45196  Some collations do not sort correctly with IBMDB2I
        
        Result file for the test case.
     @ mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test
        Bug#45196  Some collations do not sort correctly with IBMDB2I
        
        Adding tests for testing the sort order with the modified collations.
     @ storage/ibmdb2i/db2i_collationSupport.cc
        Bug#45196  Some collations do not sort correctly with IBMDB2I
        
        Remove the support for the cp1250_czech_cs and latin2_czech_cs 
        collations because it has been determined that the sort order
        used by DB2 is incompatible with the order expected by MySQL.
        Users needing a czech collation with IBMDB2I are encouraged to
        use a Unicode-based collation instead of these single-byte
        collations. This patch also modifies the DB2 sort sequence
        used for ucs2/utf8_czech_ci and ucs2/utf8_danish_ci collations
        to better match the sorting expected by MySQL. This will only 
        affect indexes or tables that are newly created through the
        IBMDB2I storage engine. Existing IBMDB2I tables will retain
        the old sort sequence until recreated.

    added:
      mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result
      mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test
    modified:
      storage/ibmdb2i/db2i_collationSupport.cc
=== added file 'mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result'
--- a/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/r/ibmdb2i_bug_45196.result	2009-06-29 02:02:17 +0000
@@ -0,0 +1,33 @@
+drop table if exists t1;
+create table t1 (c char(10), index(c)) collate ucs2_czech_ci engine=ibmdb2i;
+insert into t1 values ("ch"),("h"),("i");
+select * from t1 order by c;
+c
+h
+ch
+i
+drop table t1;
+create table t1 (c char(10), index(c)) collate utf8_czech_ci engine=ibmdb2i;
+insert into t1 values ("ch"),("h"),("i");
+select * from t1 order by c;
+c
+h
+ch
+i
+drop table t1;
+create table t1 (c char(10), index(c)) collate ucs2_danish_ci engine=ibmdb2i;
+insert into t1 values("abc"),("abcd"),("aaaa");
+select c from t1 order by c;
+c
+abc
+abcd
+aaaa
+drop table t1;
+create table t1 (c char(10), index(c)) collate utf8_danish_ci engine=ibmdb2i;
+insert into t1 values("abc"),("abcd"),("aaaa");
+select c from t1 order by c;
+c
+abc
+abcd
+aaaa
+drop table t1;

=== added file 'mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test'
--- a/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/ibmdb2i/t/ibmdb2i_bug_45196.test	2009-06-29 02:02:17 +0000
@@ -0,0 +1,26 @@
+source suite/ibmdb2i/include/have_ibmdb2i.inc;
+source suite/ibmdb2i/include/have_i61.inc;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+create table t1 (c char(10), index(c)) collate ucs2_czech_ci engine=ibmdb2i;
+insert into t1 values ("ch"),("h"),("i");
+select * from t1 order by c;
+drop table t1;
+
+create table t1 (c char(10), index(c)) collate utf8_czech_ci engine=ibmdb2i;
+insert into t1 values ("ch"),("h"),("i");
+select * from t1 order by c;
+drop table t1;
+
+create table t1 (c char(10), index(c)) collate ucs2_danish_ci engine=ibmdb2i;           
+insert into t1 values("abc"),("abcd"),("aaaa"); 
+select c from t1 order by c;
+drop table t1;
+
+create table t1 (c char(10), index(c)) collate utf8_danish_ci engine=ibmdb2i;           
+insert into t1 values("abc"),("abcd"),("aaaa"); 
+select c from t1 order by c;
+drop table t1;

=== modified file 'storage/ibmdb2i/db2i_collationSupport.cc'
--- a/storage/ibmdb2i/db2i_collationSupport.cc	2009-04-10 06:26:54 +0000
+++ b/storage/ibmdb2i/db2i_collationSupport.cc	2009-06-29 02:02:17 +0000
@@ -44,7 +44,7 @@ OF SUCH DAMAGE.
   between corresponding array slots but is incomplete without case-sensitivity
   markers dynamically added to the mySqlSortSequence names.
 */
-#define MAX_COLLATION 89
+#define MAX_COLLATION 87
 static const char* mySQLCollation[MAX_COLLATION] = 
 {
     {"ascii_general"},
@@ -52,7 +52,6 @@ static const char* mySQLCollation[MAX_CO
     {"big5_chinese"},
     {"big5"},
     {"cp1250_croatian"},
-    {"cp1250_czech"},
     {"cp1250_general"},
     {"cp1250_polish"},
     {"cp1250"},
@@ -84,7 +83,6 @@ static const char* mySQLCollation[MAX_CO
     {"latin1_swedish"},
     {"latin1"},
     {"latin2_croatian"},
-    {"latin2_czech"},
     {"latin2_general"},
     {"latin2_hungarian"},
     {"latin2"},
@@ -146,7 +144,6 @@ static const char* mySqlSortSequence[MAX
     {"QACHT04B0"},  
     {"QBCHT04B0"},
     {"QALA20481"},  
-    {"QBLA20481"},
     {"QCLA20481"},
     {"QDLA20481"},
     {"QELA20481"},
@@ -178,7 +175,6 @@ static const char* mySqlSortSequence[MAX
     {"QELA1047C"},
     {"QFLA1047C"},
     {"QCLA20366"},  
-    {"QDLA20366"},
     {"QELA20366"},
     {"QFLA20366"},
     {"QGLA20366"},
@@ -190,8 +186,8 @@ static const char* mySqlSortSequence[MAX
     {"QDJPN04B0"},
     {"QATHA0346"},  
     {"QBTHA0346"},  
-    {"ACS"},        
-    {"ADA"},
+    {"ACS_CZ"},        
+    {"ADA_DK"},
     {"AEO"},
     {"AET"},
     {"QAUCS04B0"},  
@@ -211,8 +207,8 @@ static const char* mySqlSortSequence[MAX
     {"*HEX"},
     {"QEJPN04B0"},  
     {"QFJPN04B0"},
-    {"ACS"},        
-    {"ADA"},
+    {"ACS_CZ"},        
+    {"ADA_DK"},
     {"AEO"},
     {"AET"},
     {"QAUCS04B0"},


Attachment: [text/bzr-bundle] bzr/v.narayanan@sun.com-20090629020217-e8xn0c2xiee2hidj.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (v.narayanan:2982) Bug#45196V Narayanan29 Jun