From 2a1d6e246a153edf9dbfd0b7e95c2063876e9616 Mon Sep 17 00:00:00 2001 From: dimitr Date: Tue, 6 Oct 2015 10:58:56 +0000 Subject: [PATCH] Use simpler solution for CORE-4928. Let's not open new gates for direct table modifications. --- src/dsql/StmtNodes.cpp | 2 -- src/jrd/exe.cpp | 2 -- src/jrd/tra.h | 1 - src/jrd/vio.cpp | 5 ++--- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index 90e83cef47..6995cccf9b 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -3680,8 +3680,6 @@ const StmtNode* InAutonomousTransactionNode::execute(thread_db* tdbb, jrd_req* r org_transaction->tra_lock_timeout, org_transaction); - transaction->tra_flags |= org_transaction->tra_flags | TRA_db_triggers; - TRA_attach_request(transaction, request); tdbb->setTransaction(transaction); diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index a66a1f4619..f6c41039c5 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -517,8 +517,6 @@ void EXE_execute_db_triggers(thread_db* tdbb, jrd_tra* transaction, TriggerActio try { - AutoSetRestoreFlag autoFlags(&transaction->tra_flags, TRA_db_triggers, true); - EXE_execute_triggers(tdbb, &attachment->att_triggers[type], NULL, NULL, trigger_action, StmtNode::ALL_TRIGS); tdbb->setTransaction(old_transaction); diff --git a/src/jrd/tra.h b/src/jrd/tra.h index fa28a04455..cb7c183292 100644 --- a/src/jrd/tra.h +++ b/src/jrd/tra.h @@ -403,7 +403,6 @@ const ULONG TRA_restart_requests = 0x4000L; // restart all requests in attachmen const ULONG TRA_no_auto_undo = 0x8000L; // don't start a savepoint in TRA_start const ULONG TRA_precommitted = 0x10000L; // transaction committed at startup const ULONG TRA_own_interface = 0x20000L; // tra_interface was created for internal needs -const ULONG TRA_db_triggers = 0x40000L; // running database triggers // flags derived from TPB, see also transaction_options() at tra.cpp const ULONG TRA_OPTIONS_MASK = (TRA_degree3 | TRA_readonly | TRA_ignore_limbo | TRA_read_committed | diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index ec7891c51d..6187a2e98c 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -224,8 +224,7 @@ inline void check_gbak_cheating_insupd(thread_db* tdbb, const jrd_rel* relation, // It doesn't matter that we use protect_system_table_upd() that's for deletions and updates // but this code is for insertions and updates, because we use force = true. - if (attachment->isGbak() && !(attachment->att_flags & ATT_creator) && - !(transaction->tra_flags & TRA_db_triggers)) + if (relation->isSystem() && attachment->isGbak() && !(attachment->att_flags & ATT_creator)) { protect_system_table_delupd(tdbb, relation, op, true); } @@ -237,7 +236,7 @@ inline void check_gbak_cheating_delete(thread_db* tdbb, const jrd_rel* relation) const Attachment* const attachment = tdbb->getAttachment(); const jrd_tra* const transaction = tdbb->getTransaction(); - if (attachment->isGbak() && !(transaction->tra_flags & TRA_db_triggers)) + if (relation->isSystem() && attachment->isGbak()) { if (attachment->att_flags & ATT_creator) {