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

Fixed bug CORE-4761 : Db on connect triggers fail to execute some time

This commit is contained in:
hvlad 2015-04-21 13:28:10 +00:00
parent ac7194abed
commit 710556257c

View File

@ -1578,14 +1578,16 @@ void MET_load_db_triggers(thread_db* tdbb, int type)
Database* dbb = tdbb->getDatabase();
CHECK_DBB(dbb);
if ((tdbb->getAttachment()->att_flags & ATT_no_db_triggers) ||
tdbb->getDatabase()->dbb_triggers[type] != NULL)
{
if (tdbb->getAttachment()->att_flags & ATT_no_db_triggers)
return;
}
tdbb->getDatabase()->dbb_triggers[type] = FB_NEW(*tdbb->getDatabase()->dbb_permanent)
trig_vec(*tdbb->getDatabase()->dbb_permanent);
Database::CheckoutLockGuard guard(dbb, dbb->dbb_meta_mutex);
if (dbb->dbb_triggers[type] != NULL)
return;
dbb->dbb_triggers[type] = FB_NEW(*dbb->dbb_permanent)
trig_vec(*dbb->dbb_permanent);
jrd_req* trigger_request = NULL;
int encoded_type = type | TRIGGER_TYPE_DB;
@ -1597,7 +1599,7 @@ void MET_load_db_triggers(thread_db* tdbb, int type)
TRG.RDB$TRIGGER_INACTIVE EQ 0
SORTED BY TRG.RDB$TRIGGER_SEQUENCE
MET_load_trigger(tdbb, NULL, TRG.RDB$TRIGGER_NAME, &tdbb->getDatabase()->dbb_triggers[type]);
MET_load_trigger(tdbb, NULL, TRG.RDB$TRIGGER_NAME, &dbb->dbb_triggers[type]);
END_FOR;