From 9bd2e09433573fbfd85105fca2c6862dba383eab Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Thu, 15 May 2014 09:01:28 +0900 Subject: [PATCH] Write changes of test_decoding while being in the data context OutputPluginWrite was being called after switching to the old memory context. This seems incorrect as the changes are written in a specific memory context. --- contrib/test_decoding/test_decoding.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/test_decoding/test_decoding.c b/contrib/test_decoding/test_decoding.c index 5ce052b..903b15b 100644 --- a/contrib/test_decoding/test_decoding.c +++ b/contrib/test_decoding/test_decoding.c @@ -400,8 +400,10 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn, Assert(false); } + /* Write changes while in the context of the data */ + OutputPluginWrite(ctx, true); + + /* Switch back to old context */ MemoryContextSwitchTo(old); MemoryContextReset(data->context); - - OutputPluginWrite(ctx, true); } -- 1.9.3