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] [Updated] (DERBY-6189) NPE involving temporary table and rollback
Date Thu, 18 Apr 2013 19:50:14 GMT

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

Rick Hillegas updated DERBY-6189:

    Attachment: derby-6189-01-aa-invalidateTable.diff

Attaching derby-6189-01-aa-invalidateTable.diff. This patch eliminates the NPE. I will run
regression tests.

The NPE occurs in a method which doesn't expect to be called on a non-existent temp table.
Derby falls into this code because the test case sets up the following sequence of events:

1) AutoCommit is turned off.

2) A temp table is created.

3) An insert into the temp table is prepared.

4) The transaction is rolled back. Here Derby deletes the temp table because it was declared
in the transaction which is rolled back. But the language layer is not notified that PreparedStatements
involving the temp table are now invalid.

5) Then the PreparedStatement is executed. This causes Derby to fall into logic which expects
the temp table to exist and this trips an NPE.

The fix is to invalidate PreparedStatements involving the temp table in step (4).

Touches the following files:


M       java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java

The fix for step (4).


M       java/testing/org/apache/derbyTesting/functionTests/tests/lang/DeclareGlobalTempTableJavaJDBC30Test.java

Add a test case.

> NPE involving temporary table and rollback
> ------------------------------------------
>                 Key: DERBY-6189
>                 URL: https://issues.apache.org/jira/browse/DERBY-6189
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions:
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-6189-01-aa-invalidateTable.diff, DERBY_6189.java
> I will attach a repro.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message