db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-4779) NPE while inserting into a table which has a generated column and an insert trigger
Date Mon, 27 Jun 2011 16:07:47 GMT

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

Rick Hillegas commented on DERBY-4779:
--------------------------------------

Thanks for the revised patch with test, Siddharth. Looks good to me. Committed at subversion
revision 1140222. Regression tests passed cleanly for me except for a ping test problem which
does not seem to be related to your patch:

1) testPingWithWrongHost(org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest)junit.framework.AssertionFailedError:
Could not find expectedString:Unable to find host in output:Mon Jun 27 07:21:11 PDT 2011 :
Could not connect to Derby Network Server on host nothere, port 1527: Operation timed out

	at org.apache.derbyTesting.junit.BaseTestCase.assertExecJavaCmdAsExpected(BaseTestCase.java:516)
	at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest.assertFailedPing(NetworkServerControlClientCommandTest.java:147)
	at org.apache.derbyTesting.functionTests.tests.derbynet.NetworkServerControlClientCommandTest.testPingWithWrongHost(NetworkServerControlClientCommandTest.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:112)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:25)
	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
	at junit.extensions.TestSetup.run(TestSetup.java:25)

FAILURES!!!
Tests run: 9164,  Failures: 1,  Errors: 0



> NPE while inserting into a table which has a generated column and an insert trigger
> -----------------------------------------------------------------------------------
>
>                 Key: DERBY-4779
>                 URL: https://issues.apache.org/jira/browse/DERBY-4779
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.3.0, 10.6.1.0, 10.7.1.1
>            Reporter: Rick Hillegas
>            Assignee: Siddharth Srivastava
>              Labels: derby_triage10_8
>         Attachments: d4779.diff, d4779.diff, test1.diff, testreport.txt
>
>
> The following script generates an NPE on the concluding insert:
> connect 'jdbc:derby:memory:dummy;create=true';
> create function getRegion( v int )
> returns varchar( 20 )
> language java parameter style java deterministic no sql
> external name 'java.lang.Integer.toString'
> ;
> create table orders
> (
>     orderID bigint primary key,
>     salesPrice int not null,
>     region generated always as ( getRegion( salesPrice ) )
> )
> ;
> create table dummy( a int );
> create trigger newOrderTrigger
> after insert on orders
> for each row
> insert into dummy( a ) values ( 1 )
> ;
> insert into orders( orderID, salesPrice ) values ( 1, 2 )
> ;
> ------------------------
> Here is the NPE:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.sql.execute.DMLWriteResultSet.objectifyStreams(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
> 	at org.apache.derby.impl.tools.ij.Main.main(Unknown Source)
> 	at org.apache.derby.tools.ij.main(Unknown Source)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message