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

Kristian Waagan updated DERBY-5614:
-----------------------------------

    Attachment: derby-5614-1a-disable_bulkinsert_gtt.diff

Attaching a fix for the bug as patch 1a.
I'lll do some more testing and see if anything else has to be done.

Comments appreciated, I'm not familiar with this code.

Also note that the bug isn't triggered if you use one of the VTIs in SYSCS_DIAG 
as they'll return false for 'tableFunctionVisitor.hasNode()'.
                
> NullPointerException with INSERT INTO [global temporary table] SELECT ... 
> FROM [VTI]
> ------------------------------------------------------------------------------------
>
>                 Key: DERBY-5614
>                 URL: https://issues.apache.org/jira/browse/DERBY-5614
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.9.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>         Attachments: derby-5614-1a-disable_bulkinsert_gtt.diff, repro.sql
>
>
> Inserting into a global temporary table (GTT) while selecting data from a VTI 
> fails with a NullPointerException:
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.derby.impl.sql.execute.WriteCursorConstantAction.getEmptyHeapRow(WriteCursorConstantAction.java:324)
>         at 
> org.apache.derby.impl.sql.execute.InsertResultSet.bulkInsertCore(InsertResultSet.java:1209)
>         at 
> org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:466)
>         at 
> org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:443)
>         at 
> org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:324)
>         at 
> org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1242)
>         ... 6 more
> Investigation exposed the fact that bulk insert doesn't support a GTT as the 
> target, and further that Derby enables bulk insert when the source is a VTI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to