Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 75500 invoked from network); 11 Apr 2006 21:54:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Apr 2006 21:54:44 -0000 Received: (qmail 85177 invoked by uid 500); 11 Apr 2006 21:54:44 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 85016 invoked by uid 500); 11 Apr 2006 21:54: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 85007 invoked by uid 99); 11 Apr 2006 21:54:43 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2006 14:54:43 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Apr 2006 14:54:42 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 9D445D4A04 for ; Tue, 11 Apr 2006 22:54:21 +0100 (BST) Message-ID: <1886205682.1144792461641.JavaMail.jira@ajax> Date: Tue, 11 Apr 2006 22:54:21 +0100 (BST) From: "Daniel John Debrunner (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Assigned: (DERBY-438) Update triggers on tables with blob columns fail at execution time if the triggered-SQL-statement references the blob column(s). In-Reply-To: <183491813.1120259759312.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-438?page=all ] Daniel John Debrunner reassigned DERBY-438: ------------------------------------------- Assign To: Daniel John Debrunner (was: Manish Khettry) > Update triggers on tables with blob columns fail at execution time if the triggered-SQL-statement references the blob column(s). > -------------------------------------------------------------------------------------------------------------------------------- > > Key: DERBY-438 > URL: http://issues.apache.org/jira/browse/DERBY-438 > Project: Derby > Type: Bug > Components: SQL > Versions: 10.1.1.0, 10.2.0.0, 10.0.2.2 > Reporter: A B > Assignee: Daniel John Debrunner > Fix For: 10.2.0.0 > Attachments: go.java > > Suppose I have 1) a table "t1" with blob data in it, and 2) an UPDATE trigger "tr1" defined on that table, where the triggered-SQL-action for "tr1" references the blob column from the updated ("new") row. Ex: > create table t1 (id int, updated smallint, bl blob(32000)); > create trigger tr1 after update on t1 referencing new as n_row for each row mode db2sql values length(n_row.bl); > Assuming that t1 has been populated with some data, then attempts to update t1 will fire the trigger, but the result will be one of the two following errors: > 1) If blob data is < 32K... > If the actual data in the table is less than 32K in length, the result will be: > ERROR XCL12: An attempt was made to put a data value of type 'org.apache.derby.impl.jdbc.EmbedBlob' into a data value of type 'BLOB'. > 2) If blob data is > 32K... > If at least one row in the table has blob data that is longer than 32K (which means that Derby will stream it, so far as I can tell), then the error will be: > ERROR XCL30: An IOException was thrown when reading a 'BLOB' from an InputStream. > ERROR XJ001: Java exception: ': java.io.EOFException'. > Note that for data larger than 32K, this error will occur regardless of whether or not the triggered-SQL-statement > references the blob column. > Surprisingly, it doesn't (appear to) matter what the trigger statement is actually doing--so long as it references the blob column at least once, one of these two errors will occur, depending on the length of the data. And if the data is greater than 32k, then the error will happen regardless of what the trigger does or whether or not it references the blob column. > I looked at the documentation for UPDATE statements and TRIGGER statements, but nowhere did I see anything saying that either of these will not work with blobs. So as far as I can tell, both of the above scenarios should succeed... -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira