Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 41007 invoked from network); 31 May 2007 05:39:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 May 2007 05:39:01 -0000 Received: (qmail 60945 invoked by uid 500); 31 May 2007 05:39:05 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 60727 invoked by uid 500); 31 May 2007 05:39:05 -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 60716 invoked by uid 99); 31 May 2007 05:39:04 -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 22:39:04 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of msatoor@gmail.com designates 209.85.132.251 as permitted sender) Received: from [209.85.132.251] (HELO an-out-0708.google.com) (209.85.132.251) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 May 2007 22:38:59 -0700 Received: by an-out-0708.google.com with SMTP id c8so21204ana for ; Wed, 30 May 2007 22:38:38 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=IcdU3wx7EoestQQX2CR1PCwjwux4p5R9lLSSQ1+kbr3uoNbVQP1EobILb6oyoSUjpeFPsrrnCznI2eFfe5wf4uZbfCg2iP/hETwVdAMJimbtTzCTarOY6/6fZyqwv4Qg0VcF9J18fz9yYXCY5wdqJwmfocVCWhWsHxlXU5XabVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ilm26PNe4UDkNWOtnehLZ3k6CydUnSD9Onj7lYUwcIUL3EZRpTKn5zpcWgdshy4e/00y+/OhMyrot8j+yVfNhVdlVNjobd7TsuWbOB4Hc5kkWxG1OJj3I0EHkzuo8Fkd9G/rb68GMW3sLay4Ext6uEO97dddP8W7KZYBA4HEUe0= Received: by 10.100.210.10 with SMTP id i10mr115381ang.1180589918906; Wed, 30 May 2007 22:38:38 -0700 (PDT) Received: by 10.100.5.12 with HTTP; Wed, 30 May 2007 22:38:38 -0700 (PDT) Message-ID: Date: Wed, 30 May 2007 22:38:38 -0700 From: "Mamta Satoor" To: derby-dev@db.apache.org Subject: Re: more on system schema vs. user schema and character constants. In-Reply-To: <465E5299.3060604@apache.org> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21323_7930359.1180589918790" References: <465E1595.6030800@sbcglobal.net> <465E5299.3060604@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_21323_7930359.1180589918790 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Dan, I am trying to understand the difference between connection's current schema vs compilation schema of a statement. It will help me a lot if you could talk about the 2 schemas in reference to an example. thanks, Mamta On 5/30/07, Daniel John Debrunner wrote: > > 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. > > ------=_Part_21323_7930359.1180589918790 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline
Dan, I am trying to understand the difference between connection's current schema vs compilation schema of a statement. It will help me a lot if you could talk about the 2 schemas in reference to an example.
 
thanks,
Mamta

 
On 5/30/07, Daniel John Debrunner <djd@apache.org> wrote:
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.


------=_Part_21323_7930359.1180589918790--