Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 93467 invoked from network); 19 Mar 2009 11:56:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Mar 2009 11:56:14 -0000 Received: (qmail 14896 invoked by uid 500); 19 Mar 2009 11:56:13 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 14869 invoked by uid 500); 19 Mar 2009 11:56:13 -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 14853 invoked by uid 99); 19 Mar 2009 11:56:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 04:56:13 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2009 11:56:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 6A744234C003 for ; Thu, 19 Mar 2009 04:55:50 -0700 (PDT) Message-ID: <59299078.1237463750434.JavaMail.jira@brutus> Date: Thu, 19 Mar 2009 04:55:50 -0700 (PDT) From: "Knut Anders Hatlen (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4102) Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K In-Reply-To: <463572517.1237463630962.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-4102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Knut Anders Hatlen updated DERBY-4102: -------------------------------------- Attachment: CastExc.java Attached is a Java program that reproduces the bug. With sane jars: Exception in thread "main" java.sql.SQLException: Java exception: 'ASSERT FAILED: 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.EmbedResultSet.getBlob(EmbedResultSet.java:4000) at CastExc.main(CastExc.java:12) Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED: 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) ... 8 more Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED at org.apache.derby.shared.common.sanity.SanityManager.ASSERT(SanityManager.java:98) at org.apache.derby.impl.jdbc.EmbedBlob.(EmbedBlob.java:194) at org.apache.derby.impl.jdbc.EmbedResultSet.getBlob(EmbedResultSet.java:3998) ... 1 more With insane jars: Exception in thread "main" java.sql.SQLException: Java exception: 'org.apache.derby.iapi.types.RawToBinaryFormatStream cannot be cast to org.apache.derby.iapi.types.Resetable: java.lang.ClassCastException'. at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source) at org.apache.derby.impl.jdbc.EmbedResultSet.getBlob(Unknown Source) at CastExc.main(CastExc.java:12) Caused by: java.sql.SQLException: Java exception: 'org.apache.derby.iapi.types.RawToBinaryFormatStream cannot be cast to org.apache.derby.iapi.types.Resetable: java.lang.ClassCastException'. at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source) at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source) ... 9 more Caused by: java.lang.ClassCastException: org.apache.derby.iapi.types.RawToBinaryFormatStream cannot be cast to org.apache.derby.iapi.types.Resetable at org.apache.derby.impl.jdbc.PositionedStoreStream.(Unknown Source) at org.apache.derby.impl.jdbc.EmbedBlob.(Unknown Source) ... 2 more > Assert failure or ClassCastException in EmbedBlob when retrieving BLOB >= 32K > ----------------------------------------------------------------------------- > > Key: DERBY-4102 > URL: https://issues.apache.org/jira/browse/DERBY-4102 > Project: Derby > Issue Type: Bug > Components: JDBC > Affects Versions: 10.1.1.0, 10.2.2.0, 10.3.3.0, 10.4.2.0, 10.5.0.0, 10.6.0.0 > Reporter: Knut Anders Hatlen > Attachments: CastExc.java > > > The code below results in an assert error (with sane jars) or a ClassCastException (with insane jars): > PreparedStatement ps = c.prepareStatement("values cast(? as blob)"); > int len = 32 * 1024; > ps.setBinaryStream(1, new ByteArrayInputStream(new byte[len]), len); > ResultSet rs = ps.executeQuery(); > while (rs.next()) { > rs.getBlob(1); > } > If len < 32K there is no error. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.