Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 72671 invoked from network); 29 Jun 2006 21:06:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Jun 2006 21:06:17 -0000 Received: (qmail 42757 invoked by uid 500); 29 Jun 2006 21:06:16 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 42607 invoked by uid 500); 29 Jun 2006 21:06:15 -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 42598 invoked by uid 99); 29 Jun 2006 21:06:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 14:06:15 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jun 2006 14:06:15 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4F15E410335 for ; Thu, 29 Jun 2006 21:04:32 +0000 (GMT) Message-ID: <28589492.1151615072321.JavaMail.jira@brutus> Date: Thu, 29 Jun 2006 21:04:32 +0000 (GMT+00:00) From: "Deepa Remesh (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-551) Allow invoking java stored procedures from inside a trigger. Make CALL a valid statement in the trigger body. In-Reply-To: <1149853848.1125618312287.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-551?page=all ] Deepa Remesh updated DERBY-551: ------------------------------- Attachment: derby-551-draft1.diff derby-551-draft1.status ProcedureInTrigger_Tests_v1.html Attaching a draft patch 'derby-551-draft1.diff' (not for commit) which enables procedures to be called from triggers. This patch is not complete. I am posting it as I would like to get some feedback. Changes made by the patch are: * Modify the parsing to allow call statement inside trigger. * Check that procedures that modify SQL data are not allowed in BEFORE triggers. To check this, I used AliasDescriptor in DataDictionary to get the alias info. I have placed this check currently in routineInvocation(). I think this is causing a diff in lang/releaseCompileLocks.sql. There is an entry in the lock_table when there should be none: TABLE|IS |SYSALIASES |Tablelock |GRANT Earlier, I had tried to use the RoutineAliasInfo in the MethodCallNode but this had not worked as this object was null at trigger creation time. Any suggestions to do this in a better way? * A new message is added to indicate the above error. It maps to the same SQL state as that for unsupported statements in triggers. * Added a new test. I have to add some more test cases to this. I am adding tests based on the scenarios identified in ProcedureInTrigger_Tests_v1.html. Please go through this and let me know if there are scenarios that need to be added/removed. * Modified two tests by removing statements that were testing that call statements are not allowed in triggers. I would appreciate feedback on the patch and the test scenarios. > Allow invoking java stored procedures from inside a trigger. Make CALL a valid statement in the trigger body. > ------------------------------------------------------------------------------------------------------------- > > Key: DERBY-551 > URL: http://issues.apache.org/jira/browse/DERBY-551 > Project: Derby > Type: New Feature > Components: SQL > Versions: 10.1.1.0 > Environment: All platforms > Reporter: Satheesh Bandaram > Assignee: Deepa Remesh > Fix For: 10.2.0.0 > Attachments: ProcedureInTrigger_Tests_v1.html, derby-551-draft1.diff, derby-551-draft1.status > > Derby currently doesn't allow CALL statement to be used in a trigger body. It would be great to allow java stored procedure invocation inside a trigger. Since Derby doesn't have SQL procedure language, triggers can only execute a single SQL statement. If we allow stored procedures in triggers, it would be possible to write a trigger that involves more than just one SQL statement. Functions are currently allowed, but they are read-only. > I believe it is fairly easy to support this enhancement. Need good amount of testing though. -- 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