[ 
http://issues.apache.org/jira/browse/DERBY-1204?page=comments#action_12452593 ] 
            
Bryan Pendleton commented on DERBY-1204:
----------------------------------------

The patch looks quite good to me. I have two small comments, and a request:

1) The original reporter already added a test case for the bug to 
triggerGeneral.sql.
I think the new test cases are quite good and should be retained, but I think we
should also enable the existing test case. It might also be reasonable to put
the test cases together in the file, either by moving the existing test case to 
the
end where the new cases are, or by adding the new cases in the middle, next to
the existing test case.

2) There appears to be an unnecessary whitespace-only diff change in 
CreateTriggerNode.

The request: I think that DERBY-1644 is rather similar to this, in that both 
cases involve
incorrect handling of the intermediate nodes in the UnionNode tree that is 
constructed
for a INSERT statement with a multi-row VALUES clause. Although the two proposed
fixes are completely independent, I was hoping that you could have a look at 
DERBY-1644,
and perhaps see what you think of my proposed change. I'm a bit concerned that 
my
proposed change turned out to be more complicated than was necessary, and 
perhaps
you will see a simpler way to fix the problem if you have a look at that issue.


> CREATE TRIGGER with an INSERT action statement with multiple rows and a 
> referenced column throws a StringIndexOutOfBoundsException
> ----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1204
>                 URL: http://issues.apache.org/jira/browse/DERBY-1204
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.1.2.1, 10.2.1.6
>            Reporter: Daniel John Debrunner
>         Assigned To: Yip Ng
>         Attachments: derby1204-trunk-diff01.txt, derby1204-trunk-stat01.txt
>
>
> These triggers succeed
> create trigger tgood after insert on x
> for each statement mode db2sql insert into x values (666), (999), (333);
> create trigger tgood after insert on x
> referencing new as n
> for each row mode db2sql insert into x values (n.x);
> create trigger tgood after insert on x
> referencing new as n
> for each row mode db2sql insert into x values (333), (999), (333)
> This one fails
> create trigger tgood after insert on x
> referencing new as n
> for each row mode db2sql insert into x values (n.x), (999), (333);
> Test cases will be added to triggerGeneral under this bug number.
> java.lang.StringIndexOutOfBoundsException: String index out of range: -3
>       at java.lang.String.substring(String.java:1444)
>       at 
> org.apache.derby.impl.sql.compile.CreateTriggerNode.bindReferencesClause(CreateTriggerNode.java:421)
>       at 
> org.apache.derby.impl.sql.compile.CreateTriggerNode.bind(CreateTriggerNode.java:258)
>       at 
> org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:344)
>       at 
> org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:118)
>       at 
> org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:713)
>       at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:560)
>       at 
> org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:507)
>       at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:313)
>       at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:433)
>       at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:310)
>       at org.apache.derby.impl.tools.ij.Main.go(Main.java:203)
>       at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:169)
>       at org.apache.derby.impl.tools.ij.Main14.main(Main14.java:55)
>       at org.apache.derby.tools.ij.main(ij.java:60)

-- 
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

        

Reply via email to