summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2009-09-30 21:26:17 +0000
committerTom Lane2009-09-30 21:26:17 +0000
commit2804a45247acebd458a6ada9e8d60d2c47aa3cda (patch)
tree70803bc1bb0d66e3982925c9839e24ba01d17092
parent74306aa2e4d72362fddfe11a064d48c1fb396880 (diff)
Fix bogus Assert, per buildfarm results.
-rw-r--r--contrib/hstore/hstore_op.c6
1 files 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);