aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-09-30 21:26:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-09-30 21:26:17 +0000
commitf7082f269eb2ee5347ddd411602a870866d783d2 (patch)
tree43eb45605ab7ff4f073fe03d0bc0bf34aae5b4ad
parent172eacba43417c31e5eb61a5ae7a6aaca7a25928 (diff)
downloadpostgresql-f7082f269eb2ee5347ddd411602a870866d783d2.tar.gz
postgresql-f7082f269eb2ee5347ddd411602a870866d783d2.zip
Fix bogus Assert, per buildfarm results.
-rw-r--r--contrib/hstore/hstore_op.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/contrib/hstore/hstore_op.c b/contrib/hstore/hstore_op.c
index 2338bbf44bd..cc1a162dacb 100644
--- a/contrib/hstore/hstore_op.c
+++ b/contrib/hstore/hstore_op.c
@@ -1,5 +1,5 @@
/*
- * $PostgreSQL: pgsql/contrib/hstore/hstore_op.c,v 1.14 2009/09/30 19:50:22 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/hstore/hstore_op.c,v 1.15 2009/09/30 21:26:17 tgl Exp $
*/
#include "postgres.h"
@@ -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);