[
https://issues.apache.org/jira/browse/DERBY-534?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Knut Anders Hatlen updated DERBY-534:
-------------------------------------
Attachment: derby-534-01-a-syntax.diff
Attaching derby-534-01-a-syntax.diff, which is a first increment towards
support for the WHEN clause.
The patch adds the WHEN clause syntax to sqlgrammar.jj and wires it together
with the existing machinery. The existing machinery contains logic for storing
the WHEN clause in the system tables, and only some minor adjustments were
needed to get that part working. It did not include any execution logic, so the
patch had to add that.
The most substantial changes are in GenericTriggerExecutor and its two
subclasses: RowTriggerExecutor and StatementTriggerExecutor. This is where the
WHEN clause and the trigger action are executed.
The patch also adds some basic test cases for things that currently work.
What doesn't work yet:
- There's no dependency tracking
- Upgrade logic is missing
- WHEN clause cannot reference transition variables (cannot have a WHEN clause
such as WHEN (NEW.X > 5))
- Probably a lot more
All the regression tests passed with the patch.
> Support use of the WHEN clause in CREATE TRIGGER statements
> -----------------------------------------------------------
>
> Key: DERBY-534
> URL: https://issues.apache.org/jira/browse/DERBY-534
> Project: Derby
> Issue Type: Improvement
> Components: SQL
> Reporter: Kristian Waagan
> Assignee: Knut Anders Hatlen
> Priority: Minor
> Labels: derby_triage10_11
> Attachments: derby-534-01-a-syntax.diff, parser.diff,
> WhenClause.html, WhenClause.html
>
>
> Support use of the WHEN clause in CREATE TRIGGER statements. The clause is
> described in the SQL standard (2003) in chapter "11.39 <trigger definition>"
> under "<triggered action>".
> There are traces in the code that suggests some work has been done on this
> earlier. If anyone knows something about this, please add a comment to this
> issue.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira