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

Rick Hillegas commented on DERBY-6777:
--------------------------------------

On a debug version of 10.12, the error is

{noformat}
org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED row template 
is null for column[0].
        at 
org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
        at 
org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
        at 
org.apache.derby.impl.store.access.conglomerate.ConglomerateUtil.createFormatIds(ConglomerateUtil.java:145)
        at org.apache.derby.impl.store.access.heap.Heap.create(Heap.java:301)
        at 
org.apache.derby.impl.store.access.heap.HeapConglomerateFactory.createConglomerate(HeapConglomerateFactory.java:209)
        at 
org.apache.derby.impl.store.access.RAMTransaction.createConglomerate(RAMTransaction.java:806)
        at 
org.apache.derby.impl.sql.execute.TemporaryRowHolderImpl.insert(TemporaryRowHolderImpl.java:303)
        at 
org.apache.derby.impl.sql.execute.MatchingClauseConstantAction.bufferThenRow(MatchingClauseConstantAction.java:250)
        at 
org.apache.derby.impl.sql.execute.MergeResultSet.collectAffectedRows(MergeResultSet.java:277)
        at 
org.apache.derby.impl.sql.execute.MergeResultSet.open(MergeResultSet.java:114)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:473)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:352)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1340)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:706)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:633)
        at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367)
        at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:529)
        at 
org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:371)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:247)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:229)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:184)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:75)
        at org.apache.derby.tools.ij.main(ij.java:59)
{noformat}

> MERGE INSERT on GENERATED key causes npe
> ----------------------------------------
>
>                 Key: DERBY-6777
>                 URL: https://issues.apache.org/jira/browse/DERBY-6777
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.1.1
>            Reporter: Alex Daniels
>
> To reproduce: merge 2 tables where the recipient has a generated pk and the 
> source table has at least 6 rows of data.  
> Example:
> {code:sql}
> CREATE TABLE COLTEST.TEMPDATA1 (id BIGINT not null primary key GENERATED BY 
> DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), DATA1 VARCHAR(1024) not 
> null, DATA2 VARCHAR(50));
> CREATE TABLE COLTEST.TEMPDATA2 (DATA1 VARCHAR(50) not null, DATA2 
> VARCHAR(50));
> INSERT INTO COLTEST.TEMPDATA2 (DATA1, DATA2) VALUES ('rowA', 'Ad2'),('rowB', 
> 'Bd2'),('rowC', 'Cd2'),('rowD', 'Dd2'),('rowE', 'Ed2'),('rowF', 'Fd2');
> MERGE INTO COLTEST.TEMPDATA1 M USING COLTEST.TEMPDATA2 AS U ON M.DATA1 = 
> U.DATA1 
> WHEN NOT MATCHED THEN INSERT (DATA1, DATA2) VALUES (U.DATA1, U.DATA2);
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to