From 252abbf67654cf1341b6def6cd0f272b3afe1cb5 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Thu, 18 Sep 2014 15:55:08 +0000 Subject: [PATCH] Fixed CORE-4555 - DDL trigger remains active after dropped. --- src/jrd/dfw.epp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/jrd/dfw.epp b/src/jrd/dfw.epp index 3168b61ae2..fb2e363cec 100644 --- a/src/jrd/dfw.epp +++ b/src/jrd/dfw.epp @@ -4619,11 +4619,20 @@ static bool delete_trigger(thread_db* tdbb, SSHORT phase, DeferredWork* work, jr fb_assert(arg); // ASF: arg->dfw_id is RDB$TRIGGER_TYPE truncated to USHORT - if (arg && (arg->dfw_id & TRIGGER_TYPE_MASK) == TRIGGER_TYPE_DB) + if (arg) { - MET_release_trigger(tdbb, - &tdbb->getAttachment()->att_triggers[arg->dfw_id & ~TRIGGER_TYPE_DB], - work->dfw_name); + if ((arg->dfw_id & TRIGGER_TYPE_MASK) == TRIGGER_TYPE_DB) + { + MET_release_trigger(tdbb, + &tdbb->getAttachment()->att_triggers[arg->dfw_id & ~TRIGGER_TYPE_DB], + work->dfw_name); + } + else if ((arg->dfw_id & TRIGGER_TYPE_MASK) == TRIGGER_TYPE_DDL) + { + MET_release_trigger(tdbb, + &tdbb->getAttachment()->att_ddl_triggers, + work->dfw_name); + } } } }