You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2006/07/14 17:17:38 UTC
svn commit: r421920 -
/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
Author: djd
Date: Fri Jul 14 08:17:37 2006
New Revision: 421920
URL: http://svn.apache.org/viewvc?rev=421920&view=rev
Log:
DERBY-551 (partial) Adds more comments to InternalTriggerExecutionContext.validateStatement.
Patch submitted by Deepa Remesh
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java?rev=421920&r1=421919&r2=421920&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InternalTriggerExecutionContext.java Fri Jul 14 08:17:37 2006
@@ -327,15 +327,21 @@
*/
public void validateStatement(ConstantAction constantAction) throws StandardException
{
- // DDL statements are not allowed in triggers
+ // DDL statements are not allowed in triggers. Parser does not allow
+ // DDL statements in a trigger's action statement. This runtime check
+ // is needed only for DDL statements executed by procedures within a
+ // trigger context.
if (constantAction instanceof DDLConstantAction) {
throw StandardException.newException(SQLState.LANG_NO_DDL_IN_TRIGGER, triggerd.getName(), constantAction.toString());
}
- /*
- ** No INSERT/UPDATE/DELETE for a before trigger.
- */
- else if (triggerd.isBeforeTrigger() &&
+ // No INSERT/UPDATE/DELETE for a before trigger. Parser does not allow
+ // these DML statements in a trigger's action statement in a before
+ // trigger. Currently, parser does not disallow creation of before
+ // triggers calling procedures that modify SQL data. This runtime check
+ // is needed to not allow execution of these DML statements by procedures
+ // within a before trigger context.
+ else if (triggerd.isBeforeTrigger() &&
constantAction instanceof WriteCursorConstantAction)
{
throw StandardException.newException(SQLState.LANG_NO_DML_IN_TRIGGER, triggerd.getName(), targetTableName);