Commit 6f1d723b authored by Alvaro Herrera's avatar Alvaro Herrera

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
parent 159efe4a
......@@ -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))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment