Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f36ca9a

Browse files
committed
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 using PG_INT64_MIN.
1 parent 47f5bb9 commit f36ca9a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

contrib/btree_gin/btree_gin.c

+2-8
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ GIN_SUPPORT(int4, false, leftmostvalue_int4, btint4cmp)
223223
static Datum
224224
leftmostvalue_int8(void)
225225
{
226-
/*
227-
* Use sequence's definition to keep compatibility.
228-
*/
229-
return Int64GetDatum(SEQ_MINVALUE);
226+
return Int64GetDatum(PG_INT64_MIN);
230227
}
231228

232229
GIN_SUPPORT(int8, false, leftmostvalue_int8, btint8cmp)
@@ -250,10 +247,7 @@ GIN_SUPPORT(float8, false, leftmostvalue_float8, btfloat8cmp)
250247
static Datum
251248
leftmostvalue_money(void)
252249
{
253-
/*
254-
* Use sequence's definition to keep compatibility.
255-
*/
256-
return Int64GetDatum(SEQ_MINVALUE);
250+
return Int64GetDatum(PG_INT64_MIN);
257251
}
258252

259253
GIN_SUPPORT(money, false, leftmostvalue_money, cash_cmp)

0 commit comments

Comments
 (0)