diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2004-06-03 12:26:10 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2004-06-03 12:26:10 +0000 |
commit | 7b81988f9b5275e2cdf7bbb0ca0620a24f1afc82 (patch) | |
tree | a21263073a48e6b7f9e6949734a3f0724a799579 /contrib/btree_gist/btree_oid.c | |
parent | 921d749bd4c34c3349f1c254d5faa2f1cec03911 (diff) |
- 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
Diffstat (limited to 'contrib/btree_gist/btree_oid.c')
-rw-r--r-- | contrib/btree_gist/btree_oid.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index 204846e43d2..d7d98e4a7b3 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -91,6 +91,7 @@ gbt_oid_compress(PG_FUNCTION_ARGS) Datum gbt_oid_consistent(PG_FUNCTION_ARGS) { + GISTENTRY *entry = (GISTENTRY *) PG_GETARG_POINTER(0); Oid query = PG_GETARG_OID(1); oidKEY *kkk = (oidKEY *) DatumGetPointer(entry->key); @@ -122,12 +123,11 @@ gbt_oid_penalty(PG_FUNCTION_ARGS) oidKEY *newentry = (oidKEY *) DatumGetPointer(((GISTENTRY *) PG_GETARG_POINTER(1))->key); float *result = (float *) PG_GETARG_POINTER(2); - Oid res ; + Oid res = 0 ; *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 ; |