Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 60395 invoked from network); 6 Jul 2010 05:07:48 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Jul 2010 05:07:48 -0000 Received: (qmail 23711 invoked by uid 500); 6 Jul 2010 05:07:48 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 23515 invoked by uid 500); 6 Jul 2010 05:07:45 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 23508 invoked by uid 99); 6 Jul 2010 05:07:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 05:07:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jul 2010 05:07:41 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o664xoNP013387 for ; Tue, 6 Jul 2010 04:59:50 GMT Message-ID: <5304501.210461278392390186.JavaMail.jira@thor> Date: Tue, 6 Jul 2010 00:59:50 -0400 (EDT) From: "Mike Matrigali (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4413) INSERT from SELECT DISTINCT gives assertFailure (sane), or NPE (insane) in presence of generated columns In-Reply-To: <1314279481.1255955251390.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DERBY-4413?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mike Matrigali updated DERBY-4413: ---------------------------------- merged change #885659 from trunk to 10.5. m105_jdk16:99>svn commit Sending . Sending java/engine/org/apache/derby/impl/sql/execute/BasicSortObserver.java Sending java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java Transmitting file data .. Committed revision 960783. > INSERT from SELECT DISTINCT gives assertFailure (sane), or NPE (insane) in presence of generated columns > --------------------------------------------------------------------------------------------------------- > > Key: DERBY-4413 > URL: https://issues.apache.org/jira/browse/DERBY-4413 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.5.1.1, 10.5.2.0, 10.5.3.0 > Reporter: Dag H. Wanvik > Assignee: Mike Matrigali > Fix For: 10.6.1.0 > > Attachments: derby-4413-2.diff, derby-4413-2.stat, derby-4413-rollback.diff, derby-4413-rollback.stat, derby-4413.diff, derby-4413.stat > > > When a generated column is present in a table, an INSERT DISTINCT fail: > Repro: > create table t(i integer, > j integer not null generated always as (i*66)); > insert into t(i) values 1,2; > insert into t(i) select distinct i from t; > In an insane build we see this assertFailure: > ij version 10.5 > ij> connect 'jdbc:derby:wombat2;create=true'; > ij> create table t(i integer, > j integer not null generated always as (i*66)); > 0 rows inserted/updated/deleted > ij> insert into t(i) values 1,2; > 2 rows inserted/updated/deleted > ij> insert into t(i) select distinct i from t; > ERROR XJ001: Java exception: 'ASSERT FAILED col[1] is null: org.apache.derby.shared.common.sanity.AssertFailure'. > java.sql.SQLException: Java exception: 'ASSERT FAILED col[1] is null: org.apache.derby.shared.common.sanity.AssertFailure'. > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95) > at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87) > at org.apache.derby.impl.jdbc.Util.javaException(Util.java:244) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346) > at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2201) > at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1323) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:625) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:555) > at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:329) > at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:505) > at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:347) > at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245) > at org.apache.derby.impl.tools.ij.Main.go(Main.java:217) > 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) > at org.apache.derby.iapi.tools.run.main(run.java:53) > Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED col[1] is null: org.apache.derby.shared.common.sanity.AssertFailure'. > at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45) > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:119) > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70) > ... 18 more > Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED col[1] is null > 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.sort.MergeSort.checkColumnTypes(MergeSort.java:458) > at org.apache.derby.impl.store.access.sort.MergeInserter.insert(MergeInserter.java:98) > at org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(SortResultSet.java:317) > at org.apache.derby.impl.sql.execute.SortResultSet.openCore(SortResultSet.java:268) > at org.apache.derby.impl.sql.execute.NormalizeResultSet.openCore(NormalizeResultSet.java:139) > at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:415) > at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(GenericPreparedStatement.java:416) > at org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:297) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1235) > ... 11 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.