From: Alvaro Herrera Date: Mon, 19 Feb 2018 21:00:53 +0000 (-0300) Subject: Fix crash in pg_replication_slot_advance X-Git-Tag: REL_11_BETA1~752 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f1d723b6359507ef55a81617167507bc25e3e2b;p=postgresql Fix crash in pg_replication_slot_advance We were trying to use a LSN variable after releasing its containing slot structure. Reported by: tushar Author: amul sul Reviewed-by: Petr Jelinek, Masahiko Sawada Discussion: https://postgr.es/m/94ba999c-f76a-0423-6523-b8d531dfe4c7@enterprisedb.com --- diff --git a/src/backend/replication/slotfuncs.c b/src/backend/replication/slotfuncs.c index cf2195bc93..e873dd1f81 100644 --- a/src/backend/replication/slotfuncs.c +++ b/src/backend/replication/slotfuncs.c @@ -480,8 +480,7 @@ pg_replication_slot_advance(PG_FUNCTION_ARGS) (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot move slot to %X/%X, minimum is %X/%X", (uint32) (moveto >> 32), (uint32) moveto, - (uint32) (MyReplicationSlot->data.confirmed_flush >> 32), - (uint32) (MyReplicationSlot->data.confirmed_flush)))); + (uint32) (startlsn >> 32), (uint32) startlsn))); } if (OidIsValid(MyReplicationSlot->data.database))