summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2011-11-28 06:15:28 +0000
committerPavan Deolasee2011-11-28 06:15:28 +0000
commit66a9181ee348aa2149b42ef79fa0ef6da95e2390 (patch)
treed5e655e3080c21b75e0fb85b98e7e046ee33d727
parent1998ea0344f428cbae7d629076870ad7a586fd99 (diff)
Fix a bug in compute_hash() which was passing the scalar value instead of the
pointer for INT8OID types. This was causing segmentation fault on 32 bit machines sicne INT8OID are passed by reference on these platforms.
-rw-r--r--src/backend/access/hash/hashfunc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c
index 9827de1567..e2e60a4251 100644
--- a/src/backend/access/hash/hashfunc.c
+++ b/src/backend/access/hash/hashfunc.c
@@ -560,7 +560,9 @@ compute_hash(Oid type, Datum value, int *pErr, char locator)
* a = 8446744073709551359
* and a = 8446744073709551359::int8 both work*/
tmp64 = DatumGetInt64(value);
- return DirectFunctionCall1(hashint8, tmp64);
+ if (locator == LOCATOR_TYPE_HASH)
+ return DirectFunctionCall1(hashint8, value);
+ return tmp64;
case INT2OID:
tmp16 = DatumGetInt16(value);
if (locator == LOCATOR_TYPE_HASH)