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

Use simpler solution for CORE-4928. Let's not open new gates for direct table modifications.

This commit is contained in:
dimitr 2015-10-06 10:58:56 +00:00
parent b7faf29697
commit 2a1d6e246a
4 changed files with 2 additions and 8 deletions

View File

@ -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);

View File

@ -517,8 +517,6 @@ void EXE_execute_db_triggers(thread_db* tdbb, jrd_tra* transaction, TriggerActio
try
{
AutoSetRestoreFlag<ULONG> 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);

View File

@ -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 |

View File

@ -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)
{