Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 88BD7D446 for ; Tue, 14 Aug 2012 16:42:41 +0000 (UTC) Received: (qmail 99220 invoked by uid 500); 14 Aug 2012 16:42:39 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 98872 invoked by uid 500); 14 Aug 2012 16:42:39 -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 98242 invoked by uid 99); 14 Aug 2012 16:42:38 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Aug 2012 16:42:38 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 3065A2C5BED for ; Tue, 14 Aug 2012 16:42:38 +0000 (UTC) Date: Wed, 15 Aug 2012 03:42:38 +1100 (NCT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Message-ID: <1663663036.8139.1344962558198.JavaMail.jiratomcat@arcas> In-Reply-To: <54988229.1104.1323693270578.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (DERBY-5531) Assert failure when inserting NULL into indexed column with territory-based collation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DERBY-5531?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13434254#comment-13434254 ] Mamta A. Satoor commented on DERBY-5531: ---------------------------------------- I have been debugging this issue and found that, for some reason, for a non-null value, we have a NormalizeResultSet which does the conversion for char to territory based char equivalent at execution time. But, for null value, we do not have NormalizeResultSet and hence no such conversion of data type happens. The conversion probably is not necessary since we are dealing with nulls. I am debugging further to see where the decision is happening about the requirement of NormalizeResultSet. > Assert failure when inserting NULL into indexed column with territory-based collation > ------------------------------------------------------------------------------------- > > Key: DERBY-5531 > URL: https://issues.apache.org/jira/browse/DERBY-5531 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.8.2.2 > Reporter: Knut Anders Hatlen > Assignee: Mamta A. Satoor > Labels: derby_triage10_9 > > ij> connect 'jdbc:derby:colldb;territory=en;collation=TERRITORY_BASED;create=true'; > ij> create table t(x varchar(10) unique); > 0 rows inserted/updated/deleted > ij> insert into t values null; > ERROR XJ001: Java exception: 'ASSERT FAILED type of inserted column[0] = org.apache.derby.iapi.types.SQLVarchartype of template column[0] = org.apache.derby.iapi.types.CollatorSQLVarchar: org.apache.derby.shared.common.sanity.AssertFailure'. > java.sql.SQLException: Java exception: 'ASSERT FAILED type of inserted column[0] = org.apache.derby.iapi.types.SQLVarchartype of template column[0] = org.apache.derby.iapi.types.CollatorSQLVarchar: org.apache.derby.shared.common.sanity.AssertFailure'. > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:98) > at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:142) > at org.apache.derby.impl.jdbc.Util.javaException(Util.java:299) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:436) > at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:353) > at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2288) > at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82) > at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1334) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:630) > at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:559) > at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:367) > at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:527) > at org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:369) > at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:245) > 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) > at org.apache.derby.iapi.tools.run.main(run.java:53) > Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED type of inserted column[0] = org.apache.derby.iapi.types.SQLVarchartype of template column[0] = org.apache.derby.iapi.types.CollatorSQLVarchar: org.apache.derby.shared.common.sanity.AssertFailure'. > at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:42) > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:122) > at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:71) > ... 18 more > Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED type of inserted column[0] = org.apache.derby.iapi.types.SQLVarchartype of template column[0] = org.apache.derby.iapi.types.CollatorSQLVarchar > 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.btree.OpenBTree.isIndexableRowConsistent(OpenBTree.java:515) > at org.apache.derby.impl.store.access.btree.BTreeController.doIns(BTreeController.java:679) > at org.apache.derby.impl.store.access.btree.BTreeController.insert(BTreeController.java:1374) > at org.apache.derby.impl.store.access.btree.index.B2IController.insert(B2IController.java:210) > at org.apache.derby.impl.sql.execute.IndexChanger.insertAndCheckDups(IndexChanger.java:440) > at org.apache.derby.impl.sql.execute.IndexChanger.doInsert(IndexChanger.java:383) > at org.apache.derby.impl.sql.execute.IndexChanger.insert(IndexChanger.java:590) > at org.apache.derby.impl.sql.execute.IndexSetChanger.insert(IndexSetChanger.java:268) > at org.apache.derby.impl.sql.execute.RowChangerImpl.insertRow(RowChangerImpl.java:453) > at org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:999) > at org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:519) > 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) > ... 11 more -- 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