Hi Bryan, I read the document on JUnit and I tried running it for the new test that I have written. But I can't make sense of the output,
1. junit-single: 2. [junit] Running org.apache.derbyTesting.functionTests.tests.lang.TriggerWhenClauseTest 3. [junit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 sec 4. [junit] Test org.apache.derbyTesting.functionTests.tests.lang.TriggerWhenClauseTest FAILED In the fourth line, it says that the test failed but the output remains same if I removed the new function testDerby6783(). I've attached the complete output here[0] and I'm attaching the patch that I'm working on. [0] : http://pastebin.com/YXgNTU08 Thank you, Abhinav On Sat, May 23, 2015 at 10:17 AM, Bryan Pendleton (JIRA) <j...@apache.org> wrote: > > [ > https://issues.apache.org/jira/browse/DERBY-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14557129#comment-14557129 > ] > > Bryan Pendleton commented on DERBY-6783: > ---------------------------------------- > > Since your new test case is added to one of the existing Derby JUnit test > suites > (TriggerWhenClauseTest.java), it should be pretty straightforward to run > it. You > should be able to follow the instructions here: > > http://wiki.apache.org/db-derby/DerbyJUnitTesting#Running_Tests > > So for example in your case I think you should be able to do: > > ant > -Dderby.junit.testclass=org.apache.derbyTesting.functionTests.tests.lang.TriggerWhenClauseTest > junit-single > > > > WHEN clause in CREATE TRIGGER for UPDATE is not working for the sql > script below > > > -------------------------------------------------------------------------------- > > > > Key: DERBY-6783 > > URL: https://issues.apache.org/jira/browse/DERBY-6783 > > Project: Derby > > Issue Type: Bug > > Components: SQL > > Affects Versions: 10.11.1.1 > > Reporter: Mamta A. Satoor > > Assignee: Abhinav Gupta > > Attachments: TriggerTest.diff > > > > > > Following sql script was shared on derby-user( > http://mail-archives.apache.org/mod_mbox/db-derby-user/201412.mbox/%3c548aba6d.8000...@zoho.com%3e > ). > > The UPDATE TRIGGER with the WHEN clause below does not fire as > expected. Same script works fine on DB2. > > ij version 10.11 > > ij> connect 'jdbc:derby:MyDbTest;create=true'; > > ij> CREATE TABLE t1 (id INTEGER, done_date DATE, status CHAR(1)); > > 0 rows inserted/updated/deleted > > ij> CREATE TRIGGER tr1 AFTER UPDATE OF status ON t1 REFERENCING NEW AS > newrow FOR EACH ROW WHEN (newrow.status='d') UPDATE t1 SET > done_date=current_date WHERE id=newrow.id; > > 0 rows inserted/updated/deleted > > ij> insert into t1 values (1, null, 'a'); > > 1 row inserted/updated/deleted > > ij> SELECT * FROM t1; > > ID |DONE_DATE |STA& > > --------------------------- > > 1 |NULL |a > > > > 1 row selected > > ij> UPDATE t1 SET status='d'; > > 1 row inserted/updated/deleted > > ij> SELECT * FROM t1; > > ID |DONE_DATE |STA& > > --------------------------- > > 1 |NULL |d > > > > 1 row selected > > ij> exit; > > > > -- > This message was sent by Atlassian JIRA > (v6.3.4#6332) >