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-6689) Assert failure/NPE when using ROW_NUMBER in MERGE ... INSERT
Date Wed, 06 Aug 2014 17:46:12 GMT

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

Dag H. Wanvik updated DERBY-6689:
---------------------------------

    Attachment: foo-6688-6689.diff
                foo-6688-6689.stat

Attaching a patch [^derby-6689.diff] which makes this illegal. It adds checking for presence
of window functions in the matching clause nodes and throws 42ZC2 is that's the case. Adds
a test case. Running regression of the combo of the latest patch of DERBY-6688 and this.



> Assert failure/NPE when using ROW_NUMBER in MERGE ... INSERT
> ------------------------------------------------------------
>
>                 Key: DERBY-6689
>                 URL: https://issues.apache.org/jira/browse/DERBY-6689
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.1.1
>            Reporter: Knut Anders Hatlen
>         Attachments: foo-6688-6689.diff, foo-6688-6689.stat
>
>
> sane build:
> {noformat}
> ij version 10.12
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table t1(x int);
> 0 rows inserted/updated/deleted
> ij> create table t2(x int);
> 0 rows inserted/updated/deleted
> ij> merge into t1 using t2 on (t1.x=t2.x) when not matched then insert values (row_number()
over ());
> ERROR XJ001: Java exception: 'ASSERT FAILED cannot get interface without operand: org.apache.derby.shared.common.sanity.AssertFailure'.
> {noformat}
> insane build:
> {noformat}
> ij version 10.11
> ij> connect 'jdbc:derby:memory:db;create=true';
> ij> create table t1(x int);
> 0 rows inserted/updated/deleted
> ij> create table t2(x int);
> 0 rows inserted/updated/deleted
> ij> merge into t1 using t2 on (t1.x=t2.x) when not matched then insert values (row_number()
over ());
> ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
> {noformat}
> Full stack trace of the assert failure:
> {noformat}
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED cannot get interface
without operand
> 	at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:120)
> 	at org.apache.derby.impl.sql.compile.UnaryOperatorNode.getReceiverInterfaceName(UnaryOperatorNode.java:663)
> 	at org.apache.derby.impl.sql.compile.UnaryOperatorNode.generateExpression(UnaryOperatorNode.java:622)
> 	at org.apache.derby.impl.sql.compile.ResultColumn.generateExpression(ResultColumn.java:1061)
> 	at org.apache.derby.impl.sql.compile.ResultColumnList.generateEvaluatedRow(ResultColumnList.java:1458)
> 	at org.apache.derby.impl.sql.compile.MatchingClauseNode.generateInsertUpdateRow(MatchingClauseNode.java:1342)
> 	at org.apache.derby.impl.sql.compile.MatchingClauseNode.generate(MatchingClauseNode.java:1237)
> 	at org.apache.derby.impl.sql.compile.MergeNode.generate(MergeNode.java:1012)
> 	at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:317)
> 	at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:549)
> 	at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:99)
> 	at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:1114)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:683)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:631)
> 	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}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message