db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6383) Update trigger defined on one column fires on update of other columns
Date Wed, 21 May 2014 03:38:38 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14004294#comment-14004294
] 

ASF subversion and git services commented on DERBY-6383:
--------------------------------------------------------

Commit 1596451 from [~mamtas] in branch 'code/trunk'
[ https://svn.apache.org/r1596451 ]

DERBY-6547(testDERBY5120NumRowsInSydependsForTrigger fails when the starting version of the
upgrade trajectory is 10.10.2.0)

10.10, 10.9 and 10.8 jars started failing in upgrade suite(in testDERBY5120NumRowsInSydependsForTrigger)
after following was backported into those codelines
*****
DERBY-6383(Update trigger defined on one column fires on update of other columns)

Backporting following 2 revisions from trunk to 10.10. Had to hand do the changes because
of conflicts during svn merge.
1537593, 1538854 
*****

The reason behind the failure is actually how testDERBY5120NumRowsInSydependsForTrigger test
was written and not a code regression. 

The test creates a trigger which is supposed to fire on a specific column
	create trigger ATDC_TAB1_TRG1 after update of C11 on ATDC_TAB1 REFERENCING old_table as old

        	for each statement MODE DB2SQL insert into ATDC_BKUP1 select * from old
But later on it the test, it is expecting the trigger to fire on update of non-trigger column
of the table. This was fine before DERBY-6383 was backported because w/o the fix for DERBY-6383,
triggers would fire on update of any column on the table(DERBY-6383 - Update trigger defined
on one column fires on update of other columns). But after those codelines got the fix for
DERBY-6383 as part of the backport, the trigger correctly won't fire any more on non-trigger
columns and that started the test failure. I have fixed the test to update the trigger column
in order to fire the trigger and now the test behaves correctly. I will backport this test
fix upto 10.8 codelines which is how far DERBY-6383 got backported to.

> Update trigger defined on one column fires on update of other columns
> ---------------------------------------------------------------------
>
>                 Key: DERBY-6383
>                 URL: https://issues.apache.org/jira/browse/DERBY-6383
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.7.1.4, 10.8.1.2, 10.9.1.0, 10.10.1.1
>            Reporter: Knut Anders Hatlen
>            Assignee: Mamta A. Satoor
>              Labels: backport_reject_10_6
>             Fix For: 10.7.1.4, 10.8.3.3, 10.9.2.2, 10.11.0.0, 10.10.2.0
>
>         Attachments: DERBY6383_patch1_diff.txt, DERBY6383_patch2_diff.txt, DERBY6383_patch3_diff.txt,
d6383.sql, derby_for_Embedded_40Changes10_7testTriggers.log, derby_for_Embedded_40Changes10_9testDisposableStatisticsExplicit.log,
error-stacktrace_for_Embedded_40Changes10_7testTriggers.out, error-stacktrace_for_Embedded_40Changes10_9testDisposableStatisticsExplicit.out,
releaseNote.html, releaseNote.html, releaseNote.html, runall.out
>
>
> I see this problem on 10.8 and higher. To reproduce, create a database with a trigger
like this:
> connect 'jdbc:derby:trigdb;create=true';
> create table t1(x int, y int);
> create table t2(x int, y int);
> create trigger tr after update of x on t1 referencing old table as old insert into t2
select * from old;
> Then run dblook on the database, and you'll see the following output:
> -- ----------------------------------------------
> -- DDL Statements for triggers
> -- ----------------------------------------------
> CREATE TRIGGER "APP"."TR" AFTER UPDATE OF "X", "Y" ON "APP"."T1" REFERENCING OLD_TABLE
AS OLD FOR EACH STATEMENT insert into t2 select * from old;
> Notice that the DDL creates an update trigger for columns X and Y, whereas the original
trigger was defined on column X only.
> I see the expected DDL on 10.7.1.1.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message