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 8C34ECF3C for ; Fri, 13 Sep 2013 15:57:53 +0000 (UTC) Received: (qmail 90613 invoked by uid 500); 13 Sep 2013 09:19:54 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 90600 invoked by uid 500); 13 Sep 2013 09:19:53 -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 90487 invoked by uid 99); 13 Sep 2013 09:19:51 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Sep 2013 09:19:51 +0000 Date: Fri, 13 Sep 2013 09:19:51 +0000 (UTC) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-3940) Dropping a column does not drop triggers which mention that column 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-3940?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13766351#comment-13766351 ] Knut Anders Hatlen commented on DERBY-3940: ------------------------------------------- By the way, I ran the repro with 10.10.1.1 and noticed that it no longer behaved as described. This had changed: - ALTER TABLE DROP COLUMN still succeeded, but now with the following warning: {{WARNING 01502: The trigger T_DC_6_PRIM_TRIG_AFTER_INSERT_ROW_TRIGGER on table T_DC_6_PRIM has been dropped.}} - The trigger actually got dropped, so the follow-up INSERT no longer failed. Does this mean the bug reported here is fixed and the issue can be closed? > Dropping a column does not drop triggers which mention that column > ------------------------------------------------------------------ > > Key: DERBY-3940 > URL: https://issues.apache.org/jira/browse/DERBY-3940 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.4.2.1, 10.5.1.1 > Reporter: Rick Hillegas > Labels: derby_triage10_5_2 > Attachments: dropColumnWithTrigger.sql, Triggers.java > > > Put an INSERT trigger on a table and mention a column in the trigger. Then drop that column from the table. If you drop the column with RESTRICT semantics, you don't get an objection. Both CASCADE and RESTRICT drop the column. However, the trigger remains in both cases. After that, INSERTs into the table fail because the trigger can't find the dropped column. The workaround is to manually drop the trigger either before or after dropping the column. I will attach a test case. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira