repack_apply(): Use default if count is negative

Per documentation, a negative value for count should result in using DEFAULT_PEEK_COUNT.
This commit is contained in:
Jim Nasby 2015-10-11 16:39:35 -05:00
parent f255a4175d
commit 0e24283856

View File

@ -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));