From 0e24283856b1d3c4ae8c4628a5ae79c57361ba64 Mon Sep 17 00:00:00 2001 From: Jim Nasby Date: Sun, 11 Oct 2015 16:39:35 -0500 Subject: [PATCH] repack_apply(): Use default if count is negative Per documentation, a negative value for count should result in using DEFAULT_PEEK_COUNT. --- lib/repack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/repack.c b/lib/repack.c index cce90ea..ab6ee36 100644 --- a/lib/repack.c +++ b/lib/repack.c @@ -237,7 +237,7 @@ repack_apply(PG_FUNCTION_ARGS) bool nulls[3]; /* id, pk, row */ /* peek tuple in log */ - if (count == 0) + if (count <= 0) values_peek[0] = Int32GetDatum(DEFAULT_PEEK_COUNT); else values_peek[0] = Int32GetDatum(Min(count - n, DEFAULT_PEEK_COUNT));