mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
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.
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user