Skip to content
Snippets Groups Projects
Commit 805f2bb5 authored by Peter Eisentraut's avatar Peter Eisentraut
Browse files

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.
parent 16e28fce
No related branches found
No related tags found
No related merge requests found
...@@ -213,10 +213,7 @@ GIN_SUPPORT(int4) ...@@ -213,10 +213,7 @@ GIN_SUPPORT(int4)
static Datum static Datum
leftmostvalue_int8(void) leftmostvalue_int8(void)
{ {
/* return Int64GetDatum(-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1);
* Use sequence's definition to keep compatibility.
*/
return Int64GetDatum(SEQ_MINVALUE);
} }
static TypeInfo TypeInfo_int8 = {false, leftmostvalue_int8, btint8cmp}; static TypeInfo TypeInfo_int8 = {false, leftmostvalue_int8, btint8cmp};
...@@ -243,10 +240,7 @@ GIN_SUPPORT(float8) ...@@ -243,10 +240,7 @@ GIN_SUPPORT(float8)
static Datum static Datum
leftmostvalue_money(void) leftmostvalue_money(void)
{ {
/* return Int64GetDatum(-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1);
* Use sequence's definition to keep compatibility.
*/
return Int64GetDatum(SEQ_MINVALUE);
} }
static TypeInfo TypeInfo_money = {false, leftmostvalue_money, cash_cmp}; static TypeInfo TypeInfo_money = {false, leftmostvalue_money, cash_cmp};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment