Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 31811 invoked from network); 11 Jun 2005 21:42:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Jun 2005 21:42:49 -0000 Received: (qmail 26390 invoked by uid 500); 11 Jun 2005 21:42:48 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 26336 invoked by uid 500); 11 Jun 2005 21:42:47 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 26305 invoked by uid 99); 11 Jun 2005 21:42:47 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=SPF_HELO_FAIL X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from e35.co.us.ibm.com (HELO e35.co.us.ibm.com) (32.97.110.133) by apache.org (qpsmtpd/0.28) with ESMTP; Sat, 11 Jun 2005 14:42:45 -0700 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e35.co.us.ibm.com (8.12.10/8.12.9) with ESMTP id j5BLgfiw007012 for ; Sat, 11 Jun 2005 17:42:41 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j5BLgfuW170432 for ; Sat, 11 Jun 2005 15:42:41 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id j5BLgeTk017946 for ; Sat, 11 Jun 2005 15:42:40 -0600 Received: from [127.0.0.1] (sig-9-48-126-148.mts.ibm.com [9.48.126.148]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id j5BLgbDN017850 for ; Sat, 11 Jun 2005 15:42:39 -0600 Message-ID: <42AB5AC4.9070201@debrunners.com> Date: Sat, 11 Jun 2005 14:42:28 -0700 From: Daniel John Debrunner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3) Gecko/20040910 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: 10.1 branch created / please review open 10.1 JIRA issues References: <155E5416-F701-4485-BB21-290405E0A261@gmail.com> <22B2C628-2138-42D2-81E9-3881E0CABAE0@gmail.com> <42AAFACD.8080705@debrunners.com> In-Reply-To: X-Enigmail-Version: 0.90.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Peter Nabbefeld wrote: >> > I've looked at it. As I've seen, LLC supports only to get the default > schema (so it seems to be difficult to get a non-default schema for > compilation; probably "getSchema(String name)" should be added to LLC). No, code gets schema descriptors all the time during compilation, there are methods to get a schema desciptor from a name in QueryTreeNode, which is the root class for all compilation nodes. Since Java is an o-o language there is no need to add get methods for everything to the LCC, instead the LCC provides methods to get the object that manages the entity. For schemas, tables etc. the object is the DataDictionary, thus that class has the get methods for various catlog entries. > However, if there is no default user schema, default schema should be > "APP", not null (if I've understood the comment for "protected > SchemaDescriptor initDefaultSchemaDescriptor() ..." in > GenericLanguageConnectionContext correct). The default schema is a schema name corresponding to the user name if the connection has not executed a SET SCHEMA statement. In Derby if that schema has not been created, then the current schema is still that schema, even though it doesn't exist. The schema descriptor representing this "virtual" schema will have a null UUID, indicating it is not persistent. The APP is the default user name, not the default schema name, though the comments in some areas of the code are misleading on this. Also I think the concept of a "default" schema is wrong, I think the code should refer to the "current" schema. Since once a connection has performed a SET SCHEMA then there is no notion of a default schema. There is no way to get back to the original schema without an explict set schema with the name, nothing default about this. Not sure if this is relevant to this bug or not, I haven't looked at it. The bug may be more related to if a SQL statement does not depend on the current schema, ie. all names are schema qualified, then its compilation schema is null. The code that persists a trigger may then not be coded to handle a null compliation schema. Dan.