You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Huib (JIRA)" <ji...@apache.org> on 2009/12/21 03:35:18 UTC

[jira] Created: (DERBY-4488) Nullpointer when performing INSERT INTO

Nullpointer when performing INSERT INTO
---------------------------------------

                 Key: DERBY-4488
                 URL: https://issues.apache.org/jira/browse/DERBY-4488
             Project: Derby
          Issue Type: Bug
          Components: Store
    Affects Versions: 10.5.3.0
            Reporter: Huib


To replicate, execute the following SQL:

create table feed (fst integer, snd varchar(50), unique(fst))
insert into feed values (1, 'fst')

CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)

insert into tbl(col1) 
select 2 from feed

The result of the last INSERT INTO query is:
java.lang.NullPointerException
	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)


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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4488:
--------------------------------------

    Attachment: setTopResult.diff

Here's a patch which adds a test case and moves the setting of the statement context's topResultSet to NoRowsResultSetImpl.setup(). This allows some simplifications in the sub-classes, like removing code that sets topResultSet and also some throws clauses.

lang.ResultSetsFromPreparedStatementTest ran cleanly with this patch. Will start the other regression tests now.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>            Assignee: Knut Anders Hatlen
>         Attachments: d4488.sql, debug info.txt, setTopResult.diff
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Commented: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804521#action_12804521 ] 

Knut Anders Hatlen commented on DERBY-4488:
-------------------------------------------

On the second execution, GenericStatementContext.topResultSet is null, and that's why the cleanup is not performed the second time.

The topResultSet field of the statement context is set in NoRowsResultSetImpl's constructor, so on the first execution it is non-null. When cleaning up after the error, it is set to null to prepare the statement context for reuse. Then, on re-execution, InsertResultSet sets it in normalInsertCore(). However, normalInsertCore() is not called until after getNextRowCore() has been called, so topResultSet is still null when the exception is thrown on the second execution.

DeleteResultSet and UpdateResultSet set topResultSet earlier in their setup() methods. I think InsertResultSet should do the same. It might also make sense to push this code into NoRowsResultSetImpl.setup(), and perhaps remove it from NoRowsResultSetImpl's constructor too.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>         Attachments: d4488.sql, debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Commented: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Dag H. Wanvik (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793378#action_12793378 ] 

Dag H. Wanvik commented on DERBY-4488:
--------------------------------------

More data points. 
It is a bit weird it only happens on the third execution, not the second. I checked a bit and found that
Knut is right, the third time, the result set is reopened which does not seem to work.  But it seems the first time, when the error happens, the InsertResultSet gets its "cleanup" method called (from ContextManager.cleanupOnError), so the second time we execute, InsertResultSet looks clean, and it calls sourceResultSet.openCore. However, on the execution and ensuing error, the cleanup method is not called (context manager gone?!), so on the third execution, InsertResultSet does no longer look unused, and so sourceResultSet.reopenCore is called, which then fails.  



> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>         Attachments: d4488.sql, debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Commented: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793103#action_12793103 ] 

Knut Anders Hatlen commented on DERBY-4488:
-------------------------------------------

I tried to reproduce this on 10.5.3.0, starting with a clean database. Here's what I see:

ij> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst));
0 rows inserted/updated/deleted
ij> INSERT INTO feed VALUES (1, 'fst');
1 row inserted/updated/deleted
ij> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT);
0 rows inserted/updated/deleted
ij> INSERT INTO tbl(col1) SELECT 1 FROM feed;
ERROR 23502: Column 'COL2'  cannot accept a NULL value.

Did I miss something?

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Resolved: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-4488.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.5.3.1

Merged fix to 10.5 and committed revision 904472.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.5.3.1, 10.6.0.0
>
>         Attachments: d4488.sql, debug info.txt, setTopResult.diff
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4488:
--------------------------------------

    Issue & fix info: [Patch Available, Repro attached]  (was: [Repro attached])

All the regression tests passed with the patch.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>            Assignee: Knut Anders Hatlen
>         Attachments: d4488.sql, debug info.txt, setTopResult.diff
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Commented: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Bryan Pendleton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804656#action_12804656 ] 

Bryan Pendleton commented on DERBY-4488:
----------------------------------------

+1 to simplifying code and moving it to the superclass. Thanks for taking a look at this issue.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>            Assignee: Knut Anders Hatlen
>         Attachments: d4488.sql, debug info.txt, setTopResult.diff
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Commented: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793105#action_12793105 ] 

Knut Anders Hatlen commented on DERBY-4488:
-------------------------------------------

Looking at the log file, it seems like you saw the same (expected) error message twice. But on the third execution it resulted in a NullPointerException. I also see this now:

