From 2804a45247acebd458a6ada9e8d60d2c47aa3cda Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 30 Sep 2009 21:26:17 +0000 Subject: [PATCH] Fix bogus Assert, per buildfarm results. --- contrib/hstore/hstore_op.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c index cfd77d4b35..a3e8f777f6 100644 --- a/contrib/hstore/hstore_op.c +++ b/contrib/hstore/hstore_op.c @@ -1236,8 +1236,10 @@ hstore_hash(PG_FUNCTION_ARGS) * but we make it explicit here. */ Assert(VARSIZE(hs) == - CALCDATASIZE(HS_COUNT(hs), - HSE_ENDPOS(ARRPTR(hs)[2*HS_COUNT(hs) - 1]))); + (HS_COUNT(hs) != 0 ? + CALCDATASIZE(HS_COUNT(hs), + HSE_ENDPOS(ARRPTR(hs)[2*HS_COUNT(hs) - 1])) : + HSHRDSIZE)); PG_FREE_IF_COPY(hs,0); PG_RETURN_DATUM(hval); -- 2.39.5