projects
/
users
/
simon
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
| inline |
side by side
(parent:
74306aa
)
Fix bogus Assert, per buildfarm results.
author
Tom Lane
<
[email protected]
>
Wed, 30 Sep 2009 21:26:17 +0000
(21:26 +0000)
committer
Tom Lane
<
[email protected]
>
Wed, 30 Sep 2009 21:26:17 +0000
(21:26 +0000)
contrib/hstore/hstore_op.c
|
blob
|
blame
|
history
diff --git
a/contrib/hstore/hstore_op.c
b/contrib/hstore/hstore_op.c
index cfd77d4b358d5552c0e60a66dafd5be670173d7c..a3e8f777f6a7987f7f407549f67fbe973dd40ee2 100644
(file)
--- 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);