ij> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst));
0 rows inserted/updated/deleted
ij> INSERT INTO feed VALUES (1, 'fst');
1 row inserted/updated/deleted
ij> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT);
0 rows inserted/updated/deleted
ij> prepare ps as 'INSERT INTO tbl(col1) SELECT 1 FROM feed';
ij> execute ps;
ERROR 23502: Column 'COL2'  cannot accept a NULL value.
ij> execute ps;
ERROR 23502: Column 'COL2'  cannot accept a NULL value.
ij> execute ps;
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4488:
--------------------------------------

     Affects Version/s: 10.6.0.0
                        10.3.1.4
                        10.3.2.1
                        10.3.3.0
                        10.4.1.3
                        10.4.2.0
                        10.5.1.1
                        10.5.2.0
    Bug behavior facts: [Regression]

This is a regression in Derby 10.3.1.4. I suspect DERBY-827 because it happens on re-execution of a prepared statement.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Assigned: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen reassigned DERBY-4488:
-----------------------------------------

    Assignee: Knut Anders Hatlen

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>            Assignee: Knut Anders Hatlen
>         Attachments: d4488.sql, debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4488:
--------------------------------------

      Issue & fix info: [Repro attached]
    Bug behavior facts:   (was: [Wrong query result, Crash])

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4488:
--------------------------------------

         Component/s:     (was: Store)
                      SQL
    Issue & fix info: [Repro attached]  (was: [Repro attached, Patch Available])
       Fix Version/s: 10.6.0.0

Thanks, Bryan! I've committed the patch to trunk with revision 903108.

I also plan to back-port the fix to 10.5 before marking the issue as resolved. Since this bug was a regression in 10.3.1.4, the fix may be a candidate for back-porting all the way back to 10.3.

I'm reclassifying the bug from Store to SQL, since it was fixed in the language layer.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>            Assignee: Knut Anders Hatlen
>             Fix For: 10.6.0.0
>
>         Attachments: d4488.sql, debug info.txt, setTopResult.diff
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Huib (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Huib updated DERBY-4488:
------------------------

    Attachment: debug info.txt

Attached is the derby log file with:
derby.language.logQueryPlan=true
derby.stream.error.logSeverityLevel=20000


> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following SQL:
> create table feed (fst integer, snd varchar(50), unique(fst))
> insert into feed values (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> insert into tbl(col1) 
> select 2 from feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-4488:
--------------------------------------

    Attachment: d4488.sql

Uploading repro script.

> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.3.1.4, 10.3.2.1, 10.3.3.0, 10.4.1.3, 10.4.2.0, 10.5.1.1, 10.5.2.0, 10.5.3.0, 10.6.0.0
>            Reporter: Huib
>         Attachments: d4488.sql, debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Huib (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Huib updated DERBY-4488:
------------------------

    Description: 
To replicate, execute the following 4 queries:

CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))

INSERT INTO feed VALUES (1, 'fst')

CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)

INSERT INTO tbl(col1) SELECT 1 FROM feed

The result of the last INSERT INTO query is:
java.lang.NullPointerException
	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)


  was:
To replicate, execute the following 4 queries:

create table feed (fst integer, snd varchar(50), unique(fst))

insert into feed values (1, 'fst')

CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)

insert into tbl(col1) 
select 1 from feed

The result of the last INSERT INTO query is:
java.lang.NullPointerException
	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)



> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following 4 queries:
> CREATE TABLE feed (fst INTEGER, snd VARCHAR(50), UNIQUE(fst))
> INSERT INTO feed VALUES (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> INSERT INTO tbl(col1) SELECT 1 FROM feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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


[jira] Updated: (DERBY-4488) Nullpointer when performing INSERT INTO

Posted by "Huib (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Huib updated DERBY-4488:
------------------------

    Description: 
To replicate, execute the following 4 queries:

create table feed (fst integer, snd varchar(50), unique(fst))

insert into feed values (1, 'fst')

CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)

insert into tbl(col1) 
select 1 from feed

The result of the last INSERT INTO query is:
java.lang.NullPointerException
	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)


  was:
To replicate, execute the following SQL:

create table feed (fst integer, snd varchar(50), unique(fst))
insert into feed values (1, 'fst')

CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)

insert into tbl(col1) 
select 2 from feed

The result of the last INSERT INTO query is:
java.lang.NullPointerException
	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)



> Nullpointer when performing INSERT INTO
> ---------------------------------------
>
>                 Key: DERBY-4488
>                 URL: https://issues.apache.org/jira/browse/DERBY-4488
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.5.3.0
>            Reporter: Huib
>         Attachments: debug info.txt
>
>
> To replicate, execute the following 4 queries:
> create table feed (fst integer, snd varchar(50), unique(fst))
> insert into feed values (1, 'fst')
> CREATE TABLE tbl (col1 INTEGER, col2 INTEGER NOT NULL REFERENCES feed (fst) ON DELETE RESTRICT ON UPDATE RESTRICT)
> insert into tbl(col1) 
> select 1 from feed
> The result of the last INSERT INTO query is:
> java.lang.NullPointerException
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.initScanParams(Unknown Source)
> 	at org.apache.derby.impl.store.access.btree.BTreeScan.reopenScan(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenScanController(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.TableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.BulkTableScanResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.reopenCore(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.NormalizeResultSet.reopenCore(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.EmbedPreparedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)

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