Skip to content

Commit

Permalink
Fix the issue DISABLE trigger not work for instead of triggers
Browse files Browse the repository at this point in the history
previously our support for ENABLE/DISABLE trigger syntax has a issue
that it's not working for instead of triggers. This commit fix this
issue.

Task: BABEL-3326
Signed-off-by: Zhibai Song <[email protected]>
  • Loading branch information
Zhibai Song committed Oct 20, 2023
1 parent 2d7aaea commit 8af1c85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/backend/executor/nodeModifyTable.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,10 @@ ExecInsert(ModifyTableContext *context,
return NULL; /* "do nothing" */
}
else if (sql_dialect == SQL_DIALECT_TSQL && resultRelInfo->ri_TrigDesc &&
resultRelInfo->ri_TrigDesc->trig_insert_instead_statement && !TsqlRecuresiveCheck(resultRelInfo)){
resultRelInfo->ri_TrigDesc->trig_insert_instead_statement &&
sql_dialect == SQL_DIALECT_TSQL &&
isTsqlInsteadofTriggerExecution(estate, resultRelInfo, TRIGGER_EVENT_INSERT))
{
ExecIRInsertTriggersTSQL(estate, resultRelInfo, slot, mtstate->mt_transition_capture);
// if it's a statement level IOT trigger, only get the transition table
if (canSetTag)
Expand Down

0 comments on commit 8af1c85

Please sign in to comment.