Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e00018d

Browse files
committed
peek handling of new XactEvent for postgres_fdw
1 parent 82fd21e commit e00018d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

contrib/postgres_fdw/connection.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,20 @@ pgfdw_xact_callback(XactEvent event, void *arg)
652652
HASH_SEQ_STATUS scan;
653653
ConnCacheEntry *entry;
654654

655+
/* Do nothing for this events */
656+
switch (event)
657+
{
658+
case XACT_EVENT_START:
659+
case XACT_EVENT_POST_PREPARE:
660+
case XACT_EVENT_COMMIT_PREPARED:
661+
case XACT_EVENT_PRE_COMMIT_PREPARED:
662+
case XACT_EVENT_ABORT_PREPARED:
663+
case XACT_EVENT_COMMIT_COMMAND:
664+
return;
665+
default:
666+
break;
667+
}
668+
655669
/* Quick exit if no connections were touched in this transaction. */
656670
if (!xact_got_connection)
657671
return;
@@ -800,6 +814,18 @@ pgfdw_xact_callback(XactEvent event, void *arg)
800814
/* Disarm changing_xact_state if it all worked. */
801815
entry->changing_xact_state = abort_cleanup_failure;
802816
break;
817+
case XACT_EVENT_START:
818+
case XACT_EVENT_POST_PREPARE:
819+
case XACT_EVENT_COMMIT_PREPARED:
820+
case XACT_EVENT_PRE_COMMIT_PREPARED:
821+
case XACT_EVENT_ABORT_PREPARED:
822+
case XACT_EVENT_COMMIT_COMMAND:
823+
/*
824+
* New event can break our state machine, so let's list
825+
* them here explicitely and force compiler warning in
826+
* case of unhandled event.
827+
*/
828+
break;
803829
}
804830
}
805831

0 commit comments

Comments
 (0)