db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <j...@apache.org>
Subject [jira] Created: (DERBY-2967) Single character does not match high value unicode character with collation TERRITORY_BASED
Date Mon, 23 Jul 2007 16:55:31 GMT
Single character does not match high value unicode character with collation TERRITORY_BASED

                 Key: DERBY-2967
                 URL: https://issues.apache.org/jira/browse/DERBY-2967
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions:
            Reporter: Kathey Marsden

With TERRITORY_BASED collation '_' does not match  the character \uFA2D.  It is the same for
english or norwegian. FOR collation UCS_BASIC it matches fine.  Could you tell me if this
is a bug?
Here is a program to reproduce.

import java.sql.*;

public class HighCharacter {

   public static void main(String args[]) throws Exception
   System.out.println("\n Territory no_NO");
   Connection conn = DriverManager.getConnection("jdbc:derby:nordb;create=true;territory=no_NO;collation=TERRITORY_BASED");
   System.out.println("\n Territory en_US");
   conn = DriverManager.getConnection("jdbc:derby:endb;create=true;territory=en_US;collation=TERRITORY_BASED");
   System.out.println("\n Collation USC_BASIC");
   conn = DriverManager.getConnection("jdbc:derby:basicdb;create=true");


public static  void testLikeWithHighestValidCharacter(Connection conn) throws SQLException
   Statement stmt = conn.createStatement();
   try {
   stmt.executeUpdate("drop table t1");
   }catch (SQLException se)
   {// drop failure ok.
   stmt.executeUpdate("create table t1(c11 int)");
   stmt.executeUpdate("insert into t1 values 1");
   // \uFA2D - the highest valid character according to
   // Character.isDefined() of JDK 1.4;
   PreparedStatement ps =
   conn.prepareStatement("select 1 from t1 where '\uFA2D' like ?");
     String[] match = { "%", "_", "\uFA2D" };

   for (int i = 0; i < match.length; i++) {
   System.out.println("select 1 from t1 where '\\uFA2D' like " + match[i]);
   ps.setString(1, match[i]);
   ResultSet rs = ps.executeQuery();
   if( rs.next() && rs.getString(1).equals("1"))
   else          System.out.println("FAIL: no match");


Mamta made some comments on this issue in the following thread:


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

View raw message