1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +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:
Teodor Sigaev
2004-06-03 12:26:10 +00:00
parent 921d749bd4
commit 7b81988f9b
17 changed files with 161 additions and 110 deletions

View File

@ -91,6 +91,7 @@ gbt_int4_compress(PG_FUNCTION_ARGS)
Datum
gbt_int4_consistent(PG_FUNCTION_ARGS)
{
GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
int32 query = PG_GETARG_INT32(1);
int32KEY *kkk = (int32KEY *) DatumGetPointer(entry->key);
@ -125,8 +126,7 @@ gbt_int4_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 ;