Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B5741023F for ; Tue, 8 Oct 2013 09:46:46 +0000 (UTC) Received: (qmail 29614 invoked by uid 500); 8 Oct 2013 09:46:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 29578 invoked by uid 500); 8 Oct 2013 09:46:43 -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 29558 invoked by uid 99); 8 Oct 2013 09:46:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 09:46:42 +0000 Date: Tue, 8 Oct 2013 09:46:42 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (DERBY-6371) DROP COLUMN looks in wrong schema when checking trigger dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-6371?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-6371: -------------------------------------- Issue & fix info: Patch Available,Repro attached (was: Repro attached) > DROP COLUMN looks in wrong schema when checking trigger dependencies > -------------------------------------------------------------------- > > Key: DERBY-6371 > URL: https://issues.apache.org/jira/browse/DERBY-6371 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.10.1.1 > Reporter: Knut Anders Hatlen > Assignee: Knut Anders Hatlen > Attachments: compSchema.diff, derby-6371-1a.diff > > > If you define a trigger in another schema than the current schema, and the trigger action references tables in the current schema without explicit schema names, ALTER TABLE DROP COLUMN may get confused when checking dependencies. > For example: > ij> create table s1.t1(x int, y int); > 0 rows inserted/updated/deleted > ij> create table s1.t2(x int, y int); > 0 rows inserted/updated/deleted > ij> set schema s1; > 0 rows inserted/updated/deleted > ij> create trigger s2.tr after update of x on t1 for each row insert into t2(x) select x from t1; > 0 rows inserted/updated/deleted > ij> alter table s1.t1 drop column y restrict; > ERROR X0Y25: Operation 'DROP COLUMN' cannot be performed on object 'Y' because TRIGGER 'TR' is dependent on that object. > The ALTER TABLE statement should have succeeded, because the trigger does not depend on column Y. > If you create dummy tables in S2 with the same names as those in S1, the same ALTER TABLE statement succeeds: > ij> create table s2.t1(x int); > 0 rows inserted/updated/deleted > ij> create table s2.t2(x int); > 0 rows inserted/updated/deleted > ij> alter table s1.t1 drop column y restrict; > 0 rows inserted/updated/deleted > The existence of these unrelated tables should not affect whether you're allowed to drop the column. -- This message was sent by Atlassian JIRA (v6.1#6144)