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 B61E2104AD for ; Thu, 12 Sep 2013 18:49:19 +0000 (UTC) Received: (qmail 8228 invoked by uid 500); 12 Sep 2013 18:35:24 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 7301 invoked by uid 500); 12 Sep 2013 18:35:11 -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 6758 invoked by uid 99); 12 Sep 2013 18:35:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Sep 2013 18:35:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of msatoor@gmail.com designates 209.85.212.177 as permitted sender) Received: from [209.85.212.177] (HELO mail-wi0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Sep 2013 18:35:00 +0000 Received: by mail-wi0-f177.google.com with SMTP id cb5so200698wib.16 for ; Thu, 12 Sep 2013 11:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=nIxjbe1SquvumH73++I1IWcV8MdTijp8aCqcmsizIXU=; b=i5tr4Flpg2ncZaYXGfcA6DoIV6flKvbR3BsGiFlPgK9hhx8cuVMaBhaC4+oa3ITwVO B2jmr3Z7HZmdXQs2P95SeqnlyLl0pCs23bTEZAXhKh5B1jfuWofmzqKeIply0xtZLpeB mHAJQIuVQJSY6MdPGdDK3V7U7oW9L75t7YuCZjMU952gCCzmUzCUL3SypsNesI5Un3x3 ybBhVs+k8/r2/atjI09jTXJuG6cPi4PMVtbli61GjcCsHJ0st8TySCl2xZDxNKKPqt09 SXG1ke7+tmrARAet3Qk9z+lwgiK1jvGcVfFA7fJ3htW7tZTU23pceJh1ZAeKFNrEKd2/ 1QHw== MIME-Version: 1.0 X-Received: by 10.180.13.83 with SMTP id f19mr7058023wic.54.1379010880729; Thu, 12 Sep 2013 11:34:40 -0700 (PDT) Received: by 10.217.10.193 with HTTP; Thu, 12 Sep 2013 11:34:40 -0700 (PDT) In-Reply-To: References: Date: Thu, 12 Sep 2013 11:34:40 -0700 Message-ID: Subject: Re: Triggers should be fired in the order they were created? From: Mamta Satoor To: Derby Development Content-Type: multipart/alternative; boundary=001a11c24abaaffa4304e633fd12 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c24abaaffa4304e633fd12 Content-Type: text/plain; charset=ISO-8859-1 Thanks Knut. I will checkin changes to the test so that we will have a db to work with the next time around the test fails. On Thu, Sep 12, 2013 at 12:34 AM, Knut Anders Hatlen wrote: > Mamta Satoor writes: > > > Hi, > > > > I am working on DERBY-5866( testFiringConstraintOrder > > > (org.apache.derbyTesting.functionTests.tests.lang.TriggerTest)junit.framework. > > AssertionFailedError: matching triggers need to be fired in order > > creation:1,NO CASCADE BEFORE,DELETE,ROW). The test fixture > > testFiringConstraintOrder creates handful of triggers of various types > > and expects that the triggers will be fired in the order they were > > created. Intermittently, the test fails because the order of firing > > does not match order of creation. I will change the test such that the > > next intermittent failure will leave a database behind for further > > debugging. But I was wondering if anyone knows of a scenario when > > order of firing might not be same as order of creation. Or possibly, > > this is a bug? > > Hi Mamta, > > Triggers firing out of order is a bug. > > The reference manual says they should be fired in the order of creation: > > http://db.apache.org/derby/docs/10.10/ref/rrefsqlj43125.html > > | When multiple triggers are defined for the same database event for > | the same table for the same trigger time (before or after), triggers > | are fired in the order in which they were created. > > Also, I found this in SQL:2003, part 2, section 4.38.1 General > description of triggers: > > | The order of execution of a set of triggers is ascending by value of > | their timestamp of creation in their descriptors, such that the > | oldest trigger executes first. > > > -- > Knut Anders > --001a11c24abaaffa4304e633fd12 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks Knut. I will checkin changes to the test so that we= will have a db to work with the next time around the test fails.
=


On Thu, Sep 1= 2, 2013 at 12:34 AM, Knut Anders Hatlen <knut.hatlen@oracle.com&g= t; wrote:
Mamt= a Satoor <msatoor@gmail.com>= writes:

> Hi,
>
> I am working on DERBY-5866( testFiringConstraintOrder
> (org.apache.derbyTesting.functionTests.tests.lang.TriggerTest)junit.fr= amework.
> AssertionFailedError: matching triggers need to be fired in order
> creation:1,NO CASCADE BEFORE,DELETE,ROW). The test fixture
> testFiringConstraintOrder creates handful of triggers of various types=
> and expects that the triggers will be fired in the order they were
> created. Intermittently, the test fails because the order of firing > does not match order of creation. I will change the test such that the=
> next intermittent failure will leave a database behind for further
> debugging. But I was wondering if anyone knows of a scenario when
> order of firing might not be same as order of creation. Or possibly, > this is a bug?

Hi Mamta,

Triggers firing out of order is a bug.

The reference manual says they should be fired in the order of creation:
http://db.apache.org/derby/docs/10.10/ref/rrefsqlj43125.htm= l

| =A0 When multiple triggers are defined for the same database event for | =A0 the same table for the same trigger time (before or after), triggers<= br> | =A0 are fired in the order in which they were created.

Also, I found this in SQL:2003, part 2, section 4.38.1 General
description of triggers:

| =A0 The order of execution of a set of triggers is ascending by value of<= br> | =A0 their timestamp of creation in their descriptors, such that the
| =A0 oldest trigger executes first.


--
Knut Anders

--001a11c24abaaffa4304e633fd12--