Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
6bb0d54e
Commit
6bb0d54e
authored
Sep 07, 2004
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a couple of small errors in trigger-list management, as per recent
discussion.
parent
2750b11e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+11
-10
No files found.
src/backend/commands/trigger.c
View file @
6bb0d54e
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.1
69 2004/09/06 23:32:54
tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/trigger.c,v 1.1
70 2004/09/07 21:48:30
tgl Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -2006,13 +2006,13 @@ deferredTriggerInvokeEvents(bool immediate_only)
int
i
;
/*
* Skip executing cancelled events, and events
done by
*
transactions that are not
aborted.
* Skip executing cancelled events, and events
already done,
*
unless they were done by a subtransaction that later
aborted.
*/
if
(
!
(
event
->
dte_event
&
TRIGGER_DEFERRED_CANCELED
)
||
(
event
->
dte_event
&
TRIGGER_DEFERRED_DONE
&&
TransactionIdIsValid
(
event
->
dte_done_xid
)
&&
!
TransactionIdDidAbort
(
event
->
dte_done_xid
)))
if
(
!
(
event
->
dte_event
&
TRIGGER_DEFERRED_CANCELED
)
&&
!
(
event
->
dte_event
&
TRIGGER_DEFERRED_DONE
&&
TransactionIdIsValid
(
event
->
dte_done_xid
)
&&
!
TransactionIdDidAbort
(
event
->
dte_done_xid
)))
{
MemoryContextReset
(
per_tuple_context
);
...
...
@@ -2091,7 +2091,7 @@ deferredTriggerInvokeEvents(bool immediate_only)
*/
next_event
=
event
->
dte_next
;
if
(
still_deferred_ones
)
if
(
still_deferred_ones
||
!
immediate_only
)
{
/* Not done, keep in list */
prev_event
=
event
;
...
...
@@ -2103,7 +2103,7 @@ deferredTriggerInvokeEvents(bool immediate_only)
* inside a subtransaction because it could abort later on. We
* will want to check the item again if it does.
*/
if
(
immediate_only
&&
!
IsSubTransaction
())
if
(
!
IsSubTransaction
())
{
/* delink it from list and free it */
if
(
prev_event
)
...
...
@@ -2115,10 +2115,11 @@ deferredTriggerInvokeEvents(bool immediate_only)
else
{
/*
* Mark the event
done
.
* Mark the event
-as-a-whole done, but keep it in the list
.
*/
event
->
dte_event
|=
TRIGGER_DEFERRED_DONE
;
event
->
dte_done_xid
=
GetCurrentTransactionId
();
prev_event
=
event
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment