From: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Tue, 29 Jul 2014 14:16:59 +0000 (+0300)
Subject: Oops, fix recoveryStopsBefore functions for regular commits.
X-Git-Tag: REL9_4_BETA3~132
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b7f1f52107941a819cdf587216b86081cd967e2;p=postgresql

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.
---

diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index 040205760f..7eea5fabaf 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -5489,7 +5489,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;