mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
- Add aligment of variable data types
- Add aligment for interval data types - Avoid floating point overflow in penalty functions Janko Richter <jankorichter@yahoo.de> and teodor
This commit is contained in:
@ -91,6 +91,7 @@ gbt_float8_compress(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_float8_consistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
|
||||
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
|
||||
float8 query = PG_GETARG_FLOAT8(1);
|
||||
float8KEY *kkk = (float8KEY *) DatumGetPointer(entry->key);
|
||||
@ -126,8 +127,7 @@ gbt_float8_penalty(PG_FUNCTION_ARGS)
|
||||
|
||||
*result = 0.0;
|
||||
|
||||
res = Max(newentry->upper - origentry->upper, 0) +
|
||||
Max(origentry->lower - newentry->lower, 0);
|
||||
penalty_range_enlarge ( origentry->lower, origentry->upper, newentry->lower, newentry->upper );
|
||||
|
||||
if ( res > 0 ){
|
||||
*result += FLT_MIN ;
|
||||
|
Reference in New Issue
Block a user