Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1524C748B for ; Thu, 15 Dec 2011 17:44:52 +0000 (UTC) Received: (qmail 55062 invoked by uid 500); 15 Dec 2011 17:44:51 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 55039 invoked by uid 500); 15 Dec 2011 17:44:51 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 55022 invoked by uid 99); 15 Dec 2011 17:44:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2011 17:44:47 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [141.146.126.227] (HELO acsinet15.oracle.com) (141.146.126.227) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2011 17:44:37 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id pBFHiFf4015096 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 15 Dec 2011 17:44:15 GMT Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id pBFHiEQE012227 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 15 Dec 2011 17:44:14 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id pBFHiEou018808 for ; Thu, 15 Dec 2011 11:44:14 -0600 Received: from dhcp-rmdc-twvpn-1-vpnpool-10-159-21-215.vpn.oracle.com (/10.159.21.215) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 15 Dec 2011 09:44:13 -0800 Message-ID: <4EEA31E1.5080505@oracle.com> Date: Thu, 15 Dec 2011 09:44:01 -0800 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: "derby-dev@db.apache.org" Subject: some questions about collations Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090205.4EEA31F0.003F,ss=1,re=0.000,fgs=0 X-Virus-Checked: Checked by ClamAV on apache.org I have a couple questions about collations in Derby. As I understand it, Derby supports two collations: UCS_BASIC and TERRITORY_BASED. By default, all string types have UCS_BASIC collation and the string columns in system catalogs always have UCS_BASIC collation regardless of whether user tables use a different collation. If the database is created with the collation=TERRITORY_BASED attribute, then all string types created by users have TERRITORY_BASED collation. This includes the types of string columns in user tables, string args in user routines, and string constants used in queries. I believe that the following two statements are true. I will explain why shortly. Please let me know if you think that I am missing something. 1) Although you can cast a UCS_BASIC string to a TERRITORY_BASED string, you can't perform the reverse cast. 2) In a database which was created with TERRITORY_BASED collation, that is the collation of the string return types and args of all system procedures and functions. I believe (1) because I can't find any examples of how to perform the reverse cast. I don't see any examples in CollationTest and CollationTest2. The and tokens are not actually used anywhere in Derby's SQL grammar. I believe (2) because that is the behavior of the sample procedures and functions which I ran: syscs_util.syscs_check_table, syscs_util.syscs_set_database_property, and syscs_util.syscs_get_database_property. I haven't systematically tested all of Derby's system routines, but it seems likely to me that they all behave the same way. I think that this current behavior is reasonable. In particular, I don't think that we should use UCS_BASIC collation for the string return types and args of system routines. That would make the routines very awkward to use. Am I tracking? Does this summary sound correct? Thanks, -Rick