aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2016-07-17 09:37:33 -0400
committerPeter Eisentraut <peter_e@gmx.net>2016-07-17 09:41:08 -0400
commit84d67920450717d458cfaad7876fa8279fd7ced0 (patch)
treeae5d4259e0bfc88cab868ff6fbf1d2c910b089e6
parent608cc0c413d8bafc853065f80c3b05f84493032a (diff)
downloadpostgresql-84d67920450717d458cfaad7876fa8279fd7ced0.tar.gz
postgresql-84d67920450717d458cfaad7876fa8279fd7ced0.zip
Use correct symbol for minimum int64 value
The old code used SEQ_MINVALUE to get the smallest int64 value. This was done as a convenience to avoid having to deal with INT64_IS_BUSTED, but that is obsolete now. Also, it is incorrect because the smallest int64 value is actually SEQ_MINVALUE-1. Fix by writing out the constant the long way, as it is done elsewhere in the code.
-rw-r--r--contrib/btree_gin/btree_gin.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/contrib/btree_gin/btree_gin.c b/contrib/btree_gin/btree_gin.c
index 5c4f58b8b1f..56ee26519f6 100644
--- a/contrib/btree_gin/btree_gin.c
+++ b/contrib/btree_gin/btree_gin.c
@@ -214,10 +214,7 @@ GIN_SUPPORT(int4)
static Datum
leftmostvalue_int8(void)
{
- /*
- * Use sequence's definition to keep compatibility.
- */
- return Int64GetDatum(SEQ_MINVALUE);
+ return Int64GetDatum(-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1);
}
static TypeInfo TypeInfo_int8 = {false, leftmostvalue_int8, btint8cmp};
@@ -244,10 +241,7 @@ GIN_SUPPORT(float8)
static Datum
leftmostvalue_money(void)
{
- /*
- * Use sequence's definition to keep compatibility.
- */
- return Int64GetDatum(SEQ_MINVALUE);
+ return Int64GetDatum(-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1);
}
static TypeInfo TypeInfo_money = {false, leftmostvalue_money, cash_cmp};