diff options
author | Teodor Sigaev <teodor@sigaev.ru> | 2005-07-01 13:44:56 +0000 |
---|---|---|
committer | Teodor Sigaev <teodor@sigaev.ru> | 2005-07-01 13:44:56 +0000 |
commit | ef770cbb6913cc4c816bb09acd7cb13f996281bd (patch) | |
tree | fe973e6aeb9c018d54ea6267f49d5d1b2d5d2f95 /contrib/btree_gist/btree_oid.c | |
parent | 8f6e8e8fed372a592f645d8900b6f456db82cc59 (diff) | |
download | postgresql-ef770cbb6913cc4c816bb09acd7cb13f996281bd.tar.gz postgresql-ef770cbb6913cc4c816bb09acd7cb13f996281bd.zip |
Fixes from Janko Richter <jankorichter@yahoo.de>
- Fix wrong index results on text, char, varchar for multibyte strings
- Fix some SIGFPE signals
- Add support for infinite timestamps
- Because of locale settings, btree_gist can not be a prefix index anymore (for text).
Each node holds now just the lower and upper boundary.
Diffstat (limited to 'contrib/btree_gist/btree_oid.c')
-rw-r--r-- | contrib/btree_gist/btree_oid.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c index db4182fc047..d76d8763722 100644 --- a/contrib/btree_gist/btree_oid.c +++ b/contrib/btree_gist/btree_oid.c @@ -129,18 +129,7 @@ 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 = 0; - - *result = 0.0; - - penalty_range_enlarge(origentry->lower, origentry->upper, newentry->lower, newentry->upper); - - if (res > 0) - { - *result += FLT_MIN; - *result += (float) (res / ((double) (res + origentry->upper - origentry->lower))); - *result *= (FLT_MAX / (((GISTENTRY *) PG_GETARG_POINTER(0))->rel->rd_att->natts + 1)); - } + penalty_num(result,origentry->lower,origentry->upper,newentry->lower,newentry->upper); PG_RETURN_POINTER(result); } |