From 60d931827b0c37fbce74d04e45d0220d57ddd06a Mon Sep 17 00:00:00 2001
From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Tue, 29 Jul 2014 17:16:59 +0300
Subject: [PATCH] Oops, fix recoveryStopsBefore functions for regular commits.

Pointed out by Tom Lane. Backpatch to 9.4, the code was structured
differently in earlier branches and didn't have this mistake.
---
 src/backend/access/transam/xlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 2bf49a8af8..fe184bde3b 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5515,7 +5515,7 @@ recoveryStopsBefore(XLogRecord *record)
 		isCommit = true;
 		recordXid = record->xl_xid;
 	}
-	if (record_info == XLOG_XACT_COMMIT_PREPARED)
+	else if (record_info == XLOG_XACT_COMMIT_PREPARED)
 	{
 		isCommit = true;
 		recordXid = ((xl_xact_commit_prepared *) XLogRecGetData(record))->xid;
-- 
2.40.0