@@ -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);
@@ -11660,9 +11661,10 @@ static void preModifyEraseTriggers(thread_db* tdbb, TrigVector** trigs,
1166011661 FB_NEW_POOL (*tdbb->getTransaction ()->tra_pool ) traRpbList (*tdbb->getTransaction ()->tra_pool );
1166111662 }
1166211663
11664+ const auto relation = rpb->rpb_relation ;
1166311665 const int rpblevel = tdbb->getTransaction ()->tra_rpblist ->PushRpb (rpb);
1166411666
11665- if (*trigs && whichTrig != StmtNode::POST_TRIG)
11667+ if (( *trigs || relation-> isSystem ()) && whichTrig != StmtNode::POST_TRIG)
1166611668 {
1166711669 try
1166811670 {
0 commit comments