Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 42785 invoked from network); 31 May 2007 04:45:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 May 2007 04:45:42 -0000 Received: (qmail 1852 invoked by uid 500); 31 May 2007 04:45:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 1815 invoked by uid 500); 31 May 2007 04:45:46 -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 1806 invoked by uid 99); 31 May 2007 04:45:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 May 2007 21:45:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [68.142.198.207] (HELO smtp108.sbc.mail.mud.yahoo.com) (68.142.198.207) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 30 May 2007 21:45:40 -0700 Received: (qmail 89675 invoked from network); 31 May 2007 04:45:18 -0000 Received: from unknown (HELO ?192.168.254.49?) (ddebrunner@sbcglobal.net@75.24.213.36 with plain) by smtp108.sbc.mail.mud.yahoo.com with SMTP; 31 May 2007 04:45:18 -0000 X-YMail-OSG: wNxe41sVM1kwdbBR.lEd8Y0bOui3vze2zPR6AQAWcKBxgzK3FLMH97g4_JVYHS9lzZHA1IZuug-- Message-ID: <465E5299.3060604@apache.org> Date: Wed, 30 May 2007 21:44:09 -0700 From: Daniel John Debrunner User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: more on system schema vs. user schema and character constants. References: <465E1595.6030800@sbcglobal.net> In-Reply-To: <465E1595.6030800@sbcglobal.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Mike Matrigali wrote: > I am sort of confused at this point, what we expect to be working > now and what should be. What is the right way to write the > following query against a the system schema? Is there anyway to > write the query without changing the default schema? : Not sure if it's related or not but I just noticed this code in CastNode and there is other similar fragments elsewhere in ValueNodes. //set the collation type to be same as the current schema's //collation type. Collation derivation is already initialized //to correct value by default which is "IMPLICIT" getTypeServices().setCollationType( getLanguageConnectionContext().getDefaultSchema().getCollationType()); I think this is incorrect. During compilation the correct value to get the current schema is using the getSchemaDescriptor(null) call for any node. The current schema for compilation will not match the connection's current schema in some situations, such as compiling an action statement for a trigger, a sps for metadata queries and possibly for views as well. If this code is frequent it might be worth creating a utility method in ValueNode as setSchemaCollation() { getTypeServices().setCollationType( getSchemaDescriptor(null).getCollationType()); } Dan.