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 4592B10256 for ; Wed, 26 Feb 2014 18:47:30 +0000 (UTC) Received: (qmail 10297 invoked by uid 500); 26 Feb 2014 18:47:21 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 10118 invoked by uid 500); 26 Feb 2014 18:47:20 -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 10042 invoked by uid 99); 26 Feb 2014 18:47:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 18:47:20 +0000 Date: Wed, 26 Feb 2014 18:47:20 +0000 (UTC) From: "Mike Matrigali (JIRA)" To: derby-dev@db.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (DERBY-2041) Trigger should register a dependency on tables and columns used in its body 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-2041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13913303#comment-13913303 ] Mike Matrigali commented on DERBY-2041: --------------------------------------- consider for 10.10 backport > Trigger should register a dependency on tables and columns used in its body > --------------------------------------------------------------------------- > > Key: DERBY-2041 > URL: https://issues.apache.org/jira/browse/DERBY-2041 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.3.1.4 > Reporter: Bryan Pendleton > Assignee: Knut Anders Hatlen > Priority: Minor > Labels: derby_triage10_11 > Fix For: 10.11.0.0 > > Attachments: d2041-1a.diff, d2041-1b.diff, d2041-2a-upgrade-test.diff, register-dependencies.diff, releaseNote.html > > > A trigger registers a dependency in the Dependency Manager for those columns which cause the firing of the trigger, but does not register a dependency on tables and columns which are used in the body of the trigger. This means that the trigger may unexpectedly become invalid due to a change to one of those tables and columns in its body, and the user may be surprised that Derby did not warn them of this problem when the underlying table/column change was made. > An example of this problem is as follows: > create table t1 (c1 int); > create table t2 (c2 int); > create trigger tr1 after update of c1 on t1 for each row mode db2sql insert into t2 (c2) values (1); > With this set of definitions, Derby will warn/prevent the user about changes to table t1 and column c1, but will not warn the user about changes to table t2 and column c2. If the user drops or renames t2 or c2, the trigger will then give an error the next time it fires. > It seems like it would be an improvement for the trigger to record this dependency on table t2 and column c2. -- This message was sent by Atlassian JIRA (v6.1.5#6160)