float gistpenalty(GISTSTATE *giststate, int attno, GISTENTRY *orig, bool isNullOrig, GISTENTRY *add, bool isNullAdd) { float penalty = 0.0; if (giststate->penaltyFn[attno].fn_strict == false || (isNullOrig == false && isNullAdd == false)) { FunctionCall3Coll(&giststate->penaltyFn[attno], giststate->supportCollation[attno], PointerGetDatum(orig), PointerGetDatum(add), PointerGetDatum(&penalty)); /* disallow negative or NaN penalty */ if (isnan(penalty) || penalty < 0.0) penalty = 0.0; } else if (isNullOrig && isNullAdd) penalty = 0.0; else { /* try to prevent mixing null and non-null values */ penalty = get_float4_infinity(); } return penalty; }
static Datum leftmostvalue_float4(void) { return Float4GetDatum(-get_float4_infinity()); }