[ 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-09-a-drop-column-deps.diff derby-534-09-a-drop-column-deps.diff adds tests that verify dependencies are tracked so that dropping an object referenced in a WHEN clause won't silently succeed. For columns referenced in NEW/OLD transition variables and transition tables, the dependency tracking seemed to be working already. For other columns referenced in the WHEN clause (via sub-queries) the dependencies were not tracked. The patch fixes this by generalizing the existing AlterTableConstantNode.columnDroppedAndTriggerDependencies() that detects these dependencies in the triggered SQL statement, and applying that method on the WHEN clause too. Dependencies are not tracked for other objects than columns. This is because of DERBY-2041, which also affects triggers without a WHEN clause. I'm running regression tests on the patch now. > 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, > derby-534-02-a-refactor.diff, derby-534-03-a-npe-testcase.diff, > derby-534-04-a-referencing.diff, derby-534-05-a-generated-cols.diff, > derby-534-06-a-temptables.diff, derby-534-07-a-more-restrictions.diff, > derby-534-08-a-test-invalidation.diff, derby-534-09-a-drop-column-deps.diff, > parser.diff, WhenClause.html, WhenClause.html, 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 was sent by Atlassian JIRA (v6.1#6144)