Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 2825 invoked from network); 20 Jul 2010 17:03:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Jul 2010 17:03:46 -0000 Received: (qmail 60187 invoked by uid 500); 20 Jul 2010 17:03:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 60049 invoked by uid 500); 20 Jul 2010 17:03: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 60040 invoked by uid 99); 20 Jul 2010 17:03:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jul 2010 17:03:45 +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, 20 Jul 2010 17:03:42 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o6KGtpt1000340 for ; Tue, 20 Jul 2010 16:55:51 GMT Message-ID: <30085150.477751279644951605.JavaMail.jira@thor> Date: Tue, 20 Jul 2010 12:55:51 -0400 (EDT) From: "Mamta A. Satoor (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-4610) Error attempting delete with cascade and triggers In-Reply-To: <1441724085.5801270816190773.JavaMail.jira@brutus.apache.org> 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-4610?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Mamta A. Satoor updated DERBY-4610: ----------------------------------- Attachment: (was: DERBY4601_patch1_diff.txt) > Error attempting delete with cascade and triggers > ------------------------------------------------- > > Key: DERBY-4610 > URL: https://issues.apache.org/jira/browse/DERBY-4610 > Project: Derby > Issue Type: Bug > Components: SQL > Affects Versions: 10.4.1.3, 10.4.2.0, 10.5.3.0, 10.6.1.0 > Environment: Apache Derby 10.5.3.0 and Sun JDK 1.6.0_07 > Reporter: Eric Long > Assignee: Mamta A. Satoor > Fix For: 10.5.3.1, 10.6.1.1, 10.7.0.0 > > Attachments: enable_test.diff, junit.diff > > > The scenario is a parent and child table with a cascade delete and triggers on both tables. Here are the steps to reproduce. > First, compile TestFunctions.java and put it on the classpath: > public class TestFunctions > { > public static void test(String str) > { > } > } > Next, enter commands into interactive SQL: > create table testtable (id integer, name varchar(20), primary key(id)); > create table testchild ( > id integer > constraint fk_id references testtable on delete cascade, > ordernum int, > primary key(id)); > create procedure testproc (str varchar(20)) > PARAMETER STYLE JAVA LANGUAGE JAVA EXTERNAL NAME 'TestFunctions.test'; > create trigger testtabletrigger after delete on testtable referencing old as old > for each row mode db2sql call testproc(char(old.id)); > create trigger testchildtrigger after delete on testchild referencing old as old > for each row mode db2sql call testproc(char(old.ordernum)); > insert into testtable values (1, 'test1'); > insert into testchild values (1, 10); > delete from testtable where id = 1; > The expected result is that deleting a row from "testtable" will cascade the delete to "testchild", and the triggers will be called for each delete. The actual result is that the delete is rolled back with the following error: > Error: An attempt was made to put a data value of type 'java.lang.String' into a data value of > type 'INTEGER'. > SQLState: XCL12 > ErrorCode: 30000 > There are no additional entries in the derby.log after the error. If only one trigger is used, or if the cascade is removed, then the delete will succeed. > This issue was found while using SymmetricDS, which uses triggers to replicate tables between Derby databases. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.