8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 03:23:04 +01:00

Correction for my yesterday's commit

This commit is contained in:
Dmitry Yemanov 2021-05-06 17:04:52 +03:00
parent 0c56796495
commit deb40096af

View File

@ -959,7 +959,15 @@ void Trigger::release(thread_db* tdbb)
extTrigger = NULL;
}
if (sysTrigger || !statement || statement->isActive() || releaseInProgress)
// dimitr: We should never release triggers created by MET_parse_sys_trigger().
// System triggers do have BLR, but it's not stored inside the trigger object.
// However, triggers backing RI constraints are also marked as system,
// but they are loaded in a regular way and their BLR is present here.
// This is why we cannot simply check for sysTrigger, sigh.
const bool sysTableTrigger = (blr.isEmpty() && engine.isEmpty());
if (sysTableTrigger || !statement || statement->isActive() || releaseInProgress)
return;
AutoSetRestore<bool> autoProgressFlag(&releaseInProgress, true);