tskey_cmp() should use timestamp_cmp() instead of doing its own
interval arithmetic. From Teodor Sigaev.
This commit is contained in:
parent
839c7924ec
commit
07f6c02eac
@ -447,21 +447,13 @@ gts_binary_union(Datum *r1, char *r2)
|
||||
|
||||
static int
|
||||
tskey_cmp(const void *a, const void *b) {
|
||||
Interval *intr;
|
||||
float result;
|
||||
|
||||
intr = DatumGetIntervalP( DirectFunctionCall2(
|
||||
timestamp_mi,
|
||||
TimestampGetDatum( ((TSKEY*)(((RIX*)a)->r))->lower ),
|
||||
TimestampGetDatum( ((TSKEY*)(((RIX*)b)->r))->lower )) );
|
||||
|
||||
/* see interval_larger */
|
||||
result = intr->time+intr->month * (30.0 * 86400);
|
||||
pfree( intr );
|
||||
if ( result == 0.0 )
|
||||
return 0;
|
||||
else
|
||||
return ( result>0 ) ? 1 : 0;
|
||||
return DatumGetInt32(
|
||||
DirectFunctionCall2(
|
||||
timestamp_cmp,
|
||||
TimestampGetDatum( ((TSKEY*)(((RIX*)a)->r))->lower ),
|
||||
TimestampGetDatum( ((TSKEY*)(((RIX*)b)->r))->lower )
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user