[ 
https://issues.apache.org/jira/browse/DERBY-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bryan Pendleton updated DERBY-6783:
-----------------------------------
    Attachment: cleanedUpDiff.patch

I realize that I suggested on the derby-dev list that we take this opportunity
to clean up the comments in DataDictionaryImpl, but upon further reflection
I decided that I had made a not-so-good suggestion when I said that.

Although your new comments were in fact easier to read, they made the
overall diff substantially larger and harder to read, and I thought this
made it harder to read the diff and understand precisely what we were
changing.

So I restored the original comments.

I also removed the parts of the overall patch which were simply
diagnostic traces that we had added during our study of the behavior.

So the latest "cleanedUpDiff.patch" is just the code changes and test
changes that I think we really want to keep, with the other changes removed.

I still feel like the return code of examineTriggerNodeAndCols
should not be "String", but should instead be "int []", but I think
we could address that separately.

Please have a very close look at "cleanedUpDiff.patch" to make sure
that I didn't break anything with my changes.

I think what remains, then, is to run as many of the existing tests
as we can, to verify that we haven't broken anything that was
known to work prior to our changes, and to consider whether there
are any additional tests that we wish to write.

I think we are getting very close!

> 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: 6783.diff, 6783_allTestsPass.diff, 6783_moreTests.diff, 
> 6783_moreTests_bryan.diff, 6783_newTest.diff, 6783_newTest_bryan.diff, 
> 6783_newTests.diff, cleanedUpDiff.patch, diagnostics.diff, sortFunction.diff, 
> testTriggerWhenClause.diff
>
>
> Following sql script was shared on 
> derby-user(http://mail-archives.apache.org/mod_mbox/db-derby-user/201412.mbox/%[email protected]%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)

Reply via email to