@@ -2781,7 +2781,7 @@ const StmtNode* EraseNode::erase(thread_db* tdbb, Request* request, WhichTrigger
27812781 spPreTriggers.release ();
27822782
27832783 // Handle post operation trigger.
2784- if (relation->rel_post_erase && whichTrig != PRE_TRIG)
2784+ if (( relation->rel_post_erase || relation-> isSystem ()) && whichTrig != PRE_TRIG)
27852785 {
27862786 EXE_execute_triggers (tdbb, &relation->rel_post_erase , rpb, NULL , TRIGGER_DELETE, POST_TRIG);
27872787 }
@@ -7848,7 +7848,7 @@ const StmtNode* ModifyNode::modify(thread_db* tdbb, Request* request, WhichTrigg
78487848 newRpb->rpb_number = orgRpb->rpb_number ;
78497849 newRpb->rpb_number .setValid (true );
78507850
7851- if (relation->rel_post_modify && whichTrig != PRE_TRIG)
7851+ if (( relation->rel_post_modify || relation-> isSystem ()) && whichTrig != PRE_TRIG)
78527852 {
78537853 EXE_execute_triggers (tdbb, &relation->rel_post_modify , orgRpb, newRpb,
78547854 TRIGGER_UPDATE, POST_TRIG);
@@ -8871,7 +8871,7 @@ const StmtNode* StoreNode::store(thread_db* tdbb, Request* request, WhichTrigger
88718871 {
88728872 SavepointChangeMarker scMarker (transaction);
88738873
8874- if (relation && relation->rel_pre_store && whichTrig != POST_TRIG)
8874+ if (relation && ( relation->rel_pre_store || relation-> isSystem ()) && whichTrig != POST_TRIG)
88758875 {
88768876 EXE_execute_triggers (tdbb, &relation->rel_pre_store , NULL , rpb,
88778877 TRIGGER_INSERT, PRE_TRIG);
@@ -8904,7 +8904,8 @@ const StmtNode* StoreNode::store(thread_db* tdbb, Request* request, WhichTrigger
89048904
89058905 rpb->rpb_number .setValid (true );
89068906
8907- if (relation && relation->rel_post_store && whichTrig != PRE_TRIG)
8907+ if (relation && (relation->rel_post_store || relation->isSystem ()) &&
8908+ relation->rel_post_store && whichTrig != PRE_TRIG)
89088909 {
89098910 EXE_execute_triggers (tdbb, &relation->rel_post_store , NULL , rpb,
89108911 TRIGGER_INSERT, POST_TRIG);
@@ -11549,11 +11550,8 @@ static RelationSourceNode* pass1Update(thread_db* tdbb, CompilerScratch* csb, jr
1154911550
1155011551 for (FB_SIZE_T i = 0 ; i < trigger->getCount (); i++)
1155111552 {
11552- if (!(*trigger)[i].sysTrigger )
11553- {
11554- userTriggers = true ;
11555- break ;
11556- }
11553+ userTriggers = true ;
11554+ break ;
1155711555 }
1155811556
1155911557 if (userTriggers)
@@ -11660,9 +11658,10 @@ static void preModifyEraseTriggers(thread_db* tdbb, TrigVector** trigs,
1166011658 FB_NEW_POOL (*tdbb->getTransaction ()->tra_pool ) traRpbList (*tdbb->getTransaction ()->tra_pool );
1166111659 }
1166211660
11661+ const auto relation = rpb->rpb_relation ;
1166311662 const int rpblevel = tdbb->getTransaction ()->tra_rpblist ->PushRpb (rpb);
1166411663
11665- if (*trigs && whichTrig != StmtNode::POST_TRIG)
11664+ if (( *trigs || relation-> isSystem ()) && whichTrig != StmtNode::POST_TRIG)
1166611665 {
1166711666 try
1166811667 {
0 commit comments