db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] Updated: (DERBY-4198) When using the FOR UPDATE OF clause with SUR (Scroll-insensive updatable result sets), the updateRow() method crashes
Date Wed, 13 May 2009 00:12:45 GMT

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

Dag H. Wanvik updated DERBY-4198:

    Attachment: derby-4198-1.stat

Uploading a first patch for this issue. It passes the RowChanger
object on down to ScrollInsensitiveResultSet, so that it can do the
proper projections itself. Any underlying PRN is no longer called upon
to do the project, rather this now happens in
ScrollInsensitiveResultSet.update itself.

Unfortunately this "opens up" RowChangerImpl logic a bit by
introducing two new public methods to get at its internal structures,
feel free to suggest a better way to encapsulate this logic. I guess I
could move the method ScrollInsensitiveResultSet.findSelectedCol
inside RowChanger...

SURTest.java has a new test fixture with several scenarios that fail
(or succeed by "accident") without the patch.

I also logged DERBY-4226 as part of this investigation. SURTest
contains a scenario that will fail when that bug is fixed; it is
included here because the patch touches on that logic (a base column
selected more than once in a updatable result set) as well.

The patch also contains a temporary (I intend to remove it before
commit) debug flag for some diagnostic output which may help a
reviewer to understand what's going on. Enable with

I did run regressions OK with an earlier version of this patch. Rerunning again now.

> When using the FOR UPDATE OF clause with SUR (Scroll-insensive updatable result sets),
the updateRow() method crashes
> ---------------------------------------------------------------------------------------------------------------------
>                 Key: DERBY-4198
>                 URL: https://issues.apache.org/jira/browse/DERBY-4198
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC, Network Client, SQL
>    Affects Versions:,,,,,,,
>            Reporter: Tiago R. Espinha
>            Assignee: Dag H. Wanvik
>             Fix For:
>         Attachments: derby-4198-1.diff, derby-4198-1.stat, derby-4198-throwable.diff,
derby-4198-throwable.stat, ErrorOutput_Client.tar.gz, ErrorOutput_Embedded.tar.gz, ReproHoldCursorBug.java
> This problem occurs on both Client/Server and Embedded.
> With the Embedded driver, the JVM crashes with the following error:
> -------------------------------------8<------------------------------------
> 1) testReproduction(org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug)org.apache.derby.shared.common.sanity.AssertFailure:
ASSERT FAILED statementContext is not expected to equal statementContexts[0]
> 	at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:120)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.popStatementContext(GenericLanguageConnectionContext.java:2286)
> 	at org.apache.derby.impl.jdbc.EmbedResultSet.updateRow(EmbedResultSet.java:3740)
> 	at org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug.testReproduction(ReproHoldCursorBug.java:71)
> 	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:105)
> 	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)
> ------------------------------------8<---------------------------------------------
> (It shows a stack trace after this, but I'm attaching the result folders since those
are more thorough.)[1]
> On the client driver, the JVM does not crash but it also errors out:
> 1) testReproduction(org.apache.derbyTesting.functionTests.tests.store.ReproHoldCursorBug)java.sql.SQLException:
DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ001, SQLERRMC: java.lang.NullPointerExceptionXJ001.U
> (more detail on the log files)[2]
> The error does not show as long as the "OF DATA" isn't specified. It also won't show
if the whole FOR UPDATE clause is omitted.
> I would also like some comments and advice on how to proceed on converting holdCursorJDBC30.sql
as it is affected by this problem. The original test does an update on a cursor with the "FOR
UPDATE OF DATA" clause, and this isn't working on the Java version of the test. Do I go around
it by removing the FOR UPDATE clause or should I wait for this bug to get fixed?
> Attachments:
> [1] - ErrorOutput_Embedded.tar.gz - Error output files of the Embedded run
> [2] - ErrorOutput_Client.tar.gz - Error output files of the Client/Server run
> [3] - ReproHoldCursorBug.java - The reproduction of the errors

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message