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:
d3e378c
)
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, 18 Oct 2016 10:07:43 +0000
(15:37 +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 5e7b301656e0007756c30d2e57eaea93ad883c28..d63c60c94657446c749a2305b453356015b0994b 100644
(file)
--- a/
src/backend/commands/tablecmds.c
+++ b/
src/backend/commands/tablecmds.c
@@
-12257,6
+12257,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);