8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 172eacb commit f7082f2Copy full SHA for f7082f2
contrib/hstore/hstore_op.c
@@ -1,5 +1,5 @@
1
/*
2
- * $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 $
3
*/
4
#include "postgres.h"
5
@@ -1236,8 +1236,10 @@ hstore_hash(PG_FUNCTION_ARGS)
1236
* but we make it explicit here.
1237
1238
Assert(VARSIZE(hs) ==
1239
- CALCDATASIZE(HS_COUNT(hs),
1240
- HSE_ENDPOS(ARRPTR(hs)[2*HS_COUNT(hs) - 1])));
+ (HS_COUNT(hs) != 0 ?
+ CALCDATASIZE(HS_COUNT(hs),
1241
+ HSE_ENDPOS(ARRPTR(hs)[2*HS_COUNT(hs) - 1])) :
1242
+ HSHRDSIZE));
1243
1244
PG_FREE_IF_COPY(hs,0);
1245
PG_RETURN_DATUM(hval);
0 commit comments