Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 72599 invoked from network); 3 Jun 2005 22:20:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Jun 2005 22:20:20 -0000 Received: (qmail 70758 invoked by uid 500); 3 Jun 2005 22:20:18 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 70730 invoked by uid 500); 3 Jun 2005 22:20:18 -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 70693 invoked by uid 99); 3 Jun 2005 22:20:17 -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 e2.ny.us.ibm.com (HELO e2.ny.us.ibm.com) (32.97.182.142) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 03 Jun 2005 15:20:16 -0700 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e2.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j53MKDfJ024765 for ; Fri, 3 Jun 2005 18:20:13 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j53MKDOp260834 for ; Fri, 3 Jun 2005 18:20:13 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j53MKDS9003860 for ; Fri, 3 Jun 2005 18:20:13 -0400 Received: from [127.0.0.1] (sig-9-48-116-9.mts.ibm.com [9.48.116.9]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j53MJPSE001895 for ; Fri, 3 Jun 2005 18:20:04 -0400 Message-ID: <42A0D763.3080805@debrunners.com> Date: Fri, 03 Jun 2005 15:19:15 -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: [PATCH] Synonym support in Derby. References: <429D86BB.9030804@Sourcery.Org> <429E6D69.7060103@Sourcery.Org> In-Reply-To: <429E6D69.7060103@Sourcery.Org> 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 - QueryTreeNode.resolveTableToSynonym The for(;;) could use some comments as to why it won't loop forever (circle of synonyms) Are there any issues with circular dependencies being caused by rollbacks? E.g. A->B B->A - dropped but not committed. A->B B->C - dropped but not committed. C->A Then the other user rolls back the drop of B - sqlgrammar.jj - DROP SYNONYM No need for the checkVersion on the DROP, it doesn't create any on-disk artifacts that would cause problems in earlier releases - Synonym alias info Copyright date needs to be just 2005 Do we need the schema length in the toString(), why not separate them with a dot, more readable, and include quoting? - messages 01522 - why not 'newly created SYNONYM' rather than 'new created alias'? 42916 - s/repetitive/circular/ ??? Any language experts out there? - OTHER --- I think more checking is need for the CREATE TABLE and CREATE VIEW to ensure the name does not exist as a SYNONYM. Unless I missed it, you are only performing the check at compile time, not runtime. A create statement can be prepared and then execute later, e.g. prepare CT as 'CREATE TABLE T1(I INT)'; CREATE SYNONYM T1; execute CT; These checks would be in the constant actions for these operations. --- As you mentioned the potential for deadlocks or duplicate names on the namespace across two tables (SYSTABLES and SYSALIAS) might exist. A lot depends on when you request a table or alias descriptor from the data dictionary is an actual lock held on the row, or is it a read committed lock, or is it simply a cache lookup? Currently this is enforced at the end of the day for tables and views by the unique index on SYSTABLES. My guess is a stress test may hit problems with your approach. My only thought on this would be to have a row in SYSTABLES for the SYNONYM to ensure uniqeness, and a row in SYSALIASes. But that's just off the top of my head, there may be similar problems with such an approach. --- Is there a jira entry for this, could future patches be attached to that entry? Dan.