projects
/
postgres-xl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d0fcefd
)
Make sure ON COMMIT actions are invoked only when transaction is still valid
author
Pavan Deolasee
<
[email protected]
>
Tue, 16 Aug 2016 04:01:29 +0000
(09:31 +0530)
committer
Pavan Deolasee
<
[email protected]
>
Tue, 16 Aug 2016 04:03:21 +0000
(09:33 +0530)
Per report by Agoston David
src/backend/commands/tablecmds.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/commands/tablecmds.c
b/src/backend/commands/tablecmds.c
index fe169f35853a2a8ab3b9824b4967f8aafec1d219..024924e485d2526ae72109cb3414e6759b426eb8 100644
(file)
--- a/
src/backend/commands/tablecmds.c
+++ b/
src/backend/commands/tablecmds.c
@@
-12396,6
+12396,16
@@
PreCommit_on_commit_actions(void)
ListCell *l;
List *oids_to_truncate = NIL;
+#ifdef XCP
+ /*
+ * If we are being called outside a valid transaction, do nothing. This can
+ * only happen when the function gets called while we are still processing
+ * CommitTransaction/PrepareTransaction
+ */
+ if (GetTopTransactionIdIfAny() == InvalidTransactionId)
+ return;
+#endif
+
foreach(l, on_commits)
{
OnCommitItem *oc = (OnCommitItem *) lfirst(l);