Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 85636 invoked from network); 6 Apr 2011 19:52:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Apr 2011 19:52:44 -0000 Received: (qmail 62413 invoked by uid 500); 6 Apr 2011 19:52:43 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 62374 invoked by uid 500); 6 Apr 2011 19:52:43 -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 62192 invoked by uid 99); 6 Apr 2011 19:52:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2011 19:52:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2011 19:52:42 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C192A95622 for ; Wed, 6 Apr 2011 19:52:05 +0000 (UTC) Date: Wed, 6 Apr 2011 19:52:05 +0000 (UTC) From: "Rick Hillegas (JIRA)" To: derby-dev@db.apache.org Message-ID: <447505235.38529.1302119525789.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (DERBY-4544) Referencing streaming CLOBs in (some) generated column clauses fails 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-4544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Rick Hillegas updated DERBY-4544: --------------------------------- Attachment: Test_4544.java Attaching Test_4544.java. This class demonstrates a problem when you follow the steps described in this issue. Since Kristian logged this issue, the symptoms of the problem seem to have changed. The repro shows that Derby raises the following exception when you try to initially position a ResultSet for reading the corrupt Clob: Exception in thread "main" java.sql.SQLException: Restore of a serializable or SQLData object of class , attempted to read more data than was originally stored 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.seeNextException(Util.java:278) at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403) at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:348) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:2290) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:82) at org.apache.derby.impl.jdbc.EmbedResultSet.closeOnTransactionError(EmbedResultSet.java:4405) at org.apache.derby.impl.jdbc.EmbedResultSet.movePosition(EmbedResultSet.java:470) at org.apache.derby.impl.jdbc.EmbedResultSet.next(EmbedResultSet.java:374) at Test_4544.read(Test_4544.java:41) at Test_4544.main(Test_4544.java:18) > Referencing streaming CLOBs in (some) generated column clauses fails > -------------------------------------------------------------------- > > Key: DERBY-4544 > URL: https://issues.apache.org/jira/browse/DERBY-4544 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.5.3.0, 10.6.1.0 > Reporter: Kristian Waagan > Assignee: Kristian Waagan > Labels: CLOB, derby_triage10_8 > Attachments: Test_4544.java > > > Referencing a CLOB represented as a stream in generated columns can lead to data corruption or that the query fails. > For instance, with 10.5: > create table t (id int, myclob clob, clen generated always as (length(myclob))); > # Insert CLOB using the streaming APIs (setCharacterStream). > The exception 'java.lang.ClassCastException: org.apache.derby.iapi.types.ReaderToUTF8Stream cannot be cast to org.apache.derby.iapi.types.Resetable' > On trunk the same query results in data corruption, and this isn't detected before the value is read back from store. > Workaround: > Don't use the streaming APIs when using CLOBs in generated columns. This increases the memory footprint, and may not feasible for large CLOBs. > FYI, BLOB deals with this by materializing the value, which effectively equals to using the workaround mentioned above. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira