mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Clean up newlines following left parentheses
We used to strategically place newlines after some function call left parentheses to make pgindent move the argument list a few chars to the left, so that the whole line would fit under 80 chars. However, pgindent no longer does that, so the newlines just made the code vertically longer for no reason. Remove those newlines, and reflow some of those lines for some extra naturality. Reviewed-by: Michael Paquier, Tom Lane Discussion: https://postgr.es/m/20200129200401.GA6303@alvherre.pgsql
This commit is contained in:
@ -150,9 +150,9 @@ gbt_cash_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo,
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -169,9 +169,8 @@ gbt_cash_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -202,11 +201,9 @@ gbt_cash_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_cash_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -29,41 +29,42 @@ PG_FUNCTION_INFO_V1(gbt_date_same);
|
||||
static bool
|
||||
gbt_dategt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
DirectFunctionCall2(date_gt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
|
||||
);
|
||||
return DatumGetBool(DirectFunctionCall2(date_gt,
|
||||
DateADTGetDatum(*((const DateADT *) a)),
|
||||
DateADTGetDatum(*((const DateADT *) b))));
|
||||
}
|
||||
|
||||
static bool
|
||||
gbt_datege(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
DirectFunctionCall2(date_ge, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
|
||||
);
|
||||
return DatumGetBool(DirectFunctionCall2(date_ge,
|
||||
DateADTGetDatum(*((const DateADT *) a)),
|
||||
DateADTGetDatum(*((const DateADT *) b))));
|
||||
}
|
||||
|
||||
static bool
|
||||
gbt_dateeq(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
DirectFunctionCall2(date_eq, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
|
||||
return DatumGetBool(DirectFunctionCall2(date_eq,
|
||||
DateADTGetDatum(*((const DateADT *) a)),
|
||||
DateADTGetDatum(*((const DateADT *) b)))
|
||||
);
|
||||
}
|
||||
|
||||
static bool
|
||||
gbt_datele(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
DirectFunctionCall2(date_le, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
|
||||
);
|
||||
return DatumGetBool(DirectFunctionCall2(date_le,
|
||||
DateADTGetDatum(*((const DateADT *) a)),
|
||||
DateADTGetDatum(*((const DateADT *) b))));
|
||||
}
|
||||
|
||||
static bool
|
||||
gbt_datelt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
DirectFunctionCall2(date_lt, DateADTGetDatum(*((const DateADT *) a)), DateADTGetDatum(*((const DateADT *) b)))
|
||||
);
|
||||
return DatumGetBool(DirectFunctionCall2(date_lt,
|
||||
DateADTGetDatum(*((const DateADT *) a)),
|
||||
DateADTGetDatum(*((const DateADT *) b))));
|
||||
}
|
||||
|
||||
|
||||
@ -75,9 +76,13 @@ gbt_datekey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
dateKEY *ib = (dateKEY *) (((const Nsrt *) b)->t);
|
||||
int res;
|
||||
|
||||
res = DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->lower), DateADTGetDatum(ib->lower)));
|
||||
res = DatumGetInt32(DirectFunctionCall2(date_cmp,
|
||||
DateADTGetDatum(ia->lower),
|
||||
DateADTGetDatum(ib->lower)));
|
||||
if (res == 0)
|
||||
return DatumGetInt32(DirectFunctionCall2(date_cmp, DateADTGetDatum(ia->upper), DateADTGetDatum(ib->upper)));
|
||||
return DatumGetInt32(DirectFunctionCall2(date_cmp,
|
||||
DateADTGetDatum(ia->upper),
|
||||
DateADTGetDatum(ib->upper)));
|
||||
|
||||
return res;
|
||||
}
|
||||
@ -162,9 +167,9 @@ gbt_date_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo,
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -181,9 +186,8 @@ gbt_date_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -207,15 +211,13 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
|
||||
int32 diff,
|
||||
res;
|
||||
|
||||
diff = DatumGetInt32(DirectFunctionCall2(
|
||||
date_mi,
|
||||
diff = DatumGetInt32(DirectFunctionCall2(date_mi,
|
||||
DateADTGetDatum(newentry->upper),
|
||||
DateADTGetDatum(origentry->upper)));
|
||||
|
||||
res = Max(diff, 0);
|
||||
|
||||
diff = DatumGetInt32(DirectFunctionCall2(
|
||||
date_mi,
|
||||
diff = DatumGetInt32(DirectFunctionCall2(date_mi,
|
||||
DateADTGetDatum(origentry->lower),
|
||||
DateADTGetDatum(newentry->lower)));
|
||||
|
||||
@ -225,8 +227,7 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
diff = DatumGetInt32(DirectFunctionCall2(
|
||||
date_mi,
|
||||
diff = DatumGetInt32(DirectFunctionCall2(date_mi,
|
||||
DateADTGetDatum(origentry->upper),
|
||||
DateADTGetDatum(origentry->lower)));
|
||||
*result += FLT_MIN;
|
||||
@ -241,11 +242,9 @@ gbt_date_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_date_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -31,16 +31,16 @@ PG_FUNCTION_INFO_V1(gbt_enum_same);
|
||||
static bool
|
||||
gbt_enumgt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
|
||||
);
|
||||
return DatumGetBool(CallerFInfoFunctionCall2(enum_gt, flinfo, InvalidOid,
|
||||
ObjectIdGetDatum(*((const Oid *) a)),
|
||||
ObjectIdGetDatum(*((const Oid *) b))));
|
||||
}
|
||||
static bool
|
||||
gbt_enumge(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
|
||||
);
|
||||
return DatumGetBool(CallerFInfoFunctionCall2(enum_ge, flinfo, InvalidOid,
|
||||
ObjectIdGetDatum(*((const Oid *) a)),
|
||||
ObjectIdGetDatum(*((const Oid *) b))));
|
||||
}
|
||||
static bool
|
||||
gbt_enumeq(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
@ -50,16 +50,16 @@ gbt_enumeq(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
static bool
|
||||
gbt_enumle(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
CallerFInfoFunctionCall2(enum_le, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
|
||||
);
|
||||
return DatumGetBool(CallerFInfoFunctionCall2(enum_le, flinfo, InvalidOid,
|
||||
ObjectIdGetDatum(*((const Oid *) a)),
|
||||
ObjectIdGetDatum(*((const Oid *) b))));
|
||||
}
|
||||
static bool
|
||||
gbt_enumlt(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
{
|
||||
return DatumGetBool(
|
||||
CallerFInfoFunctionCall2(enum_lt, flinfo, InvalidOid, ObjectIdGetDatum(*((const Oid *) a)), ObjectIdGetDatum(*((const Oid *) b)))
|
||||
);
|
||||
return DatumGetBool(CallerFInfoFunctionCall2(enum_lt, flinfo, InvalidOid,
|
||||
ObjectIdGetDatum(*((const Oid *) a)),
|
||||
ObjectIdGetDatum(*((const Oid *) b))));
|
||||
}
|
||||
|
||||
static int
|
||||
@ -73,14 +73,14 @@ gbt_enumkey_cmp(const void *a, const void *b, FmgrInfo *flinfo)
|
||||
if (ia->upper == ib->upper)
|
||||
return 0;
|
||||
|
||||
return DatumGetInt32(
|
||||
CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->upper), ObjectIdGetDatum(ib->upper))
|
||||
);
|
||||
return DatumGetInt32(CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid,
|
||||
ObjectIdGetDatum(ia->upper),
|
||||
ObjectIdGetDatum(ib->upper)));
|
||||
}
|
||||
|
||||
return DatumGetInt32(
|
||||
CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid, ObjectIdGetDatum(ia->lower), ObjectIdGetDatum(ib->lower))
|
||||
);
|
||||
return DatumGetInt32(CallerFInfoFunctionCall2(enum_cmp, flinfo, InvalidOid,
|
||||
ObjectIdGetDatum(ia->lower),
|
||||
ObjectIdGetDatum(ib->lower)));
|
||||
}
|
||||
|
||||
static const gbtree_ninfo tinfo =
|
||||
@ -137,9 +137,9 @@ gbt_enum_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo,
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -168,11 +168,9 @@ gbt_enum_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_enum_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -143,9 +143,9 @@ gbt_float4_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo,
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -162,9 +162,8 @@ gbt_float4_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -195,11 +194,9 @@ gbt_float4_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_float4_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -150,9 +150,9 @@ gbt_float8_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo,
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -169,9 +169,8 @@ gbt_float8_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -202,11 +201,9 @@ gbt_float8_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_float8_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -171,11 +171,9 @@ gbt_inet_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_inet_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -150,9 +150,8 @@ gbt_int2_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -169,9 +168,8 @@ gbt_int2_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -201,11 +199,9 @@ gbt_int2_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_int2_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -151,9 +151,8 @@ gbt_int4_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -170,9 +169,8 @@ gbt_int4_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -202,11 +200,9 @@ gbt_int4_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_int4_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -151,9 +151,8 @@ gbt_int8_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -170,9 +169,8 @@ gbt_int8_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -202,11 +200,9 @@ gbt_int8_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_int8_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -225,9 +225,8 @@ gbt_intv_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -244,9 +243,8 @@ gbt_intv_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -284,11 +282,9 @@ gbt_intv_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_intv_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -141,9 +141,8 @@ gbt_macad_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -181,11 +180,9 @@ gbt_macad_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_macad_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -141,9 +141,8 @@ gbt_macad8_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -181,11 +180,9 @@ gbt_macad8_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_macad8_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -174,23 +174,17 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS)
|
||||
ok = gbt_var_key_readable(org);
|
||||
uk = gbt_var_key_readable((GBT_VARKEY *) DatumGetPointer(uni));
|
||||
|
||||
us = DatumGetNumeric(DirectFunctionCall2(
|
||||
numeric_sub,
|
||||
us = DatumGetNumeric(DirectFunctionCall2(numeric_sub,
|
||||
PointerGetDatum(uk.upper),
|
||||
PointerGetDatum(uk.lower)
|
||||
));
|
||||
PointerGetDatum(uk.lower)));
|
||||
|
||||
os = DatumGetNumeric(DirectFunctionCall2(
|
||||
numeric_sub,
|
||||
os = DatumGetNumeric(DirectFunctionCall2(numeric_sub,
|
||||
PointerGetDatum(ok.upper),
|
||||
PointerGetDatum(ok.lower)
|
||||
));
|
||||
PointerGetDatum(ok.lower)));
|
||||
|
||||
ds = DatumGetNumeric(DirectFunctionCall2(
|
||||
numeric_sub,
|
||||
ds = DatumGetNumeric(DirectFunctionCall2(numeric_sub,
|
||||
NumericGetDatum(us),
|
||||
NumericGetDatum(os)
|
||||
));
|
||||
NumericGetDatum(os)));
|
||||
|
||||
if (numeric_is_nan(us))
|
||||
{
|
||||
@ -208,11 +202,9 @@ gbt_numeric_penalty(PG_FUNCTION_ARGS)
|
||||
if (DirectFunctionCall2(numeric_gt, NumericGetDatum(ds), NumericGetDatum(nul)))
|
||||
{
|
||||
*result += FLT_MIN;
|
||||
os = DatumGetNumeric(DirectFunctionCall2(
|
||||
numeric_div,
|
||||
os = DatumGetNumeric(DirectFunctionCall2(numeric_div,
|
||||
NumericGetDatum(ds),
|
||||
NumericGetDatum(us)
|
||||
));
|
||||
NumericGetDatum(us)));
|
||||
*result += (float4) DatumGetFloat8(DirectFunctionCall1(numeric_float8_no_overflow, NumericGetDatum(os)));
|
||||
}
|
||||
}
|
||||
|
@ -151,9 +151,8 @@ gbt_oid_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -170,9 +169,8 @@ gbt_oid_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -202,11 +200,9 @@ gbt_oid_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_oid_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -216,9 +216,8 @@ gbt_time_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -234,9 +233,8 @@ gbt_time_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -260,9 +258,8 @@ gbt_timetz_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &qqq, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -287,15 +284,13 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
|
||||
double res;
|
||||
double res2;
|
||||
|
||||
intr = DatumGetIntervalP(DirectFunctionCall2(
|
||||
time_mi_time,
|
||||
intr = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,
|
||||
TimeADTGetDatumFast(newentry->upper),
|
||||
TimeADTGetDatumFast(origentry->upper)));
|
||||
res = INTERVAL_TO_SEC(intr);
|
||||
res = Max(res, 0);
|
||||
|
||||
intr = DatumGetIntervalP(DirectFunctionCall2(
|
||||
time_mi_time,
|
||||
intr = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,
|
||||
TimeADTGetDatumFast(origentry->lower),
|
||||
TimeADTGetDatumFast(newentry->lower)));
|
||||
res2 = INTERVAL_TO_SEC(intr);
|
||||
@ -307,8 +302,7 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
|
||||
|
||||
if (res > 0)
|
||||
{
|
||||
intr = DatumGetIntervalP(DirectFunctionCall2(
|
||||
time_mi_time,
|
||||
intr = DatumGetIntervalP(DirectFunctionCall2(time_mi_time,
|
||||
TimeADTGetDatumFast(origentry->upper),
|
||||
TimeADTGetDatumFast(origentry->lower)));
|
||||
*result += FLT_MIN;
|
||||
@ -323,11 +317,9 @@ gbt_time_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_time_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -265,9 +265,8 @@ gbt_ts_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &query, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -283,9 +282,8 @@ gbt_ts_distance(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &query, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -308,9 +306,8 @@ gbt_tstz_consistent(PG_FUNCTION_ARGS)
|
||||
key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)];
|
||||
qqq = tstz_to_ts_gmt(query);
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) &qqq, &strategy, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) &qqq, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -328,9 +325,8 @@ gbt_tstz_distance(PG_FUNCTION_ARGS)
|
||||
key.upper = (GBT_NUMKEY *) &kkk[MAXALIGN(tinfo.size)];
|
||||
qqq = tstz_to_ts_gmt(query);
|
||||
|
||||
PG_RETURN_FLOAT8(
|
||||
gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_FLOAT8(gbt_num_distance(&key, (void *) &qqq, GIST_LEAF(entry),
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
|
||||
@ -387,11 +383,9 @@ gbt_ts_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_ts_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
@ -190,10 +190,9 @@ gbt_bytea_pf_match(const bytea *pf, const bytea *query, const gbtree_vinfo *tinf
|
||||
static bool
|
||||
gbt_var_node_pf_match(const GBT_VARKEY_R *node, const bytea *query, const gbtree_vinfo *tinfo)
|
||||
{
|
||||
return (tinfo->trnc && (
|
||||
gbt_bytea_pf_match(node->lower, query, tinfo) ||
|
||||
gbt_bytea_pf_match(node->upper, query, tinfo)
|
||||
));
|
||||
return (tinfo->trnc &&
|
||||
(gbt_bytea_pf_match(node->lower, query, tinfo) ||
|
||||
gbt_bytea_pf_match(node->upper, query, tinfo)));
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,10 +148,9 @@ gbt_uuid_consistent(PG_FUNCTION_ARGS)
|
||||
key.lower = (GBT_NUMKEY *) &kkk->lower;
|
||||
key.upper = (GBT_NUMKEY *) &kkk->upper;
|
||||
|
||||
PG_RETURN_BOOL(
|
||||
gbt_num_consistent(&key, (void *) query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo, fcinfo->flinfo)
|
||||
);
|
||||
PG_RETURN_BOOL(gbt_num_consistent(&key, (void *) query, &strategy,
|
||||
GIST_LEAF(entry), &tinfo,
|
||||
fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
@ -219,11 +218,9 @@ gbt_uuid_penalty(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
gbt_uuid_picksplit(PG_FUNCTION_ARGS)
|
||||
{
|
||||
PG_RETURN_POINTER(gbt_num_picksplit(
|
||||
(GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
PG_RETURN_POINTER(gbt_num_picksplit((GistEntryVector *) PG_GETARG_POINTER(0),
|
||||
(GIST_SPLITVEC *) PG_GETARG_POINTER(1),
|
||||
&tinfo, fcinfo->flinfo
|
||||
));
|
||||
&tinfo, fcinfo->flinfo));
|
||||
}
|
||||
|
||||
Datum
|
||||
|
Reference in New Issue
Block a user