Fix off-by-one bug in xlog reading logic

Bug reported by Michael Paquier

Author: Andres Freund
This commit is contained in:
Alvaro Herrera 2013-01-18 11:17:18 -03:00
parent 74a82bafe4
commit 8c17144c75

View File

@ -8875,7 +8875,7 @@ retry:
/* See if we need to retrieve more data */ /* See if we need to retrieve more data */
if (readFile < 0 || if (readFile < 0 ||
(readSource == XLOG_FROM_STREAM && (readSource == XLOG_FROM_STREAM &&
receivedUpto <= targetPagePtr + reqLen)) receivedUpto < targetPagePtr + reqLen))
{ {
if (StandbyMode) if (StandbyMode)
{ {