Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 52857 invoked from network); 3 Apr 2007 16:03:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Apr 2007 16:03:14 -0000 Received: (qmail 58890 invoked by uid 500); 3 Apr 2007 16:03:21 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 58859 invoked by uid 500); 3 Apr 2007 16:03:21 -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 58844 invoked by uid 99); 3 Apr 2007 16:03:21 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 09:03:21 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.18.42.249] (HELO nwk-ea-fw-1.sun.com) (192.18.42.249) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 09:03:09 -0700 Received: from d1-sfbay-10.sun.com ([192.18.39.120]) by nwk-ea-fw-1.sun.com (8.13.6+Sun/8.12.9) with ESMTP id l33G2nGM024587 for ; Tue, 3 Apr 2007 09:02:49 -0700 (PDT) Received: from conversion-daemon.d1-sfbay-10.sun.com by d1-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0JFX00701J6SDP00@d1-sfbay-10.sun.com> (original mail from Richard.Hillegas@Sun.COM) for derby-dev@db.apache.org; Tue, 03 Apr 2007 09:02:49 -0700 (PDT) Received: from [192.9.61.193] by d1-sfbay-10.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0JFX00MKKJ8PD7SG@d1-sfbay-10.sun.com> for derby-dev@db.apache.org; Tue, 03 Apr 2007 09:02:49 -0700 (PDT) Date: Tue, 03 Apr 2007 09:04:59 -0700 From: Rick Hillegas Subject: Re: Feedback on wiki page http://wiki.apache.org/db-derby/BuiltInLanguageBasedOrderingDERBY-1478 In-reply-to: Sender: Richard.Hillegas@Sun.COM To: derby-dev@db.apache.org Message-id: <46127B2B.7080204@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7BIT References: User-Agent: Thunderbird 1.5.0.5 (X11/20060828) X-Virus-Checked: Checked by ClamAV on apache.org Hi Mamta, Thanks for describing this behavior on a tidy wiki page. Having all of this material collected in one place is great. I have a comment: 6)CHAR, VARCHAR functions do not look like they are defined in the SQL spec. But based on 5) above, the result character string type's collation can be considered same as the first argument's collation type if the first argument to CHAR/VARCHAR function is a character string type. If the first argument is not character string type, then the result character string of CHAR/VARCHAR will have the same collation as current schema's character set. The collation derivation will be implicit. I think the behavior would be easier to understand if it were uniform, that is, if the CHAR and VARCHAR operators always returned strings which had the collation of the current schema. I suspect you will find that this is easier to implement. I also think that this is the intention of the SQL Standard. Here is my reasoning: It seems to me that there is a default (implementation-defined) character set and collation for the whole database. That default can be overridden at the session, schema, and client-module levels. That is, once you know what database, session, schema, and client-module you are in, you know the default character set and collation for string datatypes mentioned by your SQL statements. This default can be explicitly overridden with a CAST or COLLATE clause. There are also explicit exceptions to this behavior for certain operators (e.g., TRIM, UPPER, LOWER, SUBSTR). The default character set and collation apply unless the SQL Standard explicitly defines an exception or your statement explicitly overrides the default. The default character set and collation apply to the return types of the CHAR and VARCHAR operators because the SQL Standard does not carve out an explicit exception for these operators. Is there some problem that would be solved by adopting the non-uniform behavior proposed on the wiki page? Thanks, -Rick Mamta Satoor wrote: > Hi, > > I have created a wiki page for DERBY-1478 : Add built in language > based ordering and like processing to Derby > > The wiki page is located at > http://wiki.apache.org/db-derby/BuiltInLanguageBasedOrderingDERBY-1478 and > it includes the current design proposal along with line items. If > anyone has any comments, please let me know. > > thanks, > Mamta