Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 90299 invoked from network); 31 Jul 2006 06:18:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jul 2006 06:18:44 -0000 Received: (qmail 22364 invoked by uid 500); 31 Jul 2006 06:18:44 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 22231 invoked by uid 500); 31 Jul 2006 06:18: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 22216 invoked by uid 99); 31 Jul 2006 06:18:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jul 2006 23:18:43 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Jul 2006 23:18:42 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D05E1410009 for ; Mon, 31 Jul 2006 06:16:13 +0000 (GMT) Message-ID: <27331107.1154326573835.JavaMail.jira@brutus> Date: Sun, 30 Jul 2006 23:16:13 -0700 (PDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Created: (DERBY-1613) A trigger does not get invalidated when the view used by it is dropped MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N A trigger does not get invalidated when the view used by it is dropped ---------------------------------------------------------------------- Key: DERBY-1613 URL: http://issues.apache.org/jira/browse/DERBY-1613 Project: Derby Issue Type: Bug Components: SQL Reporter: Mamta A. Satoor I created a trigger which does a select into another table using the rows from a view. I had expected the trigger to get invalidated when the view is dropped. But that is not happening. Trigger continues to fire with old plan which gets it rows from the view. This happens in all the codelines starting with 10.0. Once the database is shutdown and restarted, and the next time the trigger gets fired, it throws the correct exception for view not found. Following is the ij script to reproduce the problem connect 'jdbc:derby:c:/dellater/db100;create=true' user 'mamta1' as mamta1; create table t11TriggerTest (c111 int not null primary key, c112 int); insert into t11TriggerTest values(1,1); insert into t11TriggerTest values(2,2); -- create a view based on table t11TriggerTest create view v21ViewTest as select * from mamta1.t11TriggerTest; -- get ready to create a trigger. Trigger is created on t31TriggerTest and it inserts into t32TriggerTest create table t31TriggerTest (c311 int); create table t32TriggerTest (c321 int); create trigger tr31t31TriggerTest after insert on t31TriggerTest for each statement mode db2sql insert into t32TriggerTest values (select c111 from mamta1.v21ViewTest where c112=1); -- try an insert which will fire the trigger insert into t31TriggerTest values(1); select * from t31TriggerTest; -- we know the trigger got fired if there is one row in t32TriggerTest select * from t32TriggerTest; -- drop the view used by the trigger. drop view v21ViewTest; -- try an insert which would cause insert trigger to fire. The insert trigger should have failed because view doesn't -- exist anymore. insert into t31TriggerTest values(1); -- no error from the insert trigger fired by insert statement above select * from t31TriggerTest; -- insert trigger got fired because there are 2 rows in the following table now select * from t32TriggerTest; -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira