Reduce excessive dereferencing of function pointers
It is equivalent in ANSI C to write (*funcptr) () and funcptr(). These two styles have been applied inconsistently. After discussion, we'll use the more verbose style for plain function pointer variables, to make it clear that it's a variable, and the shorter style when the function pointer is in a struct (s.func() or s->func()), because then it's clear that it's not a plain function name, and otherwise the excessive punctuation makes some of those invocations hard to read. Discussion: https://www.postgresql.org/message-id/f52c16db-14ed-757d-4b48-7ef360b1631d@2ndquadrant.com
This commit is contained in:
parent
9d71323dac
commit
1356f78ea9
@ -184,10 +184,10 @@ gbt_num_union(GBT_NUMKEY *out, const GistEntryVector *entryvec, const gbtree_nin
|
|||||||
c.lower = &cur[0];
|
c.lower = &cur[0];
|
||||||
c.upper = &cur[tinfo->size];
|
c.upper = &cur[tinfo->size];
|
||||||
/* if out->lower > cur->lower, adopt cur as lower */
|
/* if out->lower > cur->lower, adopt cur as lower */
|
||||||
if ((*tinfo->f_gt) (o.lower, c.lower, flinfo))
|
if (tinfo->f_gt(o.lower, c.lower, flinfo))
|
||||||
memcpy((void *) o.lower, (void *) c.lower, tinfo->size);
|
memcpy((void *) o.lower, (void *) c.lower, tinfo->size);
|
||||||
/* if out->upper < cur->upper, adopt cur as upper */
|
/* if out->upper < cur->upper, adopt cur as upper */
|
||||||
if ((*tinfo->f_lt) (o.upper, c.upper, flinfo))
|
if (tinfo->f_lt(o.upper, c.upper, flinfo))
|
||||||
memcpy((void *) o.upper, (void *) c.upper, tinfo->size);
|
memcpy((void *) o.upper, (void *) c.upper, tinfo->size);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +211,8 @@ gbt_num_same(const GBT_NUMKEY *a, const GBT_NUMKEY *b, const gbtree_ninfo *tinfo
|
|||||||
b2.lower = &(((GBT_NUMKEY *) b)[0]);
|
b2.lower = &(((GBT_NUMKEY *) b)[0]);
|
||||||
b2.upper = &(((GBT_NUMKEY *) b)[tinfo->size]);
|
b2.upper = &(((GBT_NUMKEY *) b)[tinfo->size]);
|
||||||
|
|
||||||
return ((*tinfo->f_eq) (b1.lower, b2.lower, flinfo) &&
|
return (tinfo->f_eq(b1.lower, b2.lower, flinfo) &&
|
||||||
(*tinfo->f_eq) (b1.upper, b2.upper, flinfo));
|
tinfo->f_eq(b1.upper, b2.upper, flinfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -236,9 +236,9 @@ gbt_num_bin_union(Datum *u, GBT_NUMKEY *e, const gbtree_ninfo *tinfo, FmgrInfo *
|
|||||||
|
|
||||||
ur.lower = &(((GBT_NUMKEY *) DatumGetPointer(*u))[0]);
|
ur.lower = &(((GBT_NUMKEY *) DatumGetPointer(*u))[0]);
|
||||||
ur.upper = &(((GBT_NUMKEY *) DatumGetPointer(*u))[tinfo->size]);
|
ur.upper = &(((GBT_NUMKEY *) DatumGetPointer(*u))[tinfo->size]);
|
||||||
if ((*tinfo->f_gt) ((void *) ur.lower, (void *) rd.lower, flinfo))
|
if (tinfo->f_gt((void *) ur.lower, (void *) rd.lower, flinfo))
|
||||||
memcpy((void *) ur.lower, (void *) rd.lower, tinfo->size);
|
memcpy((void *) ur.lower, (void *) rd.lower, tinfo->size);
|
||||||
if ((*tinfo->f_lt) ((void *) ur.upper, (void *) rd.upper, flinfo))
|
if (tinfo->f_lt((void *) ur.upper, (void *) rd.upper, flinfo))
|
||||||
memcpy((void *) ur.upper, (void *) rd.upper, tinfo->size);
|
memcpy((void *) ur.upper, (void *) rd.upper, tinfo->size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -264,33 +264,33 @@ gbt_num_consistent(const GBT_NUMKEY_R *key,
|
|||||||
switch (*strategy)
|
switch (*strategy)
|
||||||
{
|
{
|
||||||
case BTLessEqualStrategyNumber:
|
case BTLessEqualStrategyNumber:
|
||||||
retval = (*tinfo->f_ge) (query, key->lower, flinfo);
|
retval = tinfo->f_ge(query, key->lower, flinfo);
|
||||||
break;
|
break;
|
||||||
case BTLessStrategyNumber:
|
case BTLessStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_gt) (query, key->lower, flinfo);
|
retval = tinfo->f_gt(query, key->lower, flinfo);
|
||||||
else
|
else
|
||||||
retval = (*tinfo->f_ge) (query, key->lower, flinfo);
|
retval = tinfo->f_ge(query, key->lower, flinfo);
|
||||||
break;
|
break;
|
||||||
case BTEqualStrategyNumber:
|
case BTEqualStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_eq) (query, key->lower, flinfo);
|
retval = tinfo->f_eq(query, key->lower, flinfo);
|
||||||
else
|
else
|
||||||
retval = ((*tinfo->f_le) (key->lower, query, flinfo) &&
|
retval = (tinfo->f_le(key->lower, query, flinfo) &&
|
||||||
(*tinfo->f_le) (query, key->upper, flinfo));
|
tinfo->f_le(query, key->upper, flinfo));
|
||||||
break;
|
break;
|
||||||
case BTGreaterStrategyNumber:
|
case BTGreaterStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_lt) (query, key->upper, flinfo);
|
retval = tinfo->f_lt(query, key->upper, flinfo);
|
||||||
else
|
else
|
||||||
retval = (*tinfo->f_le) (query, key->upper, flinfo);
|
retval = tinfo->f_le(query, key->upper, flinfo);
|
||||||
break;
|
break;
|
||||||
case BTGreaterEqualStrategyNumber:
|
case BTGreaterEqualStrategyNumber:
|
||||||
retval = (*tinfo->f_le) (query, key->upper, flinfo);
|
retval = tinfo->f_le(query, key->upper, flinfo);
|
||||||
break;
|
break;
|
||||||
case BtreeGistNotEqualStrategyNumber:
|
case BtreeGistNotEqualStrategyNumber:
|
||||||
retval = (!((*tinfo->f_eq) (query, key->lower, flinfo) &&
|
retval = (!(tinfo->f_eq(query, key->lower, flinfo) &&
|
||||||
(*tinfo->f_eq) (query, key->upper, flinfo)));
|
tinfo->f_eq(query, key->upper, flinfo)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
retval = false;
|
retval = false;
|
||||||
|
@ -109,7 +109,7 @@ gbt_var_leaf2node(GBT_VARKEY *leaf, const gbtree_vinfo *tinfo, FmgrInfo *flinfo)
|
|||||||
GBT_VARKEY *out = leaf;
|
GBT_VARKEY *out = leaf;
|
||||||
|
|
||||||
if (tinfo->f_l2n)
|
if (tinfo->f_l2n)
|
||||||
out = (*tinfo->f_l2n) (leaf, flinfo);
|
out = tinfo->f_l2n(leaf, flinfo);
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
@ -255,13 +255,13 @@ gbt_var_bin_union(Datum *u, GBT_VARKEY *e, Oid collation,
|
|||||||
nr.lower = ro.lower;
|
nr.lower = ro.lower;
|
||||||
nr.upper = ro.upper;
|
nr.upper = ro.upper;
|
||||||
|
|
||||||
if ((*tinfo->f_cmp) (ro.lower, eo.lower, collation, flinfo) > 0)
|
if (tinfo->f_cmp(ro.lower, eo.lower, collation, flinfo) > 0)
|
||||||
{
|
{
|
||||||
nr.lower = eo.lower;
|
nr.lower = eo.lower;
|
||||||
update = true;
|
update = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*tinfo->f_cmp) (ro.upper, eo.upper, collation, flinfo) < 0)
|
if (tinfo->f_cmp(ro.upper, eo.upper, collation, flinfo) < 0)
|
||||||
{
|
{
|
||||||
nr.upper = eo.upper;
|
nr.upper = eo.upper;
|
||||||
update = true;
|
update = true;
|
||||||
@ -371,8 +371,8 @@ gbt_var_same(Datum d1, Datum d2, Oid collation,
|
|||||||
r1 = gbt_var_key_readable(t1);
|
r1 = gbt_var_key_readable(t1);
|
||||||
r2 = gbt_var_key_readable(t2);
|
r2 = gbt_var_key_readable(t2);
|
||||||
|
|
||||||
return ((*tinfo->f_cmp) (r1.lower, r2.lower, collation, flinfo) == 0 &&
|
return (tinfo->f_cmp(r1.lower, r2.lower, collation, flinfo) == 0 &&
|
||||||
(*tinfo->f_cmp) (r1.upper, r2.upper, collation, flinfo) == 0);
|
tinfo->f_cmp(r1.upper, r2.upper, collation, flinfo) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -400,9 +400,9 @@ gbt_var_penalty(float *res, const GISTENTRY *o, const GISTENTRY *n,
|
|||||||
|
|
||||||
if ((VARSIZE(ok.lower) - VARHDRSZ) == 0 && (VARSIZE(ok.upper) - VARHDRSZ) == 0)
|
if ((VARSIZE(ok.lower) - VARHDRSZ) == 0 && (VARSIZE(ok.upper) - VARHDRSZ) == 0)
|
||||||
*res = 0.0;
|
*res = 0.0;
|
||||||
else if (!(((*tinfo->f_cmp) (nk.lower, ok.lower, collation, flinfo) >= 0 ||
|
else if (!((tinfo->f_cmp(nk.lower, ok.lower, collation, flinfo) >= 0 ||
|
||||||
gbt_bytea_pf_match(ok.lower, nk.lower, tinfo)) &&
|
gbt_bytea_pf_match(ok.lower, nk.lower, tinfo)) &&
|
||||||
((*tinfo->f_cmp) (nk.upper, ok.upper, collation, flinfo) <= 0 ||
|
(tinfo->f_cmp(nk.upper, ok.upper, collation, flinfo) <= 0 ||
|
||||||
gbt_bytea_pf_match(ok.upper, nk.upper, tinfo))))
|
gbt_bytea_pf_match(ok.upper, nk.upper, tinfo))))
|
||||||
{
|
{
|
||||||
Datum d = PointerGetDatum(0);
|
Datum d = PointerGetDatum(0);
|
||||||
@ -449,9 +449,9 @@ gbt_vsrt_cmp(const void *a, const void *b, void *arg)
|
|||||||
const gbt_vsrt_arg *varg = (const gbt_vsrt_arg *) arg;
|
const gbt_vsrt_arg *varg = (const gbt_vsrt_arg *) arg;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = (*varg->tinfo->f_cmp) (ar.lower, br.lower, varg->collation, varg->flinfo);
|
res = varg->tinfo->f_cmp(ar.lower, br.lower, varg->collation, varg->flinfo);
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
return (*varg->tinfo->f_cmp) (ar.upper, br.upper, varg->collation, varg->flinfo);
|
return varg->tinfo->f_cmp(ar.upper, br.upper, varg->collation, varg->flinfo);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -567,44 +567,44 @@ gbt_var_consistent(GBT_VARKEY_R *key,
|
|||||||
{
|
{
|
||||||
case BTLessEqualStrategyNumber:
|
case BTLessEqualStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_ge) (query, key->lower, collation, flinfo);
|
retval = tinfo->f_ge(query, key->lower, collation, flinfo);
|
||||||
else
|
else
|
||||||
retval = (*tinfo->f_cmp) (query, key->lower, collation, flinfo) >= 0
|
retval = tinfo->f_cmp(query, key->lower, collation, flinfo) >= 0
|
||||||
|| gbt_var_node_pf_match(key, query, tinfo);
|
|| gbt_var_node_pf_match(key, query, tinfo);
|
||||||
break;
|
break;
|
||||||
case BTLessStrategyNumber:
|
case BTLessStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_gt) (query, key->lower, collation, flinfo);
|
retval = tinfo->f_gt(query, key->lower, collation, flinfo);
|
||||||
else
|
else
|
||||||
retval = (*tinfo->f_cmp) (query, key->lower, collation, flinfo) >= 0
|
retval = tinfo->f_cmp(query, key->lower, collation, flinfo) >= 0
|
||||||
|| gbt_var_node_pf_match(key, query, tinfo);
|
|| gbt_var_node_pf_match(key, query, tinfo);
|
||||||
break;
|
break;
|
||||||
case BTEqualStrategyNumber:
|
case BTEqualStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_eq) (query, key->lower, collation, flinfo);
|
retval = tinfo->f_eq(query, key->lower, collation, flinfo);
|
||||||
else
|
else
|
||||||
retval =
|
retval =
|
||||||
((*tinfo->f_cmp) (key->lower, query, collation, flinfo) <= 0 &&
|
(tinfo->f_cmp(key->lower, query, collation, flinfo) <= 0 &&
|
||||||
(*tinfo->f_cmp) (query, key->upper, collation, flinfo) <= 0) ||
|
tinfo->f_cmp(query, key->upper, collation, flinfo) <= 0) ||
|
||||||
gbt_var_node_pf_match(key, query, tinfo);
|
gbt_var_node_pf_match(key, query, tinfo);
|
||||||
break;
|
break;
|
||||||
case BTGreaterStrategyNumber:
|
case BTGreaterStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_lt) (query, key->upper, collation, flinfo);
|
retval = tinfo->f_lt(query, key->upper, collation, flinfo);
|
||||||
else
|
else
|
||||||
retval = (*tinfo->f_cmp) (query, key->upper, collation, flinfo) <= 0
|
retval = tinfo->f_cmp(query, key->upper, collation, flinfo) <= 0
|
||||||
|| gbt_var_node_pf_match(key, query, tinfo);
|
|| gbt_var_node_pf_match(key, query, tinfo);
|
||||||
break;
|
break;
|
||||||
case BTGreaterEqualStrategyNumber:
|
case BTGreaterEqualStrategyNumber:
|
||||||
if (is_leaf)
|
if (is_leaf)
|
||||||
retval = (*tinfo->f_le) (query, key->upper, collation, flinfo);
|
retval = tinfo->f_le(query, key->upper, collation, flinfo);
|
||||||
else
|
else
|
||||||
retval = (*tinfo->f_cmp) (query, key->upper, collation, flinfo) <= 0
|
retval = tinfo->f_cmp(query, key->upper, collation, flinfo) <= 0
|
||||||
|| gbt_var_node_pf_match(key, query, tinfo);
|
|| gbt_var_node_pf_match(key, query, tinfo);
|
||||||
break;
|
break;
|
||||||
case BtreeGistNotEqualStrategyNumber:
|
case BtreeGistNotEqualStrategyNumber:
|
||||||
retval = !((*tinfo->f_eq) (query, key->lower, collation, flinfo) &&
|
retval = !(tinfo->f_eq(query, key->lower, collation, flinfo) &&
|
||||||
(*tinfo->f_eq) (query, key->upper, collation, flinfo));
|
tinfo->f_eq(query, key->upper, collation, flinfo));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
|
@ -3347,7 +3347,7 @@ CallXactCallbacks(XactEvent event)
|
|||||||
XactCallbackItem *item;
|
XactCallbackItem *item;
|
||||||
|
|
||||||
for (item = Xact_callbacks; item; item = item->next)
|
for (item = Xact_callbacks; item; item = item->next)
|
||||||
(*item->callback) (event, item->arg);
|
item->callback(event, item->arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -3404,7 +3404,7 @@ CallSubXactCallbacks(SubXactEvent event,
|
|||||||
SubXactCallbackItem *item;
|
SubXactCallbackItem *item;
|
||||||
|
|
||||||
for (item = SubXact_callbacks; item; item = item->next)
|
for (item = SubXact_callbacks; item; item = item->next)
|
||||||
(*item->callback) (event, mySubid, parentSubid, item->arg);
|
item->callback(event, mySubid, parentSubid, item->arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ do_analyze_rel(Relation onerel, int options, VacuumParams *params,
|
|||||||
|
|
||||||
stats->rows = rows;
|
stats->rows = rows;
|
||||||
stats->tupDesc = onerel->rd_att;
|
stats->tupDesc = onerel->rd_att;
|
||||||
(*stats->compute_stats) (stats,
|
stats->compute_stats(stats,
|
||||||
std_fetch_func,
|
std_fetch_func,
|
||||||
numrows,
|
numrows,
|
||||||
totalrows);
|
totalrows);
|
||||||
@ -830,7 +830,7 @@ compute_index_stats(Relation onerel, double totalrows,
|
|||||||
stats->exprvals = exprvals + i;
|
stats->exprvals = exprvals + i;
|
||||||
stats->exprnulls = exprnulls + i;
|
stats->exprnulls = exprnulls + i;
|
||||||
stats->rowstride = attr_cnt;
|
stats->rowstride = attr_cnt;
|
||||||
(*stats->compute_stats) (stats,
|
stats->compute_stats(stats,
|
||||||
ind_fetch_func,
|
ind_fetch_func,
|
||||||
numindexrows,
|
numindexrows,
|
||||||
totalindexrows);
|
totalindexrows);
|
||||||
|
@ -397,7 +397,7 @@ PersistHoldablePortal(Portal portal)
|
|||||||
/* Fetch the result set into the tuplestore */
|
/* Fetch the result set into the tuplestore */
|
||||||
ExecutorRun(queryDesc, ForwardScanDirection, 0L, false);
|
ExecutorRun(queryDesc, ForwardScanDirection, 0L, false);
|
||||||
|
|
||||||
(*queryDesc->dest->rDestroy) (queryDesc->dest);
|
queryDesc->dest->rDestroy(queryDesc->dest);
|
||||||
queryDesc->dest = NULL;
|
queryDesc->dest = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -122,7 +122,7 @@ ExecSecLabelStmt(SecLabelStmt *stmt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Provider gets control here, may throw ERROR to veto new label. */
|
/* Provider gets control here, may throw ERROR to veto new label. */
|
||||||
(*provider->hook) (&address, stmt->label);
|
provider->hook(&address, stmt->label);
|
||||||
|
|
||||||
/* Apply new label. */
|
/* Apply new label. */
|
||||||
SetSecurityLabel(&address, provider->provider_name, stmt->label);
|
SetSecurityLabel(&address, provider->provider_name, stmt->label);
|
||||||
|
@ -220,7 +220,7 @@ fetch_cursor_param_value(ExprContext *econtext, int paramId)
|
|||||||
|
|
||||||
/* give hook a chance in case parameter is dynamic */
|
/* give hook a chance in case parameter is dynamic */
|
||||||
if (!OidIsValid(prm->ptype) && paramInfo->paramFetch != NULL)
|
if (!OidIsValid(prm->ptype) && paramInfo->paramFetch != NULL)
|
||||||
(*paramInfo->paramFetch) (paramInfo, paramId);
|
paramInfo->paramFetch(paramInfo, paramId);
|
||||||
|
|
||||||
if (OidIsValid(prm->ptype) && !prm->isnull)
|
if (OidIsValid(prm->ptype) && !prm->isnull)
|
||||||
{
|
{
|
||||||
|
@ -647,7 +647,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
|
FunctionCallInfo fcinfo = op->d.func.fcinfo_data;
|
||||||
|
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
*op->resvalue = (op->d.func.fn_addr) (fcinfo);
|
*op->resvalue = op->d.func.fn_addr(fcinfo);
|
||||||
*op->resnull = fcinfo->isnull;
|
*op->resnull = fcinfo->isnull;
|
||||||
|
|
||||||
EEO_NEXT();
|
EEO_NEXT();
|
||||||
@ -669,7 +669,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
*op->resvalue = (op->d.func.fn_addr) (fcinfo);
|
*op->resvalue = op->d.func.fn_addr(fcinfo);
|
||||||
*op->resnull = fcinfo->isnull;
|
*op->resnull = fcinfo->isnull;
|
||||||
|
|
||||||
strictfail:
|
strictfail:
|
||||||
@ -684,7 +684,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
pgstat_init_function_usage(fcinfo, &fcusage);
|
pgstat_init_function_usage(fcinfo, &fcusage);
|
||||||
|
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
*op->resvalue = (op->d.func.fn_addr) (fcinfo);
|
*op->resvalue = op->d.func.fn_addr(fcinfo);
|
||||||
*op->resnull = fcinfo->isnull;
|
*op->resnull = fcinfo->isnull;
|
||||||
|
|
||||||
pgstat_end_function_usage(&fcusage, true);
|
pgstat_end_function_usage(&fcusage, true);
|
||||||
@ -712,7 +712,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
pgstat_init_function_usage(fcinfo, &fcusage);
|
pgstat_init_function_usage(fcinfo, &fcusage);
|
||||||
|
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
*op->resvalue = (op->d.func.fn_addr) (fcinfo);
|
*op->resvalue = op->d.func.fn_addr(fcinfo);
|
||||||
*op->resnull = fcinfo->isnull;
|
*op->resnull = fcinfo->isnull;
|
||||||
|
|
||||||
pgstat_end_function_usage(&fcusage, true);
|
pgstat_end_function_usage(&fcusage, true);
|
||||||
@ -1170,7 +1170,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
Datum eqresult;
|
Datum eqresult;
|
||||||
|
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
eqresult = (op->d.func.fn_addr) (fcinfo);
|
eqresult = op->d.func.fn_addr(fcinfo);
|
||||||
/* Must invert result of "="; safe to do even if null */
|
/* Must invert result of "="; safe to do even if null */
|
||||||
*op->resvalue = BoolGetDatum(!DatumGetBool(eqresult));
|
*op->resvalue = BoolGetDatum(!DatumGetBool(eqresult));
|
||||||
*op->resnull = fcinfo->isnull;
|
*op->resnull = fcinfo->isnull;
|
||||||
@ -1192,7 +1192,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
Datum result;
|
Datum result;
|
||||||
|
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
result = (op->d.func.fn_addr) (fcinfo);
|
result = op->d.func.fn_addr(fcinfo);
|
||||||
|
|
||||||
/* if the arguments are equal return null */
|
/* if the arguments are equal return null */
|
||||||
if (!fcinfo->isnull && DatumGetBool(result))
|
if (!fcinfo->isnull && DatumGetBool(result))
|
||||||
@ -1279,7 +1279,7 @@ ExecInterpExpr(ExprState *state, ExprContext *econtext, bool *isnull)
|
|||||||
|
|
||||||
/* Apply comparison function */
|
/* Apply comparison function */
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
*op->resvalue = (op->d.rowcompare_step.fn_addr) (fcinfo);
|
*op->resvalue = op->d.rowcompare_step.fn_addr(fcinfo);
|
||||||
|
|
||||||
/* force NULL result if NULL function result */
|
/* force NULL result if NULL function result */
|
||||||
if (fcinfo->isnull)
|
if (fcinfo->isnull)
|
||||||
@ -1878,7 +1878,7 @@ ExecEvalParamExtern(ExprState *state, ExprEvalStep *op, ExprContext *econtext)
|
|||||||
|
|
||||||
/* give hook a chance in case parameter is dynamic */
|
/* give hook a chance in case parameter is dynamic */
|
||||||
if (!OidIsValid(prm->ptype) && paramInfo->paramFetch != NULL)
|
if (!OidIsValid(prm->ptype) && paramInfo->paramFetch != NULL)
|
||||||
(*paramInfo->paramFetch) (paramInfo, paramId);
|
paramInfo->paramFetch(paramInfo, paramId);
|
||||||
|
|
||||||
if (likely(OidIsValid(prm->ptype)))
|
if (likely(OidIsValid(prm->ptype)))
|
||||||
{
|
{
|
||||||
@ -3000,7 +3000,7 @@ ExecEvalScalarArrayOp(ExprState *state, ExprEvalStep *op)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
fcinfo->isnull = false;
|
fcinfo->isnull = false;
|
||||||
thisresult = (op->d.scalararrayop.fn_addr) (fcinfo);
|
thisresult = op->d.scalararrayop.fn_addr(fcinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Combine results per OR or AND semantics */
|
/* Combine results per OR or AND semantics */
|
||||||
|
@ -349,7 +349,7 @@ standard_ExecutorRun(QueryDesc *queryDesc,
|
|||||||
queryDesc->plannedstmt->hasReturning);
|
queryDesc->plannedstmt->hasReturning);
|
||||||
|
|
||||||
if (sendTuples)
|
if (sendTuples)
|
||||||
(*dest->rStartup) (dest, operation, queryDesc->tupDesc);
|
dest->rStartup(dest, operation, queryDesc->tupDesc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* run plan
|
* run plan
|
||||||
@ -375,7 +375,7 @@ standard_ExecutorRun(QueryDesc *queryDesc,
|
|||||||
* shutdown tuple receiver, if we started it
|
* shutdown tuple receiver, if we started it
|
||||||
*/
|
*/
|
||||||
if (sendTuples)
|
if (sendTuples)
|
||||||
(*dest->rShutdown) (dest);
|
dest->rShutdown(dest);
|
||||||
|
|
||||||
if (queryDesc->totaltime)
|
if (queryDesc->totaltime)
|
||||||
InstrStopNode(queryDesc->totaltime, estate->es_processed);
|
InstrStopNode(queryDesc->totaltime, estate->es_processed);
|
||||||
@ -1752,7 +1752,7 @@ ExecutePlan(EState *estate,
|
|||||||
* has closed and no more tuples can be sent. If that's the case,
|
* has closed and no more tuples can be sent. If that's the case,
|
||||||
* end the loop.
|
* end the loop.
|
||||||
*/
|
*/
|
||||||
if (!((*dest->receiveSlot) (slot, dest)))
|
if (!dest->receiveSlot(slot, dest))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1081,5 +1081,5 @@ ParallelQueryMain(dsm_segment *seg, shm_toc *toc)
|
|||||||
/* Cleanup. */
|
/* Cleanup. */
|
||||||
dsa_detach(area);
|
dsa_detach(area);
|
||||||
FreeQueryDesc(queryDesc);
|
FreeQueryDesc(queryDesc);
|
||||||
(*receiver->rDestroy) (receiver);
|
receiver->rDestroy(receiver);
|
||||||
}
|
}
|
||||||
|
@ -1241,7 +1241,7 @@ begin_tup_output_tupdesc(DestReceiver *dest, TupleDesc tupdesc)
|
|||||||
tstate->slot = MakeSingleTupleTableSlot(tupdesc);
|
tstate->slot = MakeSingleTupleTableSlot(tupdesc);
|
||||||
tstate->dest = dest;
|
tstate->dest = dest;
|
||||||
|
|
||||||
(*tstate->dest->rStartup) (tstate->dest, (int) CMD_SELECT, tupdesc);
|
tstate->dest->rStartup(tstate->dest, (int) CMD_SELECT, tupdesc);
|
||||||
|
|
||||||
return tstate;
|
return tstate;
|
||||||
}
|
}
|
||||||
@ -1266,7 +1266,7 @@ do_tup_output(TupOutputState *tstate, Datum *values, bool *isnull)
|
|||||||
ExecStoreVirtualTuple(slot);
|
ExecStoreVirtualTuple(slot);
|
||||||
|
|
||||||
/* send the tuple to the receiver */
|
/* send the tuple to the receiver */
|
||||||
(void) (*tstate->dest->receiveSlot) (slot, tstate->dest);
|
(void) tstate->dest->receiveSlot(slot, tstate->dest);
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
ExecClearTuple(slot);
|
ExecClearTuple(slot);
|
||||||
@ -1310,7 +1310,7 @@ do_text_output_multiline(TupOutputState *tstate, const char *txt)
|
|||||||
void
|
void
|
||||||
end_tup_output(TupOutputState *tstate)
|
end_tup_output(TupOutputState *tstate)
|
||||||
{
|
{
|
||||||
(*tstate->dest->rShutdown) (tstate->dest);
|
tstate->dest->rShutdown(tstate->dest);
|
||||||
/* note that destroying the dest is not ours to do */
|
/* note that destroying the dest is not ours to do */
|
||||||
ExecDropSingleTupleTableSlot(tstate->slot);
|
ExecDropSingleTupleTableSlot(tstate->slot);
|
||||||
pfree(tstate);
|
pfree(tstate);
|
||||||
|
@ -813,7 +813,7 @@ ShutdownExprContext(ExprContext *econtext, bool isCommit)
|
|||||||
{
|
{
|
||||||
econtext->ecxt_callbacks = ecxt_callback->next;
|
econtext->ecxt_callbacks = ecxt_callback->next;
|
||||||
if (isCommit)
|
if (isCommit)
|
||||||
(*ecxt_callback->function) (ecxt_callback->arg);
|
ecxt_callback->function(ecxt_callback->arg);
|
||||||
pfree(ecxt_callback);
|
pfree(ecxt_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -886,7 +886,7 @@ postquel_end(execution_state *es)
|
|||||||
ExecutorEnd(es->qd);
|
ExecutorEnd(es->qd);
|
||||||
}
|
}
|
||||||
|
|
||||||
(*es->qd->dest->rDestroy) (es->qd->dest);
|
es->qd->dest->rDestroy(es->qd->dest);
|
||||||
|
|
||||||
FreeQueryDesc(es->qd);
|
FreeQueryDesc(es->qd);
|
||||||
es->qd = NULL;
|
es->qd = NULL;
|
||||||
|
@ -73,7 +73,7 @@ copyParamList(ParamListInfo from)
|
|||||||
|
|
||||||
/* give hook a chance in case parameter is dynamic */
|
/* give hook a chance in case parameter is dynamic */
|
||||||
if (!OidIsValid(oprm->ptype) && from->paramFetch != NULL)
|
if (!OidIsValid(oprm->ptype) && from->paramFetch != NULL)
|
||||||
(*from->paramFetch) (from, i + 1);
|
from->paramFetch(from, i + 1);
|
||||||
|
|
||||||
/* flat-copy the parameter info */
|
/* flat-copy the parameter info */
|
||||||
*nprm = *oprm;
|
*nprm = *oprm;
|
||||||
@ -115,7 +115,7 @@ EstimateParamListSpace(ParamListInfo paramLI)
|
|||||||
{
|
{
|
||||||
/* give hook a chance in case parameter is dynamic */
|
/* give hook a chance in case parameter is dynamic */
|
||||||
if (!OidIsValid(prm->ptype) && paramLI->paramFetch != NULL)
|
if (!OidIsValid(prm->ptype) && paramLI->paramFetch != NULL)
|
||||||
(*paramLI->paramFetch) (paramLI, i + 1);
|
paramLI->paramFetch(paramLI, i + 1);
|
||||||
typeOid = prm->ptype;
|
typeOid = prm->ptype;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +184,7 @@ SerializeParamList(ParamListInfo paramLI, char **start_address)
|
|||||||
{
|
{
|
||||||
/* give hook a chance in case parameter is dynamic */
|
/* give hook a chance in case parameter is dynamic */
|
||||||
if (!OidIsValid(prm->ptype) && paramLI->paramFetch != NULL)
|
if (!OidIsValid(prm->ptype) && paramLI->paramFetch != NULL)
|
||||||
(*paramLI->paramFetch) (paramLI, i + 1);
|
paramLI->paramFetch(paramLI, i + 1);
|
||||||
typeOid = prm->ptype;
|
typeOid = prm->ptype;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -369,7 +369,7 @@ coerce_type(ParseState *pstate, Node *node,
|
|||||||
* transformed node (very possibly the same Param node), or return
|
* transformed node (very possibly the same Param node), or return
|
||||||
* NULL to indicate we should proceed with normal coercion.
|
* NULL to indicate we should proceed with normal coercion.
|
||||||
*/
|
*/
|
||||||
result = (*pstate->p_coerce_param_hook) (pstate,
|
result = pstate->p_coerce_param_hook(pstate,
|
||||||
(Param *) node,
|
(Param *) node,
|
||||||
targetTypeId,
|
targetTypeId,
|
||||||
targetTypeMod,
|
targetTypeMod,
|
||||||
|
@ -527,7 +527,7 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref)
|
|||||||
*/
|
*/
|
||||||
if (pstate->p_pre_columnref_hook != NULL)
|
if (pstate->p_pre_columnref_hook != NULL)
|
||||||
{
|
{
|
||||||
node = (*pstate->p_pre_columnref_hook) (pstate, cref);
|
node = pstate->p_pre_columnref_hook(pstate, cref);
|
||||||
if (node != NULL)
|
if (node != NULL)
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
@ -758,7 +758,7 @@ transformColumnRef(ParseState *pstate, ColumnRef *cref)
|
|||||||
{
|
{
|
||||||
Node *hookresult;
|
Node *hookresult;
|
||||||
|
|
||||||
hookresult = (*pstate->p_post_columnref_hook) (pstate, cref, node);
|
hookresult = pstate->p_post_columnref_hook(pstate, cref, node);
|
||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
node = hookresult;
|
node = hookresult;
|
||||||
else if (hookresult != NULL)
|
else if (hookresult != NULL)
|
||||||
@ -813,7 +813,7 @@ transformParamRef(ParseState *pstate, ParamRef *pref)
|
|||||||
* call it. If not, or if the hook returns NULL, throw a generic error.
|
* call it. If not, or if the hook returns NULL, throw a generic error.
|
||||||
*/
|
*/
|
||||||
if (pstate->p_paramref_hook != NULL)
|
if (pstate->p_paramref_hook != NULL)
|
||||||
result = (*pstate->p_paramref_hook) (pstate, pref);
|
result = pstate->p_paramref_hook(pstate, pref);
|
||||||
else
|
else
|
||||||
result = NULL;
|
result = NULL;
|
||||||
|
|
||||||
@ -2585,9 +2585,9 @@ transformCurrentOfExpr(ParseState *pstate, CurrentOfExpr *cexpr)
|
|||||||
|
|
||||||
/* See if there is a translation available from a parser hook */
|
/* See if there is a translation available from a parser hook */
|
||||||
if (pstate->p_pre_columnref_hook != NULL)
|
if (pstate->p_pre_columnref_hook != NULL)
|
||||||
node = (*pstate->p_pre_columnref_hook) (pstate, cref);
|
node = pstate->p_pre_columnref_hook(pstate, cref);
|
||||||
if (node == NULL && pstate->p_post_columnref_hook != NULL)
|
if (node == NULL && pstate->p_post_columnref_hook != NULL)
|
||||||
node = (*pstate->p_post_columnref_hook) (pstate, cref, NULL);
|
node = pstate->p_post_columnref_hook(pstate, cref, NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX Should we throw an error if we get a translation that isn't a
|
* XXX Should we throw an error if we get a translation that isn't a
|
||||||
|
@ -1108,7 +1108,7 @@ ExpandColumnRefStar(ParseState *pstate, ColumnRef *cref,
|
|||||||
{
|
{
|
||||||
Node *node;
|
Node *node;
|
||||||
|
|
||||||
node = (*pstate->p_pre_columnref_hook) (pstate, cref);
|
node = pstate->p_pre_columnref_hook(pstate, cref);
|
||||||
if (node != NULL)
|
if (node != NULL)
|
||||||
return ExpandRowReference(pstate, node, make_target_entry);
|
return ExpandRowReference(pstate, node, make_target_entry);
|
||||||
}
|
}
|
||||||
@ -1163,7 +1163,7 @@ ExpandColumnRefStar(ParseState *pstate, ColumnRef *cref,
|
|||||||
{
|
{
|
||||||
Node *node;
|
Node *node;
|
||||||
|
|
||||||
node = (*pstate->p_post_columnref_hook) (pstate, cref,
|
node = pstate->p_post_columnref_hook(pstate, cref,
|
||||||
(Node *) rte);
|
(Node *) rte);
|
||||||
if (node != NULL)
|
if (node != NULL)
|
||||||
{
|
{
|
||||||
|
@ -1143,7 +1143,7 @@ replace_rte_variables_mutator(Node *node,
|
|||||||
/* Found a matching variable, make the substitution */
|
/* Found a matching variable, make the substitution */
|
||||||
Node *newnode;
|
Node *newnode;
|
||||||
|
|
||||||
newnode = (*context->callback) (var, context);
|
newnode = context->callback(var, context);
|
||||||
/* Detect if we are adding a sublink to query */
|
/* Detect if we are adding a sublink to query */
|
||||||
if (!context->inserted_sublink)
|
if (!context->inserted_sublink)
|
||||||
context->inserted_sublink = checkExprHasSubLink(newnode);
|
context->inserted_sublink = checkExprHasSubLink(newnode);
|
||||||
|
@ -197,7 +197,7 @@ proc_exit_prepare(int code)
|
|||||||
* possible.
|
* possible.
|
||||||
*/
|
*/
|
||||||
while (--on_proc_exit_index >= 0)
|
while (--on_proc_exit_index >= 0)
|
||||||
(*on_proc_exit_list[on_proc_exit_index].function) (code,
|
on_proc_exit_list[on_proc_exit_index].function(code,
|
||||||
on_proc_exit_list[on_proc_exit_index].arg);
|
on_proc_exit_list[on_proc_exit_index].arg);
|
||||||
|
|
||||||
on_proc_exit_index = 0;
|
on_proc_exit_index = 0;
|
||||||
@ -225,7 +225,7 @@ shmem_exit(int code)
|
|||||||
elog(DEBUG3, "shmem_exit(%d): %d before_shmem_exit callbacks to make",
|
elog(DEBUG3, "shmem_exit(%d): %d before_shmem_exit callbacks to make",
|
||||||
code, before_shmem_exit_index);
|
code, before_shmem_exit_index);
|
||||||
while (--before_shmem_exit_index >= 0)
|
while (--before_shmem_exit_index >= 0)
|
||||||
(*before_shmem_exit_list[before_shmem_exit_index].function) (code,
|
before_shmem_exit_list[before_shmem_exit_index].function(code,
|
||||||
before_shmem_exit_list[before_shmem_exit_index].arg);
|
before_shmem_exit_list[before_shmem_exit_index].arg);
|
||||||
before_shmem_exit_index = 0;
|
before_shmem_exit_index = 0;
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ shmem_exit(int code)
|
|||||||
elog(DEBUG3, "shmem_exit(%d): %d on_shmem_exit callbacks to make",
|
elog(DEBUG3, "shmem_exit(%d): %d on_shmem_exit callbacks to make",
|
||||||
code, on_shmem_exit_index);
|
code, on_shmem_exit_index);
|
||||||
while (--on_shmem_exit_index >= 0)
|
while (--on_shmem_exit_index >= 0)
|
||||||
(*on_shmem_exit_list[on_shmem_exit_index].function) (code,
|
on_shmem_exit_list[on_shmem_exit_index].function(code,
|
||||||
on_shmem_exit_list[on_shmem_exit_index].arg);
|
on_shmem_exit_list[on_shmem_exit_index].arg);
|
||||||
on_shmem_exit_index = 0;
|
on_shmem_exit_index = 0;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ smgrinit(void)
|
|||||||
for (i = 0; i < NSmgr; i++)
|
for (i = 0; i < NSmgr; i++)
|
||||||
{
|
{
|
||||||
if (smgrsw[i].smgr_init)
|
if (smgrsw[i].smgr_init)
|
||||||
(*(smgrsw[i].smgr_init)) ();
|
smgrsw[i].smgr_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* register the shutdown proc */
|
/* register the shutdown proc */
|
||||||
@ -124,7 +124,7 @@ smgrshutdown(int code, Datum arg)
|
|||||||
for (i = 0; i < NSmgr; i++)
|
for (i = 0; i < NSmgr; i++)
|
||||||
{
|
{
|
||||||
if (smgrsw[i].smgr_shutdown)
|
if (smgrsw[i].smgr_shutdown)
|
||||||
(*(smgrsw[i].smgr_shutdown)) ();
|
smgrsw[i].smgr_shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ remove_from_unowned_list(SMgrRelation reln)
|
|||||||
bool
|
bool
|
||||||
smgrexists(SMgrRelation reln, ForkNumber forknum)
|
smgrexists(SMgrRelation reln, ForkNumber forknum)
|
||||||
{
|
{
|
||||||
return (*(smgrsw[reln->smgr_which].smgr_exists)) (reln, forknum);
|
return smgrsw[reln->smgr_which].smgr_exists(reln, forknum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -299,7 +299,7 @@ smgrclose(SMgrRelation reln)
|
|||||||
ForkNumber forknum;
|
ForkNumber forknum;
|
||||||
|
|
||||||
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
||||||
(*(smgrsw[reln->smgr_which].smgr_close)) (reln, forknum);
|
smgrsw[reln->smgr_which].smgr_close(reln, forknum);
|
||||||
|
|
||||||
owner = reln->smgr_owner;
|
owner = reln->smgr_owner;
|
||||||
|
|
||||||
@ -395,7 +395,7 @@ smgrcreate(SMgrRelation reln, ForkNumber forknum, bool isRedo)
|
|||||||
reln->smgr_rnode.node.dbNode,
|
reln->smgr_rnode.node.dbNode,
|
||||||
isRedo);
|
isRedo);
|
||||||
|
|
||||||
(*(smgrsw[reln->smgr_which].smgr_create)) (reln, forknum, isRedo);
|
smgrsw[reln->smgr_which].smgr_create(reln, forknum, isRedo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -419,7 +419,7 @@ smgrdounlink(SMgrRelation reln, bool isRedo)
|
|||||||
|
|
||||||
/* Close the forks at smgr level */
|
/* Close the forks at smgr level */
|
||||||
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
||||||
(*(smgrsw[which].smgr_close)) (reln, forknum);
|
smgrsw[which].smgr_close(reln, forknum);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get rid of any remaining buffers for the relation. bufmgr will just
|
* Get rid of any remaining buffers for the relation. bufmgr will just
|
||||||
@ -451,7 +451,7 @@ smgrdounlink(SMgrRelation reln, bool isRedo)
|
|||||||
* ERROR, because we've already decided to commit or abort the current
|
* ERROR, because we've already decided to commit or abort the current
|
||||||
* xact.
|
* xact.
|
||||||
*/
|
*/
|
||||||
(*(smgrsw[which].smgr_unlink)) (rnode, InvalidForkNumber, isRedo);
|
smgrsw[which].smgr_unlink(rnode, InvalidForkNumber, isRedo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -491,7 +491,7 @@ smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo)
|
|||||||
|
|
||||||
/* Close the forks at smgr level */
|
/* Close the forks at smgr level */
|
||||||
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
||||||
(*(smgrsw[which].smgr_close)) (rels[i], forknum);
|
smgrsw[which].smgr_close(rels[i], forknum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -529,7 +529,7 @@ smgrdounlinkall(SMgrRelation *rels, int nrels, bool isRedo)
|
|||||||
int which = rels[i]->smgr_which;
|
int which = rels[i]->smgr_which;
|
||||||
|
|
||||||
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
for (forknum = 0; forknum <= MAX_FORKNUM; forknum++)
|
||||||
(*(smgrsw[which].smgr_unlink)) (rnodes[i], forknum, isRedo);
|
smgrsw[which].smgr_unlink(rnodes[i], forknum, isRedo);
|
||||||
}
|
}
|
||||||
|
|
||||||
pfree(rnodes);
|
pfree(rnodes);
|
||||||
@ -552,7 +552,7 @@ smgrdounlinkfork(SMgrRelation reln, ForkNumber forknum, bool isRedo)
|
|||||||
int which = reln->smgr_which;
|
int which = reln->smgr_which;
|
||||||
|
|
||||||
/* Close the fork at smgr level */
|
/* Close the fork at smgr level */
|
||||||
(*(smgrsw[which].smgr_close)) (reln, forknum);
|
smgrsw[which].smgr_close(reln, forknum);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get rid of any remaining buffers for the fork. bufmgr will just drop
|
* Get rid of any remaining buffers for the fork. bufmgr will just drop
|
||||||
@ -584,7 +584,7 @@ smgrdounlinkfork(SMgrRelation reln, ForkNumber forknum, bool isRedo)
|
|||||||
* ERROR, because we've already decided to commit or abort the current
|
* ERROR, because we've already decided to commit or abort the current
|
||||||
* xact.
|
* xact.
|
||||||
*/
|
*/
|
||||||
(*(smgrsw[which].smgr_unlink)) (rnode, forknum, isRedo);
|
smgrsw[which].smgr_unlink(rnode, forknum, isRedo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -600,7 +600,7 @@ void
|
|||||||
smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
||||||
char *buffer, bool skipFsync)
|
char *buffer, bool skipFsync)
|
||||||
{
|
{
|
||||||
(*(smgrsw[reln->smgr_which].smgr_extend)) (reln, forknum, blocknum,
|
smgrsw[reln->smgr_which].smgr_extend(reln, forknum, blocknum,
|
||||||
buffer, skipFsync);
|
buffer, skipFsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ smgrextend(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
|||||||
void
|
void
|
||||||
smgrprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum)
|
smgrprefetch(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum)
|
||||||
{
|
{
|
||||||
(*(smgrsw[reln->smgr_which].smgr_prefetch)) (reln, forknum, blocknum);
|
smgrsw[reln->smgr_which].smgr_prefetch(reln, forknum, blocknum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -625,7 +625,7 @@ void
|
|||||||
smgrread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
smgrread(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
||||||
char *buffer)
|
char *buffer)
|
||||||
{
|
{
|
||||||
(*(smgrsw[reln->smgr_which].smgr_read)) (reln, forknum, blocknum, buffer);
|
smgrsw[reln->smgr_which].smgr_read(reln, forknum, blocknum, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -647,7 +647,7 @@ void
|
|||||||
smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
smgrwrite(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
||||||
char *buffer, bool skipFsync)
|
char *buffer, bool skipFsync)
|
||||||
{
|
{
|
||||||
(*(smgrsw[reln->smgr_which].smgr_write)) (reln, forknum, blocknum,
|
smgrsw[reln->smgr_which].smgr_write(reln, forknum, blocknum,
|
||||||
buffer, skipFsync);
|
buffer, skipFsync);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ void
|
|||||||
smgrwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
smgrwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
||||||
BlockNumber nblocks)
|
BlockNumber nblocks)
|
||||||
{
|
{
|
||||||
(*(smgrsw[reln->smgr_which].smgr_writeback)) (reln, forknum, blocknum,
|
smgrsw[reln->smgr_which].smgr_writeback(reln, forknum, blocknum,
|
||||||
nblocks);
|
nblocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -671,7 +671,7 @@ smgrwriteback(SMgrRelation reln, ForkNumber forknum, BlockNumber blocknum,
|
|||||||
BlockNumber
|
BlockNumber
|
||||||
smgrnblocks(SMgrRelation reln, ForkNumber forknum)
|
smgrnblocks(SMgrRelation reln, ForkNumber forknum)
|
||||||
{
|
{
|
||||||
return (*(smgrsw[reln->smgr_which].smgr_nblocks)) (reln, forknum);
|
return smgrsw[reln->smgr_which].smgr_nblocks(reln, forknum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -704,7 +704,7 @@ smgrtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
|
|||||||
/*
|
/*
|
||||||
* Do the truncation.
|
* Do the truncation.
|
||||||
*/
|
*/
|
||||||
(*(smgrsw[reln->smgr_which].smgr_truncate)) (reln, forknum, nblocks);
|
smgrsw[reln->smgr_which].smgr_truncate(reln, forknum, nblocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -733,7 +733,7 @@ smgrtruncate(SMgrRelation reln, ForkNumber forknum, BlockNumber nblocks)
|
|||||||
void
|
void
|
||||||
smgrimmedsync(SMgrRelation reln, ForkNumber forknum)
|
smgrimmedsync(SMgrRelation reln, ForkNumber forknum)
|
||||||
{
|
{
|
||||||
(*(smgrsw[reln->smgr_which].smgr_immedsync)) (reln, forknum);
|
smgrsw[reln->smgr_which].smgr_immedsync(reln, forknum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -748,7 +748,7 @@ smgrpreckpt(void)
|
|||||||
for (i = 0; i < NSmgr; i++)
|
for (i = 0; i < NSmgr; i++)
|
||||||
{
|
{
|
||||||
if (smgrsw[i].smgr_pre_ckpt)
|
if (smgrsw[i].smgr_pre_ckpt)
|
||||||
(*(smgrsw[i].smgr_pre_ckpt)) ();
|
smgrsw[i].smgr_pre_ckpt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -763,7 +763,7 @@ smgrsync(void)
|
|||||||
for (i = 0; i < NSmgr; i++)
|
for (i = 0; i < NSmgr; i++)
|
||||||
{
|
{
|
||||||
if (smgrsw[i].smgr_sync)
|
if (smgrsw[i].smgr_sync)
|
||||||
(*(smgrsw[i].smgr_sync)) ();
|
smgrsw[i].smgr_sync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -778,7 +778,7 @@ smgrpostckpt(void)
|
|||||||
for (i = 0; i < NSmgr; i++)
|
for (i = 0; i < NSmgr; i++)
|
||||||
{
|
{
|
||||||
if (smgrsw[i].smgr_post_ckpt)
|
if (smgrsw[i].smgr_post_ckpt)
|
||||||
(*(smgrsw[i].smgr_post_ckpt)) ();
|
smgrsw[i].smgr_post_ckpt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1114,7 +1114,7 @@ exec_simple_query(const char *query_string)
|
|||||||
receiver,
|
receiver,
|
||||||
completionTag);
|
completionTag);
|
||||||
|
|
||||||
(*receiver->rDestroy) (receiver);
|
receiver->rDestroy(receiver);
|
||||||
|
|
||||||
PortalDrop(portal, false);
|
PortalDrop(portal, false);
|
||||||
|
|
||||||
@ -2002,7 +2002,7 @@ exec_execute_message(const char *portal_name, long max_rows)
|
|||||||
receiver,
|
receiver,
|
||||||
completionTag);
|
completionTag);
|
||||||
|
|
||||||
(*receiver->rDestroy) (receiver);
|
receiver->rDestroy(receiver);
|
||||||
|
|
||||||
if (completed)
|
if (completed)
|
||||||
{
|
{
|
||||||
|
@ -1049,7 +1049,7 @@ FillPortalStore(Portal portal, bool isTopLevel)
|
|||||||
if (completionTag[0] != '\0')
|
if (completionTag[0] != '\0')
|
||||||
portal->commandTag = pstrdup(completionTag);
|
portal->commandTag = pstrdup(completionTag);
|
||||||
|
|
||||||
(*treceiver->rDestroy) (treceiver);
|
treceiver->rDestroy(treceiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1073,7 +1073,7 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count,
|
|||||||
|
|
||||||
slot = MakeSingleTupleTableSlot(portal->tupDesc);
|
slot = MakeSingleTupleTableSlot(portal->tupDesc);
|
||||||
|
|
||||||
(*dest->rStartup) (dest, CMD_SELECT, portal->tupDesc);
|
dest->rStartup(dest, CMD_SELECT, portal->tupDesc);
|
||||||
|
|
||||||
if (ScanDirectionIsNoMovement(direction))
|
if (ScanDirectionIsNoMovement(direction))
|
||||||
{
|
{
|
||||||
@ -1103,7 +1103,7 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count,
|
|||||||
* has closed and no more tuples can be sent. If that's the case,
|
* has closed and no more tuples can be sent. If that's the case,
|
||||||
* end the loop.
|
* end the loop.
|
||||||
*/
|
*/
|
||||||
if (!((*dest->receiveSlot) (slot, dest)))
|
if (!dest->receiveSlot(slot, dest))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
ExecClearTuple(slot);
|
ExecClearTuple(slot);
|
||||||
@ -1119,7 +1119,7 @@ RunFromStore(Portal portal, ScanDirection direction, uint64 count,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
(*dest->rShutdown) (dest);
|
dest->rShutdown(dest);
|
||||||
|
|
||||||
ExecDropSingleTupleTableSlot(slot);
|
ExecDropSingleTupleTableSlot(slot);
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
|
|||||||
* temporarily install that.
|
* temporarily install that.
|
||||||
*/
|
*/
|
||||||
stats->extra_data = extra_data->std_extra_data;
|
stats->extra_data = extra_data->std_extra_data;
|
||||||
(*extra_data->std_compute_stats) (stats, fetchfunc, samplerows, totalrows);
|
extra_data->std_compute_stats(stats, fetchfunc, samplerows, totalrows);
|
||||||
stats->extra_data = extra_data;
|
stats->extra_data = extra_data;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -74,14 +74,14 @@ EOH_init_header(ExpandedObjectHeader *eohptr,
|
|||||||
Size
|
Size
|
||||||
EOH_get_flat_size(ExpandedObjectHeader *eohptr)
|
EOH_get_flat_size(ExpandedObjectHeader *eohptr)
|
||||||
{
|
{
|
||||||
return (*eohptr->eoh_methods->get_flat_size) (eohptr);
|
return eohptr->eoh_methods->get_flat_size(eohptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EOH_flatten_into(ExpandedObjectHeader *eohptr,
|
EOH_flatten_into(ExpandedObjectHeader *eohptr,
|
||||||
void *result, Size allocated_size)
|
void *result, Size allocated_size)
|
||||||
{
|
{
|
||||||
(*eohptr->eoh_methods->flatten_into) (eohptr, result, allocated_size);
|
eohptr->eoh_methods->flatten_into(eohptr, result, allocated_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4860,7 +4860,7 @@ iterate_string_values_scalar(void *state, char *token, JsonTokenType tokentype)
|
|||||||
IterateJsonStringValuesState *_state = (IterateJsonStringValuesState *) state;
|
IterateJsonStringValuesState *_state = (IterateJsonStringValuesState *) state;
|
||||||
|
|
||||||
if (tokentype == JSON_TOKEN_STRING)
|
if (tokentype == JSON_TOKEN_STRING)
|
||||||
(*_state->action) (_state->action_state, token, strlen(token));
|
_state->action(_state->action_state, token, strlen(token));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -5011,7 +5011,7 @@ transform_string_values_scalar(void *state, char *token, JsonTokenType tokentype
|
|||||||
|
|
||||||
if (tokentype == JSON_TOKEN_STRING)
|
if (tokentype == JSON_TOKEN_STRING)
|
||||||
{
|
{
|
||||||
text *out = (*_state->action) (_state->action_state, token, strlen(token));
|
text *out = _state->action(_state->action_state, token, strlen(token));
|
||||||
|
|
||||||
escape_json(_state->strval, text_to_cstring(out));
|
escape_json(_state->strval, text_to_cstring(out));
|
||||||
}
|
}
|
||||||
|
8
src/backend/utils/cache/inval.c
vendored
8
src/backend/utils/cache/inval.c
vendored
@ -590,7 +590,7 @@ LocalExecuteInvalidationMessage(SharedInvalidationMessage *msg)
|
|||||||
{
|
{
|
||||||
struct RELCACHECALLBACK *ccitem = relcache_callback_list + i;
|
struct RELCACHECALLBACK *ccitem = relcache_callback_list + i;
|
||||||
|
|
||||||
(*ccitem->function) (ccitem->arg, msg->rc.relId);
|
ccitem->function(ccitem->arg, msg->rc.relId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -650,14 +650,14 @@ InvalidateSystemCaches(void)
|
|||||||
{
|
{
|
||||||
struct SYSCACHECALLBACK *ccitem = syscache_callback_list + i;
|
struct SYSCACHECALLBACK *ccitem = syscache_callback_list + i;
|
||||||
|
|
||||||
(*ccitem->function) (ccitem->arg, ccitem->id, 0);
|
ccitem->function(ccitem->arg, ccitem->id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < relcache_callback_count; i++)
|
for (i = 0; i < relcache_callback_count; i++)
|
||||||
{
|
{
|
||||||
struct RELCACHECALLBACK *ccitem = relcache_callback_list + i;
|
struct RELCACHECALLBACK *ccitem = relcache_callback_list + i;
|
||||||
|
|
||||||
(*ccitem->function) (ccitem->arg, InvalidOid);
|
ccitem->function(ccitem->arg, InvalidOid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1460,7 +1460,7 @@ CallSyscacheCallbacks(int cacheid, uint32 hashvalue)
|
|||||||
struct SYSCACHECALLBACK *ccitem = syscache_callback_list + i;
|
struct SYSCACHECALLBACK *ccitem = syscache_callback_list + i;
|
||||||
|
|
||||||
Assert(ccitem->id == cacheid);
|
Assert(ccitem->id == cacheid);
|
||||||
(*ccitem->function) (ccitem->arg, cacheid, hashvalue);
|
ccitem->function(ccitem->arg, cacheid, hashvalue);
|
||||||
i = ccitem->link - 1;
|
i = ccitem->link - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -435,7 +435,7 @@ errfinish(int dummy,...)
|
|||||||
for (econtext = error_context_stack;
|
for (econtext = error_context_stack;
|
||||||
econtext != NULL;
|
econtext != NULL;
|
||||||
econtext = econtext->previous)
|
econtext = econtext->previous)
|
||||||
(*econtext->callback) (econtext->arg);
|
econtext->callback(econtext->arg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If ERROR (not more nor less) we pass it off to the current handler.
|
* If ERROR (not more nor less) we pass it off to the current handler.
|
||||||
@ -1837,7 +1837,7 @@ GetErrorContextStack(void)
|
|||||||
for (econtext = error_context_stack;
|
for (econtext = error_context_stack;
|
||||||
econtext != NULL;
|
econtext != NULL;
|
||||||
econtext = econtext->previous)
|
econtext = econtext->previous)
|
||||||
(*econtext->callback) (econtext->arg);
|
econtext->callback(econtext->arg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Clean ourselves off the stack, any allocations done should have been
|
* Clean ourselves off the stack, any allocations done should have been
|
||||||
|
@ -726,14 +726,14 @@ perform_default_encoding_conversion(const char *src, int len,
|
|||||||
int
|
int
|
||||||
pg_mb2wchar(const char *from, pg_wchar *to)
|
pg_mb2wchar(const char *from, pg_wchar *to)
|
||||||
{
|
{
|
||||||
return (*pg_wchar_table[DatabaseEncoding->encoding].mb2wchar_with_len) ((const unsigned char *) from, to, strlen(from));
|
return pg_wchar_table[DatabaseEncoding->encoding].mb2wchar_with_len((const unsigned char *) from, to, strlen(from));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert a multibyte string to a wchar with a limited length */
|
/* convert a multibyte string to a wchar with a limited length */
|
||||||
int
|
int
|
||||||
pg_mb2wchar_with_len(const char *from, pg_wchar *to, int len)
|
pg_mb2wchar_with_len(const char *from, pg_wchar *to, int len)
|
||||||
{
|
{
|
||||||
return (*pg_wchar_table[DatabaseEncoding->encoding].mb2wchar_with_len) ((const unsigned char *) from, to, len);
|
return pg_wchar_table[DatabaseEncoding->encoding].mb2wchar_with_len((const unsigned char *) from, to, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* same, with any encoding */
|
/* same, with any encoding */
|
||||||
@ -741,21 +741,21 @@ int
|
|||||||
pg_encoding_mb2wchar_with_len(int encoding,
|
pg_encoding_mb2wchar_with_len(int encoding,
|
||||||
const char *from, pg_wchar *to, int len)
|
const char *from, pg_wchar *to, int len)
|
||||||
{
|
{
|
||||||
return (*pg_wchar_table[encoding].mb2wchar_with_len) ((const unsigned char *) from, to, len);
|
return pg_wchar_table[encoding].mb2wchar_with_len((const unsigned char *) from, to, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert a wchar string to a multibyte */
|
/* convert a wchar string to a multibyte */
|
||||||
int
|
int
|
||||||
pg_wchar2mb(const pg_wchar *from, char *to)
|
pg_wchar2mb(const pg_wchar *from, char *to)
|
||||||
{
|
{
|
||||||
return (*pg_wchar_table[DatabaseEncoding->encoding].wchar2mb_with_len) (from, (unsigned char *) to, pg_wchar_strlen(from));
|
return pg_wchar_table[DatabaseEncoding->encoding].wchar2mb_with_len(from, (unsigned char *) to, pg_wchar_strlen(from));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* convert a wchar string to a multibyte with a limited length */
|
/* convert a wchar string to a multibyte with a limited length */
|
||||||
int
|
int
|
||||||
pg_wchar2mb_with_len(const pg_wchar *from, char *to, int len)
|
pg_wchar2mb_with_len(const pg_wchar *from, char *to, int len)
|
||||||
{
|
{
|
||||||
return (*pg_wchar_table[DatabaseEncoding->encoding].wchar2mb_with_len) (from, (unsigned char *) to, len);
|
return pg_wchar_table[DatabaseEncoding->encoding].wchar2mb_with_len(from, (unsigned char *) to, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* same, with any encoding */
|
/* same, with any encoding */
|
||||||
@ -763,21 +763,21 @@ int
|
|||||||
pg_encoding_wchar2mb_with_len(int encoding,
|
pg_encoding_wchar2mb_with_len(int encoding,
|
||||||
const pg_wchar *from, char *to, int len)
|
const pg_wchar *from, char *to, int len)
|
||||||
{
|
{
|
||||||
return (*pg_wchar_table[encoding].wchar2mb_with_len) (from, (unsigned char *) to, len);
|
return pg_wchar_table[encoding].wchar2mb_with_len(from, (unsigned char *) to, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the byte length of a multibyte character */
|
/* returns the byte length of a multibyte character */
|
||||||
int
|
int
|
||||||
pg_mblen(const char *mbstr)
|
pg_mblen(const char *mbstr)
|
||||||
{
|
{
|
||||||
return ((*pg_wchar_table[DatabaseEncoding->encoding].mblen) ((const unsigned char *) mbstr));
|
return pg_wchar_table[DatabaseEncoding->encoding].mblen((const unsigned char *) mbstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the display length of a multibyte character */
|
/* returns the display length of a multibyte character */
|
||||||
int
|
int
|
||||||
pg_dsplen(const char *mbstr)
|
pg_dsplen(const char *mbstr)
|
||||||
{
|
{
|
||||||
return ((*pg_wchar_table[DatabaseEncoding->encoding].dsplen) ((const unsigned char *) mbstr));
|
return pg_wchar_table[DatabaseEncoding->encoding].dsplen((const unsigned char *) mbstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the length (counted in wchars) of a multibyte string */
|
/* returns the length (counted in wchars) of a multibyte string */
|
||||||
|
@ -1785,8 +1785,8 @@ int
|
|||||||
pg_encoding_mblen(int encoding, const char *mbstr)
|
pg_encoding_mblen(int encoding, const char *mbstr)
|
||||||
{
|
{
|
||||||
return (PG_VALID_ENCODING(encoding) ?
|
return (PG_VALID_ENCODING(encoding) ?
|
||||||
((*pg_wchar_table[encoding].mblen) ((const unsigned char *) mbstr)) :
|
pg_wchar_table[encoding].mblen((const unsigned char *) mbstr) :
|
||||||
((*pg_wchar_table[PG_SQL_ASCII].mblen) ((const unsigned char *) mbstr)));
|
pg_wchar_table[PG_SQL_ASCII].mblen((const unsigned char *) mbstr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1796,8 +1796,8 @@ int
|
|||||||
pg_encoding_dsplen(int encoding, const char *mbstr)
|
pg_encoding_dsplen(int encoding, const char *mbstr)
|
||||||
{
|
{
|
||||||
return (PG_VALID_ENCODING(encoding) ?
|
return (PG_VALID_ENCODING(encoding) ?
|
||||||
((*pg_wchar_table[encoding].dsplen) ((const unsigned char *) mbstr)) :
|
pg_wchar_table[encoding].dsplen((const unsigned char *) mbstr) :
|
||||||
((*pg_wchar_table[PG_SQL_ASCII].dsplen) ((const unsigned char *) mbstr)));
|
pg_wchar_table[PG_SQL_ASCII].dsplen((const unsigned char *) mbstr));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1809,8 +1809,8 @@ int
|
|||||||
pg_encoding_verifymb(int encoding, const char *mbstr, int len)
|
pg_encoding_verifymb(int encoding, const char *mbstr, int len)
|
||||||
{
|
{
|
||||||
return (PG_VALID_ENCODING(encoding) ?
|
return (PG_VALID_ENCODING(encoding) ?
|
||||||
((*pg_wchar_table[encoding].mbverify) ((const unsigned char *) mbstr, len)) :
|
pg_wchar_table[encoding].mbverify((const unsigned char *) mbstr, len) :
|
||||||
((*pg_wchar_table[PG_SQL_ASCII].mbverify) ((const unsigned char *) mbstr, len)));
|
pg_wchar_table[PG_SQL_ASCII].mbverify((const unsigned char *) mbstr, len));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -4602,7 +4602,7 @@ InitializeOneGUCOption(struct config_generic *gconf)
|
|||||||
elog(FATAL, "failed to initialize %s to %d",
|
elog(FATAL, "failed to initialize %s to %d",
|
||||||
conf->gen.name, (int) newval);
|
conf->gen.name, (int) newval);
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, extra);
|
conf->assign_hook(newval, extra);
|
||||||
*conf->variable = conf->reset_val = newval;
|
*conf->variable = conf->reset_val = newval;
|
||||||
conf->gen.extra = conf->reset_extra = extra;
|
conf->gen.extra = conf->reset_extra = extra;
|
||||||
break;
|
break;
|
||||||
@ -4620,7 +4620,7 @@ InitializeOneGUCOption(struct config_generic *gconf)
|
|||||||
elog(FATAL, "failed to initialize %s to %d",
|
elog(FATAL, "failed to initialize %s to %d",
|
||||||
conf->gen.name, newval);
|
conf->gen.name, newval);
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, extra);
|
conf->assign_hook(newval, extra);
|
||||||
*conf->variable = conf->reset_val = newval;
|
*conf->variable = conf->reset_val = newval;
|
||||||
conf->gen.extra = conf->reset_extra = extra;
|
conf->gen.extra = conf->reset_extra = extra;
|
||||||
break;
|
break;
|
||||||
@ -4638,7 +4638,7 @@ InitializeOneGUCOption(struct config_generic *gconf)
|
|||||||
elog(FATAL, "failed to initialize %s to %g",
|
elog(FATAL, "failed to initialize %s to %g",
|
||||||
conf->gen.name, newval);
|
conf->gen.name, newval);
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, extra);
|
conf->assign_hook(newval, extra);
|
||||||
*conf->variable = conf->reset_val = newval;
|
*conf->variable = conf->reset_val = newval;
|
||||||
conf->gen.extra = conf->reset_extra = extra;
|
conf->gen.extra = conf->reset_extra = extra;
|
||||||
break;
|
break;
|
||||||
@ -4660,7 +4660,7 @@ InitializeOneGUCOption(struct config_generic *gconf)
|
|||||||
elog(FATAL, "failed to initialize %s to \"%s\"",
|
elog(FATAL, "failed to initialize %s to \"%s\"",
|
||||||
conf->gen.name, newval ? newval : "");
|
conf->gen.name, newval ? newval : "");
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, extra);
|
conf->assign_hook(newval, extra);
|
||||||
*conf->variable = conf->reset_val = newval;
|
*conf->variable = conf->reset_val = newval;
|
||||||
conf->gen.extra = conf->reset_extra = extra;
|
conf->gen.extra = conf->reset_extra = extra;
|
||||||
break;
|
break;
|
||||||
@ -4676,7 +4676,7 @@ InitializeOneGUCOption(struct config_generic *gconf)
|
|||||||
elog(FATAL, "failed to initialize %s to %d",
|
elog(FATAL, "failed to initialize %s to %d",
|
||||||
conf->gen.name, newval);
|
conf->gen.name, newval);
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, extra);
|
conf->assign_hook(newval, extra);
|
||||||
*conf->variable = conf->reset_val = newval;
|
*conf->variable = conf->reset_val = newval;
|
||||||
conf->gen.extra = conf->reset_extra = extra;
|
conf->gen.extra = conf->reset_extra = extra;
|
||||||
break;
|
break;
|
||||||
@ -4901,7 +4901,7 @@ ResetAllOptions(void)
|
|||||||
struct config_bool *conf = (struct config_bool *) gconf;
|
struct config_bool *conf = (struct config_bool *) gconf;
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (conf->reset_val,
|
conf->assign_hook(conf->reset_val,
|
||||||
conf->reset_extra);
|
conf->reset_extra);
|
||||||
*conf->variable = conf->reset_val;
|
*conf->variable = conf->reset_val;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
@ -4913,7 +4913,7 @@ ResetAllOptions(void)
|
|||||||
struct config_int *conf = (struct config_int *) gconf;
|
struct config_int *conf = (struct config_int *) gconf;
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (conf->reset_val,
|
conf->assign_hook(conf->reset_val,
|
||||||
conf->reset_extra);
|
conf->reset_extra);
|
||||||
*conf->variable = conf->reset_val;
|
*conf->variable = conf->reset_val;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
@ -4925,7 +4925,7 @@ ResetAllOptions(void)
|
|||||||
struct config_real *conf = (struct config_real *) gconf;
|
struct config_real *conf = (struct config_real *) gconf;
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (conf->reset_val,
|
conf->assign_hook(conf->reset_val,
|
||||||
conf->reset_extra);
|
conf->reset_extra);
|
||||||
*conf->variable = conf->reset_val;
|
*conf->variable = conf->reset_val;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
@ -4937,7 +4937,7 @@ ResetAllOptions(void)
|
|||||||
struct config_string *conf = (struct config_string *) gconf;
|
struct config_string *conf = (struct config_string *) gconf;
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (conf->reset_val,
|
conf->assign_hook(conf->reset_val,
|
||||||
conf->reset_extra);
|
conf->reset_extra);
|
||||||
set_string_field(conf, conf->variable, conf->reset_val);
|
set_string_field(conf, conf->variable, conf->reset_val);
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
@ -4949,7 +4949,7 @@ ResetAllOptions(void)
|
|||||||
struct config_enum *conf = (struct config_enum *) gconf;
|
struct config_enum *conf = (struct config_enum *) gconf;
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (conf->reset_val,
|
conf->assign_hook(conf->reset_val,
|
||||||
conf->reset_extra);
|
conf->reset_extra);
|
||||||
*conf->variable = conf->reset_val;
|
*conf->variable = conf->reset_val;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
@ -5240,7 +5240,7 @@ AtEOXact_GUC(bool isCommit, int nestLevel)
|
|||||||
conf->gen.extra != newextra)
|
conf->gen.extra != newextra)
|
||||||
{
|
{
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -5258,7 +5258,7 @@ AtEOXact_GUC(bool isCommit, int nestLevel)
|
|||||||
conf->gen.extra != newextra)
|
conf->gen.extra != newextra)
|
||||||
{
|
{
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -5276,7 +5276,7 @@ AtEOXact_GUC(bool isCommit, int nestLevel)
|
|||||||
conf->gen.extra != newextra)
|
conf->gen.extra != newextra)
|
||||||
{
|
{
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -5294,7 +5294,7 @@ AtEOXact_GUC(bool isCommit, int nestLevel)
|
|||||||
conf->gen.extra != newextra)
|
conf->gen.extra != newextra)
|
||||||
{
|
{
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
set_string_field(conf, conf->variable, newval);
|
set_string_field(conf, conf->variable, newval);
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -5321,7 +5321,7 @@ AtEOXact_GUC(bool isCommit, int nestLevel)
|
|||||||
conf->gen.extra != newextra)
|
conf->gen.extra != newextra)
|
||||||
{
|
{
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -6211,7 +6211,7 @@ set_config_option(const char *name, const char *value,
|
|||||||
push_old_value(&conf->gen, action);
|
push_old_value(&conf->gen, action);
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -6301,7 +6301,7 @@ set_config_option(const char *name, const char *value,
|
|||||||
push_old_value(&conf->gen, action);
|
push_old_value(&conf->gen, action);
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -6391,7 +6391,7 @@ set_config_option(const char *name, const char *value,
|
|||||||
push_old_value(&conf->gen, action);
|
push_old_value(&conf->gen, action);
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -6499,7 +6499,7 @@ set_config_option(const char *name, const char *value,
|
|||||||
push_old_value(&conf->gen, action);
|
push_old_value(&conf->gen, action);
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
set_string_field(conf, conf->variable, newval);
|
set_string_field(conf, conf->variable, newval);
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -6594,7 +6594,7 @@ set_config_option(const char *name, const char *value,
|
|||||||
push_old_value(&conf->gen, action);
|
push_old_value(&conf->gen, action);
|
||||||
|
|
||||||
if (conf->assign_hook)
|
if (conf->assign_hook)
|
||||||
(*conf->assign_hook) (newval, newextra);
|
conf->assign_hook(newval, newextra);
|
||||||
*conf->variable = newval;
|
*conf->variable = newval;
|
||||||
set_extra_field(&conf->gen, &conf->gen.extra,
|
set_extra_field(&conf->gen, &conf->gen.extra,
|
||||||
newextra);
|
newextra);
|
||||||
@ -8653,7 +8653,7 @@ _ShowOption(struct config_generic *record, bool use_units)
|
|||||||
struct config_bool *conf = (struct config_bool *) record;
|
struct config_bool *conf = (struct config_bool *) record;
|
||||||
|
|
||||||
if (conf->show_hook)
|
if (conf->show_hook)
|
||||||
val = (*conf->show_hook) ();
|
val = conf->show_hook();
|
||||||
else
|
else
|
||||||
val = *conf->variable ? "on" : "off";
|
val = *conf->variable ? "on" : "off";
|
||||||
}
|
}
|
||||||
@ -8664,7 +8664,7 @@ _ShowOption(struct config_generic *record, bool use_units)
|
|||||||
struct config_int *conf = (struct config_int *) record;
|
struct config_int *conf = (struct config_int *) record;
|
||||||
|
|
||||||
if (conf->show_hook)
|
if (conf->show_hook)
|
||||||
val = (*conf->show_hook) ();
|
val = conf->show_hook();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@ -8694,7 +8694,7 @@ _ShowOption(struct config_generic *record, bool use_units)
|
|||||||
struct config_real *conf = (struct config_real *) record;
|
struct config_real *conf = (struct config_real *) record;
|
||||||
|
|
||||||
if (conf->show_hook)
|
if (conf->show_hook)
|
||||||
val = (*conf->show_hook) ();
|
val = conf->show_hook();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
snprintf(buffer, sizeof(buffer), "%g",
|
snprintf(buffer, sizeof(buffer), "%g",
|
||||||
@ -8709,7 +8709,7 @@ _ShowOption(struct config_generic *record, bool use_units)
|
|||||||
struct config_string *conf = (struct config_string *) record;
|
struct config_string *conf = (struct config_string *) record;
|
||||||
|
|
||||||
if (conf->show_hook)
|
if (conf->show_hook)
|
||||||
val = (*conf->show_hook) ();
|
val = conf->show_hook();
|
||||||
else if (*conf->variable && **conf->variable)
|
else if (*conf->variable && **conf->variable)
|
||||||
val = *conf->variable;
|
val = *conf->variable;
|
||||||
else
|
else
|
||||||
@ -8722,7 +8722,7 @@ _ShowOption(struct config_generic *record, bool use_units)
|
|||||||
struct config_enum *conf = (struct config_enum *) record;
|
struct config_enum *conf = (struct config_enum *) record;
|
||||||
|
|
||||||
if (conf->show_hook)
|
if (conf->show_hook)
|
||||||
val = (*conf->show_hook) ();
|
val = conf->show_hook();
|
||||||
else
|
else
|
||||||
val = config_enum_lookup_by_value(conf, *conf->variable);
|
val = config_enum_lookup_by_value(conf, *conf->variable);
|
||||||
}
|
}
|
||||||
@ -9807,7 +9807,7 @@ call_bool_check_hook(struct config_bool *conf, bool *newval, void **extra,
|
|||||||
GUC_check_errdetail_string = NULL;
|
GUC_check_errdetail_string = NULL;
|
||||||
GUC_check_errhint_string = NULL;
|
GUC_check_errhint_string = NULL;
|
||||||
|
|
||||||
if (!(*conf->check_hook) (newval, extra, source))
|
if (!conf->check_hook(newval, extra, source))
|
||||||
{
|
{
|
||||||
ereport(elevel,
|
ereport(elevel,
|
||||||
(errcode(GUC_check_errcode_value),
|
(errcode(GUC_check_errcode_value),
|
||||||
@ -9841,7 +9841,7 @@ call_int_check_hook(struct config_int *conf, int *newval, void **extra,
|
|||||||
GUC_check_errdetail_string = NULL;
|
GUC_check_errdetail_string = NULL;
|
||||||
GUC_check_errhint_string = NULL;
|
GUC_check_errhint_string = NULL;
|
||||||
|
|
||||||
if (!(*conf->check_hook) (newval, extra, source))
|
if (!conf->check_hook(newval, extra, source))
|
||||||
{
|
{
|
||||||
ereport(elevel,
|
ereport(elevel,
|
||||||
(errcode(GUC_check_errcode_value),
|
(errcode(GUC_check_errcode_value),
|
||||||
@ -9875,7 +9875,7 @@ call_real_check_hook(struct config_real *conf, double *newval, void **extra,
|
|||||||
GUC_check_errdetail_string = NULL;
|
GUC_check_errdetail_string = NULL;
|
||||||
GUC_check_errhint_string = NULL;
|
GUC_check_errhint_string = NULL;
|
||||||
|
|
||||||
if (!(*conf->check_hook) (newval, extra, source))
|
if (!conf->check_hook(newval, extra, source))
|
||||||
{
|
{
|
||||||
ereport(elevel,
|
ereport(elevel,
|
||||||
(errcode(GUC_check_errcode_value),
|
(errcode(GUC_check_errcode_value),
|
||||||
@ -9909,7 +9909,7 @@ call_string_check_hook(struct config_string *conf, char **newval, void **extra,
|
|||||||
GUC_check_errdetail_string = NULL;
|
GUC_check_errdetail_string = NULL;
|
||||||
GUC_check_errhint_string = NULL;
|
GUC_check_errhint_string = NULL;
|
||||||
|
|
||||||
if (!(*conf->check_hook) (newval, extra, source))
|
if (!conf->check_hook(newval, extra, source))
|
||||||
{
|
{
|
||||||
ereport(elevel,
|
ereport(elevel,
|
||||||
(errcode(GUC_check_errcode_value),
|
(errcode(GUC_check_errcode_value),
|
||||||
@ -9943,7 +9943,7 @@ call_enum_check_hook(struct config_enum *conf, int *newval, void **extra,
|
|||||||
GUC_check_errdetail_string = NULL;
|
GUC_check_errdetail_string = NULL;
|
||||||
GUC_check_errhint_string = NULL;
|
GUC_check_errhint_string = NULL;
|
||||||
|
|
||||||
if (!(*conf->check_hook) (newval, extra, source))
|
if (!conf->check_hook(newval, extra, source))
|
||||||
{
|
{
|
||||||
ereport(elevel,
|
ereport(elevel,
|
||||||
(errcode(GUC_check_errcode_value),
|
(errcode(GUC_check_errcode_value),
|
||||||
|
@ -302,7 +302,7 @@ handle_sig_alarm(SIGNAL_ARGS)
|
|||||||
this_timeout->indicator = true;
|
this_timeout->indicator = true;
|
||||||
|
|
||||||
/* And call its handler function */
|
/* And call its handler function */
|
||||||
(*this_timeout->timeout_handler) ();
|
this_timeout->timeout_handler();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The handler might not take negligible time (CheckDeadLock
|
* The handler might not take negligible time (CheckDeadLock
|
||||||
|
@ -402,7 +402,7 @@ GetMemoryChunkContext())
|
|||||||
|
|
||||||
and then invoke the corresponding method for the context
|
and then invoke the corresponding method for the context
|
||||||
|
|
||||||
(*context->methods->free_p) (p);
|
context->methods->free_p(p);
|
||||||
|
|
||||||
|
|
||||||
More Control Over aset.c Behavior
|
More Control Over aset.c Behavior
|
||||||
|
@ -159,7 +159,7 @@ MemoryContextResetOnly(MemoryContext context)
|
|||||||
if (!context->isReset)
|
if (!context->isReset)
|
||||||
{
|
{
|
||||||
MemoryContextCallResetCallbacks(context);
|
MemoryContextCallResetCallbacks(context);
|
||||||
(*context->methods->reset) (context);
|
context->methods->reset(context);
|
||||||
context->isReset = true;
|
context->isReset = true;
|
||||||
VALGRIND_DESTROY_MEMPOOL(context);
|
VALGRIND_DESTROY_MEMPOOL(context);
|
||||||
VALGRIND_CREATE_MEMPOOL(context, 0, false);
|
VALGRIND_CREATE_MEMPOOL(context, 0, false);
|
||||||
@ -222,7 +222,7 @@ MemoryContextDelete(MemoryContext context)
|
|||||||
*/
|
*/
|
||||||
MemoryContextSetParent(context, NULL);
|
MemoryContextSetParent(context, NULL);
|
||||||
|
|
||||||
(*context->methods->delete_context) (context);
|
context->methods->delete_context(context);
|
||||||
VALGRIND_DESTROY_MEMPOOL(context);
|
VALGRIND_DESTROY_MEMPOOL(context);
|
||||||
pfree(context);
|
pfree(context);
|
||||||
}
|
}
|
||||||
@ -291,7 +291,7 @@ MemoryContextCallResetCallbacks(MemoryContext context)
|
|||||||
while ((cb = context->reset_cbs) != NULL)
|
while ((cb = context->reset_cbs) != NULL)
|
||||||
{
|
{
|
||||||
context->reset_cbs = cb->next;
|
context->reset_cbs = cb->next;
|
||||||
(*cb->func) (cb->arg);
|
cb->func(cb->arg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -391,8 +391,7 @@ GetMemoryChunkSpace(void *pointer)
|
|||||||
{
|
{
|
||||||
MemoryContext context = GetMemoryChunkContext(pointer);
|
MemoryContext context = GetMemoryChunkContext(pointer);
|
||||||
|
|
||||||
return (context->methods->get_chunk_space) (context,
|
return context->methods->get_chunk_space(context, pointer);
|
||||||
pointer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -423,7 +422,7 @@ MemoryContextIsEmpty(MemoryContext context)
|
|||||||
if (context->firstchild != NULL)
|
if (context->firstchild != NULL)
|
||||||
return false;
|
return false;
|
||||||
/* Otherwise use the type-specific inquiry */
|
/* Otherwise use the type-specific inquiry */
|
||||||
return (*context->methods->is_empty) (context);
|
return context->methods->is_empty(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -481,7 +480,7 @@ MemoryContextStatsInternal(MemoryContext context, int level,
|
|||||||
AssertArg(MemoryContextIsValid(context));
|
AssertArg(MemoryContextIsValid(context));
|
||||||
|
|
||||||
/* Examine the context itself */
|
/* Examine the context itself */
|
||||||
(*context->methods->stats) (context, level, print, totals);
|
context->methods->stats(context, level, print, totals);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Examine children. If there are more than max_children of them, we do
|
* Examine children. If there are more than max_children of them, we do
|
||||||
@ -546,7 +545,7 @@ MemoryContextCheck(MemoryContext context)
|
|||||||
|
|
||||||
AssertArg(MemoryContextIsValid(context));
|
AssertArg(MemoryContextIsValid(context));
|
||||||
|
|
||||||
(*context->methods->check) (context);
|
context->methods->check(context);
|
||||||
for (child = context->firstchild; child != NULL; child = child->nextchild)
|
for (child = context->firstchild; child != NULL; child = child->nextchild)
|
||||||
MemoryContextCheck(child);
|
MemoryContextCheck(child);
|
||||||
}
|
}
|
||||||
@ -675,7 +674,7 @@ MemoryContextCreate(NodeTag tag, Size size,
|
|||||||
strcpy(node->name, name);
|
strcpy(node->name, name);
|
||||||
|
|
||||||
/* Type-specific routine finishes any other essential initialization */
|
/* Type-specific routine finishes any other essential initialization */
|
||||||
(*node->methods->init) (node);
|
node->methods->init(node);
|
||||||
|
|
||||||
/* OK to link node to parent (if any) */
|
/* OK to link node to parent (if any) */
|
||||||
/* Could use MemoryContextSetParent here, but doesn't seem worthwhile */
|
/* Could use MemoryContextSetParent here, but doesn't seem worthwhile */
|
||||||
@ -716,7 +715,7 @@ MemoryContextAlloc(MemoryContext context, Size size)
|
|||||||
|
|
||||||
context->isReset = false;
|
context->isReset = false;
|
||||||
|
|
||||||
ret = (*context->methods->alloc) (context, size);
|
ret = context->methods->alloc(context, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -751,7 +750,7 @@ MemoryContextAllocZero(MemoryContext context, Size size)
|
|||||||
|
|
||||||
context->isReset = false;
|
context->isReset = false;
|
||||||
|
|
||||||
ret = (*context->methods->alloc) (context, size);
|
ret = context->methods->alloc(context, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -788,7 +787,7 @@ MemoryContextAllocZeroAligned(MemoryContext context, Size size)
|
|||||||
|
|
||||||
context->isReset = false;
|
context->isReset = false;
|
||||||
|
|
||||||
ret = (*context->methods->alloc) (context, size);
|
ret = context->methods->alloc(context, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -823,7 +822,7 @@ MemoryContextAllocExtended(MemoryContext context, Size size, int flags)
|
|||||||
|
|
||||||
context->isReset = false;
|
context->isReset = false;
|
||||||
|
|
||||||
ret = (*context->methods->alloc) (context, size);
|
ret = context->methods->alloc(context, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
if ((flags & MCXT_ALLOC_NO_OOM) == 0)
|
if ((flags & MCXT_ALLOC_NO_OOM) == 0)
|
||||||
@ -859,7 +858,7 @@ palloc(Size size)
|
|||||||
|
|
||||||
CurrentMemoryContext->isReset = false;
|
CurrentMemoryContext->isReset = false;
|
||||||
|
|
||||||
ret = (*CurrentMemoryContext->methods->alloc) (CurrentMemoryContext, size);
|
ret = CurrentMemoryContext->methods->alloc(CurrentMemoryContext, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -888,7 +887,7 @@ palloc0(Size size)
|
|||||||
|
|
||||||
CurrentMemoryContext->isReset = false;
|
CurrentMemoryContext->isReset = false;
|
||||||
|
|
||||||
ret = (*CurrentMemoryContext->methods->alloc) (CurrentMemoryContext, size);
|
ret = CurrentMemoryContext->methods->alloc(CurrentMemoryContext, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -920,7 +919,7 @@ palloc_extended(Size size, int flags)
|
|||||||
|
|
||||||
CurrentMemoryContext->isReset = false;
|
CurrentMemoryContext->isReset = false;
|
||||||
|
|
||||||
ret = (*CurrentMemoryContext->methods->alloc) (CurrentMemoryContext, size);
|
ret = CurrentMemoryContext->methods->alloc(CurrentMemoryContext, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
if ((flags & MCXT_ALLOC_NO_OOM) == 0)
|
if ((flags & MCXT_ALLOC_NO_OOM) == 0)
|
||||||
@ -951,7 +950,7 @@ pfree(void *pointer)
|
|||||||
{
|
{
|
||||||
MemoryContext context = GetMemoryChunkContext(pointer);
|
MemoryContext context = GetMemoryChunkContext(pointer);
|
||||||
|
|
||||||
(*context->methods->free_p) (context, pointer);
|
context->methods->free_p(context, pointer);
|
||||||
VALGRIND_MEMPOOL_FREE(context, pointer);
|
VALGRIND_MEMPOOL_FREE(context, pointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -973,7 +972,7 @@ repalloc(void *pointer, Size size)
|
|||||||
/* isReset must be false already */
|
/* isReset must be false already */
|
||||||
Assert(!context->isReset);
|
Assert(!context->isReset);
|
||||||
|
|
||||||
ret = (*context->methods->realloc) (context, pointer, size);
|
ret = context->methods->realloc(context, pointer, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -1007,7 +1006,7 @@ MemoryContextAllocHuge(MemoryContext context, Size size)
|
|||||||
|
|
||||||
context->isReset = false;
|
context->isReset = false;
|
||||||
|
|
||||||
ret = (*context->methods->alloc) (context, size);
|
ret = context->methods->alloc(context, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
@ -1041,7 +1040,7 @@ repalloc_huge(void *pointer, Size size)
|
|||||||
/* isReset must be false already */
|
/* isReset must be false already */
|
||||||
Assert(!context->isReset);
|
Assert(!context->isReset);
|
||||||
|
|
||||||
ret = (*context->methods->realloc) (context, pointer, size);
|
ret = context->methods->realloc(context, pointer, size);
|
||||||
if (ret == NULL)
|
if (ret == NULL)
|
||||||
{
|
{
|
||||||
MemoryContextStats(TopMemoryContext);
|
MemoryContextStats(TopMemoryContext);
|
||||||
|
@ -420,7 +420,7 @@ MarkPortalDone(Portal portal)
|
|||||||
*/
|
*/
|
||||||
if (PointerIsValid(portal->cleanup))
|
if (PointerIsValid(portal->cleanup))
|
||||||
{
|
{
|
||||||
(*portal->cleanup) (portal);
|
portal->cleanup(portal);
|
||||||
portal->cleanup = NULL;
|
portal->cleanup = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -448,7 +448,7 @@ MarkPortalFailed(Portal portal)
|
|||||||
*/
|
*/
|
||||||
if (PointerIsValid(portal->cleanup))
|
if (PointerIsValid(portal->cleanup))
|
||||||
{
|
{
|
||||||
(*portal->cleanup) (portal);
|
portal->cleanup(portal);
|
||||||
portal->cleanup = NULL;
|
portal->cleanup = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -486,7 +486,7 @@ PortalDrop(Portal portal, bool isTopCommit)
|
|||||||
*/
|
*/
|
||||||
if (PointerIsValid(portal->cleanup))
|
if (PointerIsValid(portal->cleanup))
|
||||||
{
|
{
|
||||||
(*portal->cleanup) (portal);
|
portal->cleanup(portal);
|
||||||
portal->cleanup = NULL;
|
portal->cleanup = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -786,7 +786,7 @@ AtAbort_Portals(void)
|
|||||||
*/
|
*/
|
||||||
if (PointerIsValid(portal->cleanup))
|
if (PointerIsValid(portal->cleanup))
|
||||||
{
|
{
|
||||||
(*portal->cleanup) (portal);
|
portal->cleanup(portal);
|
||||||
portal->cleanup = NULL;
|
portal->cleanup = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -980,7 +980,7 @@ AtSubAbort_Portals(SubTransactionId mySubid,
|
|||||||
*/
|
*/
|
||||||
if (PointerIsValid(portal->cleanup))
|
if (PointerIsValid(portal->cleanup))
|
||||||
{
|
{
|
||||||
(*portal->cleanup) (portal);
|
portal->cleanup(portal);
|
||||||
portal->cleanup = NULL;
|
portal->cleanup = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -672,7 +672,7 @@ ResourceOwnerReleaseInternal(ResourceOwner owner,
|
|||||||
|
|
||||||
/* Let add-on modules get a chance too */
|
/* Let add-on modules get a chance too */
|
||||||
for (item = ResourceRelease_callbacks; item; item = item->next)
|
for (item = ResourceRelease_callbacks; item; item = item->next)
|
||||||
(*item->callback) (phase, isCommit, isTopLevel, item->arg);
|
item->callback(phase, isCommit, isTopLevel, item->arg);
|
||||||
|
|
||||||
CurrentResourceOwner = save;
|
CurrentResourceOwner = save;
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ setupRestoreWorker(Archive *AHX)
|
|||||||
{
|
{
|
||||||
ArchiveHandle *AH = (ArchiveHandle *) AHX;
|
ArchiveHandle *AH = (ArchiveHandle *) AHX;
|
||||||
|
|
||||||
(AH->ReopenPtr) (AH);
|
AH->ReopenPtr(AH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ CloseArchive(Archive *AHX)
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
ArchiveHandle *AH = (ArchiveHandle *) AHX;
|
ArchiveHandle *AH = (ArchiveHandle *) AHX;
|
||||||
|
|
||||||
(*AH->ClosePtr) (AH);
|
AH->ClosePtr(AH);
|
||||||
|
|
||||||
/* Close the output */
|
/* Close the output */
|
||||||
if (AH->gzOut)
|
if (AH->gzOut)
|
||||||
@ -359,7 +359,7 @@ RestoreArchive(Archive *AHX)
|
|||||||
* It's also not gonna work if we can't reopen the input file, so
|
* It's also not gonna work if we can't reopen the input file, so
|
||||||
* let's try that immediately.
|
* let's try that immediately.
|
||||||
*/
|
*/
|
||||||
(AH->ReopenPtr) (AH);
|
AH->ReopenPtr(AH);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -865,7 +865,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, bool is_parallel)
|
|||||||
if (strcmp(te->desc, "BLOB COMMENTS") == 0)
|
if (strcmp(te->desc, "BLOB COMMENTS") == 0)
|
||||||
AH->outputKind = OUTPUT_OTHERDATA;
|
AH->outputKind = OUTPUT_OTHERDATA;
|
||||||
|
|
||||||
(*AH->PrintTocDataPtr) (AH, te);
|
AH->PrintTocDataPtr(AH, te);
|
||||||
|
|
||||||
AH->outputKind = OUTPUT_SQLCMDS;
|
AH->outputKind = OUTPUT_SQLCMDS;
|
||||||
}
|
}
|
||||||
@ -918,7 +918,7 @@ restore_toc_entry(ArchiveHandle *AH, TocEntry *te, bool is_parallel)
|
|||||||
else
|
else
|
||||||
AH->outputKind = OUTPUT_OTHERDATA;
|
AH->outputKind = OUTPUT_OTHERDATA;
|
||||||
|
|
||||||
(*AH->PrintTocDataPtr) (AH, te);
|
AH->PrintTocDataPtr(AH, te);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Terminate COPY if needed.
|
* Terminate COPY if needed.
|
||||||
@ -1038,7 +1038,7 @@ WriteData(Archive *AHX, const void *data, size_t dLen)
|
|||||||
if (!AH->currToc)
|
if (!AH->currToc)
|
||||||
exit_horribly(modulename, "internal error -- WriteData cannot be called outside the context of a DataDumper routine\n");
|
exit_horribly(modulename, "internal error -- WriteData cannot be called outside the context of a DataDumper routine\n");
|
||||||
|
|
||||||
(*AH->WriteDataPtr) (AH, data, dLen);
|
AH->WriteDataPtr(AH, data, dLen);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1109,7 +1109,7 @@ ArchiveEntry(Archive *AHX,
|
|||||||
newToc->formatData = NULL;
|
newToc->formatData = NULL;
|
||||||
|
|
||||||
if (AH->ArchiveEntryPtr != NULL)
|
if (AH->ArchiveEntryPtr != NULL)
|
||||||
(*AH->ArchiveEntryPtr) (AH, newToc);
|
AH->ArchiveEntryPtr(AH, newToc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Public */
|
/* Public */
|
||||||
@ -1236,7 +1236,7 @@ StartBlob(Archive *AHX, Oid oid)
|
|||||||
if (!AH->StartBlobPtr)
|
if (!AH->StartBlobPtr)
|
||||||
exit_horribly(modulename, "large-object output not supported in chosen format\n");
|
exit_horribly(modulename, "large-object output not supported in chosen format\n");
|
||||||
|
|
||||||
(*AH->StartBlobPtr) (AH, AH->currToc, oid);
|
AH->StartBlobPtr(AH, AH->currToc, oid);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1248,7 +1248,7 @@ EndBlob(Archive *AHX, Oid oid)
|
|||||||
ArchiveHandle *AH = (ArchiveHandle *) AHX;
|
ArchiveHandle *AH = (ArchiveHandle *) AHX;
|
||||||
|
|
||||||
if (AH->EndBlobPtr)
|
if (AH->EndBlobPtr)
|
||||||
(*AH->EndBlobPtr) (AH, AH->currToc, oid);
|
AH->EndBlobPtr(AH, AH->currToc, oid);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -1920,12 +1920,12 @@ WriteOffset(ArchiveHandle *AH, pgoff_t o, int wasSet)
|
|||||||
int off;
|
int off;
|
||||||
|
|
||||||
/* Save the flag */
|
/* Save the flag */
|
||||||
(*AH->WriteBytePtr) (AH, wasSet);
|
AH->WriteBytePtr(AH, wasSet);
|
||||||
|
|
||||||
/* Write out pgoff_t smallest byte first, prevents endian mismatch */
|
/* Write out pgoff_t smallest byte first, prevents endian mismatch */
|
||||||
for (off = 0; off < sizeof(pgoff_t); off++)
|
for (off = 0; off < sizeof(pgoff_t); off++)
|
||||||
{
|
{
|
||||||
(*AH->WriteBytePtr) (AH, o & 0xFF);
|
AH->WriteBytePtr(AH, o & 0xFF);
|
||||||
o >>= 8;
|
o >>= 8;
|
||||||
}
|
}
|
||||||
return sizeof(pgoff_t) + 1;
|
return sizeof(pgoff_t) + 1;
|
||||||
@ -1964,7 +1964,7 @@ ReadOffset(ArchiveHandle *AH, pgoff_t * o)
|
|||||||
* This used to be handled by a negative or zero pointer, now we use an
|
* This used to be handled by a negative or zero pointer, now we use an
|
||||||
* extra byte specifically for the state.
|
* extra byte specifically for the state.
|
||||||
*/
|
*/
|
||||||
offsetFlg = (*AH->ReadBytePtr) (AH) & 0xFF;
|
offsetFlg = AH->ReadBytePtr(AH) & 0xFF;
|
||||||
|
|
||||||
switch (offsetFlg)
|
switch (offsetFlg)
|
||||||
{
|
{
|
||||||
@ -1984,10 +1984,10 @@ ReadOffset(ArchiveHandle *AH, pgoff_t * o)
|
|||||||
for (off = 0; off < AH->offSize; off++)
|
for (off = 0; off < AH->offSize; off++)
|
||||||
{
|
{
|
||||||
if (off < sizeof(pgoff_t))
|
if (off < sizeof(pgoff_t))
|
||||||
*o |= ((pgoff_t) ((*AH->ReadBytePtr) (AH))) << (off * 8);
|
*o |= ((pgoff_t) (AH->ReadBytePtr(AH))) << (off * 8);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((*AH->ReadBytePtr) (AH) != 0)
|
if (AH->ReadBytePtr(AH) != 0)
|
||||||
exit_horribly(modulename, "file offset in dump file is too large\n");
|
exit_horribly(modulename, "file offset in dump file is too large\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2011,15 +2011,15 @@ WriteInt(ArchiveHandle *AH, int i)
|
|||||||
/* SIGN byte */
|
/* SIGN byte */
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
{
|
{
|
||||||
(*AH->WriteBytePtr) (AH, 1);
|
AH->WriteBytePtr(AH, 1);
|
||||||
i = -i;
|
i = -i;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
(*AH->WriteBytePtr) (AH, 0);
|
AH->WriteBytePtr(AH, 0);
|
||||||
|
|
||||||
for (b = 0; b < AH->intSize; b++)
|
for (b = 0; b < AH->intSize; b++)
|
||||||
{
|
{
|
||||||
(*AH->WriteBytePtr) (AH, i & 0xFF);
|
AH->WriteBytePtr(AH, i & 0xFF);
|
||||||
i >>= 8;
|
i >>= 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2037,11 +2037,11 @@ ReadInt(ArchiveHandle *AH)
|
|||||||
|
|
||||||
if (AH->version > K_VERS_1_0)
|
if (AH->version > K_VERS_1_0)
|
||||||
/* Read a sign byte */
|
/* Read a sign byte */
|
||||||
sign = (*AH->ReadBytePtr) (AH);
|
sign = AH->ReadBytePtr(AH);
|
||||||
|
|
||||||
for (b = 0; b < AH->intSize; b++)
|
for (b = 0; b < AH->intSize; b++)
|
||||||
{
|
{
|
||||||
bv = (*AH->ReadBytePtr) (AH) & 0xFF;
|
bv = AH->ReadBytePtr(AH) & 0xFF;
|
||||||
if (bv != 0)
|
if (bv != 0)
|
||||||
res = res + (bv << bitShift);
|
res = res + (bv << bitShift);
|
||||||
bitShift += 8;
|
bitShift += 8;
|
||||||
@ -2063,7 +2063,7 @@ WriteStr(ArchiveHandle *AH, const char *c)
|
|||||||
int len = strlen(c);
|
int len = strlen(c);
|
||||||
|
|
||||||
res = WriteInt(AH, len);
|
res = WriteInt(AH, len);
|
||||||
(*AH->WriteBufPtr) (AH, c, len);
|
AH->WriteBufPtr(AH, c, len);
|
||||||
res += len;
|
res += len;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2084,7 +2084,7 @@ ReadStr(ArchiveHandle *AH)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf = (char *) pg_malloc(l + 1);
|
buf = (char *) pg_malloc(l + 1);
|
||||||
(*AH->ReadBufPtr) (AH, (void *) buf, l);
|
AH->ReadBufPtr(AH, (void *) buf, l);
|
||||||
|
|
||||||
buf[l] = '\0';
|
buf[l] = '\0';
|
||||||
}
|
}
|
||||||
@ -2495,7 +2495,7 @@ WriteDataChunksForTocEntry(ArchiveHandle *AH, TocEntry *te)
|
|||||||
/*
|
/*
|
||||||
* The user-provided DataDumper routine needs to call AH->WriteData
|
* The user-provided DataDumper routine needs to call AH->WriteData
|
||||||
*/
|
*/
|
||||||
(*te->dataDumper) ((Archive *) AH, te->dataDumperArg);
|
te->dataDumper((Archive *) AH, te->dataDumperArg);
|
||||||
|
|
||||||
if (endPtr != NULL)
|
if (endPtr != NULL)
|
||||||
(*endPtr) (AH, te);
|
(*endPtr) (AH, te);
|
||||||
@ -2557,7 +2557,7 @@ WriteToc(ArchiveHandle *AH)
|
|||||||
WriteStr(AH, NULL); /* Terminate List */
|
WriteStr(AH, NULL); /* Terminate List */
|
||||||
|
|
||||||
if (AH->WriteExtraTocPtr)
|
if (AH->WriteExtraTocPtr)
|
||||||
(*AH->WriteExtraTocPtr) (AH, te);
|
AH->WriteExtraTocPtr(AH, te);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2699,7 +2699,7 @@ ReadToc(ArchiveHandle *AH)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (AH->ReadExtraTocPtr)
|
if (AH->ReadExtraTocPtr)
|
||||||
(*AH->ReadExtraTocPtr) (AH, te);
|
AH->ReadExtraTocPtr(AH, te);
|
||||||
|
|
||||||
ahlog(AH, 3, "read TOC entry %d (ID %d) for %s %s\n",
|
ahlog(AH, 3, "read TOC entry %d (ID %d) for %s %s\n",
|
||||||
i, te->dumpId, te->desc, te->tag);
|
i, te->dumpId, te->desc, te->tag);
|
||||||
@ -3520,7 +3520,7 @@ _printTocEntry(ArchiveHandle *AH, TocEntry *te, bool isData)
|
|||||||
ahprintf(AH, "\n");
|
ahprintf(AH, "\n");
|
||||||
|
|
||||||
if (AH->PrintExtraTocPtr != NULL)
|
if (AH->PrintExtraTocPtr != NULL)
|
||||||
(*AH->PrintExtraTocPtr) (AH, te);
|
AH->PrintExtraTocPtr(AH, te);
|
||||||
ahprintf(AH, "--\n\n");
|
ahprintf(AH, "--\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3648,13 +3648,13 @@ WriteHead(ArchiveHandle *AH)
|
|||||||
{
|
{
|
||||||
struct tm crtm;
|
struct tm crtm;
|
||||||
|
|
||||||
(*AH->WriteBufPtr) (AH, "PGDMP", 5); /* Magic code */
|
AH->WriteBufPtr(AH, "PGDMP", 5); /* Magic code */
|
||||||
(*AH->WriteBytePtr) (AH, ARCHIVE_MAJOR(AH->version));
|
AH->WriteBytePtr(AH, ARCHIVE_MAJOR(AH->version));
|
||||||
(*AH->WriteBytePtr) (AH, ARCHIVE_MINOR(AH->version));
|
AH->WriteBytePtr(AH, ARCHIVE_MINOR(AH->version));
|
||||||
(*AH->WriteBytePtr) (AH, ARCHIVE_REV(AH->version));
|
AH->WriteBytePtr(AH, ARCHIVE_REV(AH->version));
|
||||||
(*AH->WriteBytePtr) (AH, AH->intSize);
|
AH->WriteBytePtr(AH, AH->intSize);
|
||||||
(*AH->WriteBytePtr) (AH, AH->offSize);
|
AH->WriteBytePtr(AH, AH->offSize);
|
||||||
(*AH->WriteBytePtr) (AH, AH->format);
|
AH->WriteBytePtr(AH, AH->format);
|
||||||
WriteInt(AH, AH->compression);
|
WriteInt(AH, AH->compression);
|
||||||
crtm = *localtime(&AH->createDate);
|
crtm = *localtime(&AH->createDate);
|
||||||
WriteInt(AH, crtm.tm_sec);
|
WriteInt(AH, crtm.tm_sec);
|
||||||
@ -3688,16 +3688,16 @@ ReadHead(ArchiveHandle *AH)
|
|||||||
vmin,
|
vmin,
|
||||||
vrev;
|
vrev;
|
||||||
|
|
||||||
(*AH->ReadBufPtr) (AH, tmpMag, 5);
|
AH->ReadBufPtr(AH, tmpMag, 5);
|
||||||
|
|
||||||
if (strncmp(tmpMag, "PGDMP", 5) != 0)
|
if (strncmp(tmpMag, "PGDMP", 5) != 0)
|
||||||
exit_horribly(modulename, "did not find magic string in file header\n");
|
exit_horribly(modulename, "did not find magic string in file header\n");
|
||||||
|
|
||||||
vmaj = (*AH->ReadBytePtr) (AH);
|
vmaj = AH->ReadBytePtr(AH);
|
||||||
vmin = (*AH->ReadBytePtr) (AH);
|
vmin = AH->ReadBytePtr(AH);
|
||||||
|
|
||||||
if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */
|
if (vmaj > 1 || (vmaj == 1 && vmin > 0)) /* Version > 1.0 */
|
||||||
vrev = (*AH->ReadBytePtr) (AH);
|
vrev = AH->ReadBytePtr(AH);
|
||||||
else
|
else
|
||||||
vrev = 0;
|
vrev = 0;
|
||||||
|
|
||||||
@ -3707,7 +3707,7 @@ ReadHead(ArchiveHandle *AH)
|
|||||||
exit_horribly(modulename, "unsupported version (%d.%d) in file header\n",
|
exit_horribly(modulename, "unsupported version (%d.%d) in file header\n",
|
||||||
vmaj, vmin);
|
vmaj, vmin);
|
||||||
|
|
||||||
AH->intSize = (*AH->ReadBytePtr) (AH);
|
AH->intSize = AH->ReadBytePtr(AH);
|
||||||
if (AH->intSize > 32)
|
if (AH->intSize > 32)
|
||||||
exit_horribly(modulename, "sanity check on integer size (%lu) failed\n",
|
exit_horribly(modulename, "sanity check on integer size (%lu) failed\n",
|
||||||
(unsigned long) AH->intSize);
|
(unsigned long) AH->intSize);
|
||||||
@ -3716,11 +3716,11 @@ ReadHead(ArchiveHandle *AH)
|
|||||||
write_msg(modulename, "WARNING: archive was made on a machine with larger integers, some operations might fail\n");
|
write_msg(modulename, "WARNING: archive was made on a machine with larger integers, some operations might fail\n");
|
||||||
|
|
||||||
if (AH->version >= K_VERS_1_7)
|
if (AH->version >= K_VERS_1_7)
|
||||||
AH->offSize = (*AH->ReadBytePtr) (AH);
|
AH->offSize = AH->ReadBytePtr(AH);
|
||||||
else
|
else
|
||||||
AH->offSize = AH->intSize;
|
AH->offSize = AH->intSize;
|
||||||
|
|
||||||
fmt = (*AH->ReadBytePtr) (AH);
|
fmt = AH->ReadBytePtr(AH);
|
||||||
|
|
||||||
if (AH->format != fmt)
|
if (AH->format != fmt)
|
||||||
exit_horribly(modulename, "expected format (%d) differs from format found in file (%d)\n",
|
exit_horribly(modulename, "expected format (%d) differs from format found in file (%d)\n",
|
||||||
@ -3730,7 +3730,7 @@ ReadHead(ArchiveHandle *AH)
|
|||||||
if (AH->version >= K_VERS_1_2)
|
if (AH->version >= K_VERS_1_2)
|
||||||
{
|
{
|
||||||
if (AH->version < K_VERS_1_4)
|
if (AH->version < K_VERS_1_4)
|
||||||
AH->compression = (*AH->ReadBytePtr) (AH);
|
AH->compression = AH->ReadBytePtr(AH);
|
||||||
else
|
else
|
||||||
AH->compression = ReadInt(AH);
|
AH->compression = ReadInt(AH);
|
||||||
}
|
}
|
||||||
@ -4700,7 +4700,7 @@ CloneArchive(ArchiveHandle *AH)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Let the format-specific code have a chance too */
|
/* Let the format-specific code have a chance too */
|
||||||
(clone->ClonePtr) (clone);
|
clone->ClonePtr(clone);
|
||||||
|
|
||||||
Assert(clone->connection != NULL);
|
Assert(clone->connection != NULL);
|
||||||
return clone;
|
return clone;
|
||||||
@ -4718,7 +4718,7 @@ DeCloneArchive(ArchiveHandle *AH)
|
|||||||
Assert(AH->connection == NULL);
|
Assert(AH->connection == NULL);
|
||||||
|
|
||||||
/* Clear format-specific state */
|
/* Clear format-specific state */
|
||||||
(AH->DeClonePtr) (AH);
|
AH->DeClonePtr(AH);
|
||||||
|
|
||||||
/* Clear state allocated by CloneArchive */
|
/* Clear state allocated by CloneArchive */
|
||||||
if (AH->sqlparse.curCmd)
|
if (AH->sqlparse.curCmd)
|
||||||
|
@ -202,7 +202,7 @@ _PrintTocData(ArchiveHandle *AH, TocEntry *te)
|
|||||||
if (strcmp(te->desc, "BLOBS") == 0)
|
if (strcmp(te->desc, "BLOBS") == 0)
|
||||||
_StartBlobs(AH, te);
|
_StartBlobs(AH, te);
|
||||||
|
|
||||||
(*te->dataDumper) ((Archive *) AH, te->dataDumperArg);
|
te->dataDumper((Archive *) AH, te->dataDumperArg);
|
||||||
|
|
||||||
if (strcmp(te->desc, "BLOBS") == 0)
|
if (strcmp(te->desc, "BLOBS") == 0)
|
||||||
_EndBlobs(AH, te);
|
_EndBlobs(AH, te);
|
||||||
|
@ -144,7 +144,7 @@ exit_nicely(int code)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = on_exit_nicely_index - 1; i >= 0; i--)
|
for (i = on_exit_nicely_index - 1; i >= 0; i--)
|
||||||
(*on_exit_nicely_list[i].function) (code,
|
on_exit_nicely_list[i].function(code,
|
||||||
on_exit_nicely_list[i].arg);
|
on_exit_nicely_list[i].arg);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
@ -246,10 +246,10 @@ SetVariable(VariableSpace space, const char *name, const char *value)
|
|||||||
bool confirmed;
|
bool confirmed;
|
||||||
|
|
||||||
if (current->substitute_hook)
|
if (current->substitute_hook)
|
||||||
new_value = (*current->substitute_hook) (new_value);
|
new_value = current->substitute_hook(new_value);
|
||||||
|
|
||||||
if (current->assign_hook)
|
if (current->assign_hook)
|
||||||
confirmed = (*current->assign_hook) (new_value);
|
confirmed = current->assign_hook(new_value);
|
||||||
else
|
else
|
||||||
confirmed = true;
|
confirmed = true;
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ ExecEvalExpr(ExprState *state,
|
|||||||
ExprContext *econtext,
|
ExprContext *econtext,
|
||||||
bool *isNull)
|
bool *isNull)
|
||||||
{
|
{
|
||||||
return (*state->evalfunc) (state, econtext, isNull);
|
return state->evalfunc(state, econtext, isNull);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -306,7 +306,7 @@ ExecEvalExprSwitchContext(ExprState *state,
|
|||||||
MemoryContext oldContext;
|
MemoryContext oldContext;
|
||||||
|
|
||||||
oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
|
oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
|
||||||
retDatum = (*state->evalfunc) (state, econtext, isNull);
|
retDatum = state->evalfunc(state, econtext, isNull);
|
||||||
MemoryContextSwitchTo(oldContext);
|
MemoryContextSwitchTo(oldContext);
|
||||||
return retDatum;
|
return retDatum;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ typedef struct VariableStatData
|
|||||||
#define ReleaseVariableStats(vardata) \
|
#define ReleaseVariableStats(vardata) \
|
||||||
do { \
|
do { \
|
||||||
if (HeapTupleIsValid((vardata).statsTuple)) \
|
if (HeapTupleIsValid((vardata).statsTuple)) \
|
||||||
(* (vardata).freefunc) ((vardata).statsTuple); \
|
(vardata).freefunc((vardata).statsTuple); \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ ApplySortComparator(Datum datum1, bool isNull1,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
compare = (*ssup->comparator) (datum1, datum2, ssup);
|
compare = ssup->comparator(datum1, datum2, ssup);
|
||||||
if (ssup->ssup_reverse)
|
if (ssup->ssup_reverse)
|
||||||
compare = -compare;
|
compare = -compare;
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ ApplySortAbbrevFullComparator(Datum datum1, bool isNull1,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
compare = (*ssup->abbrev_full_comparator) (datum1, datum2, ssup);
|
compare = ssup->abbrev_full_comparator(datum1, datum2, ssup);
|
||||||
if (ssup->ssup_reverse)
|
if (ssup->ssup_reverse)
|
||||||
compare = -compare;
|
compare = -compare;
|
||||||
}
|
}
|
||||||
|
@ -6297,7 +6297,7 @@ defaultNoticeReceiver(void *arg, const PGresult *res)
|
|||||||
{
|
{
|
||||||
(void) arg; /* not used */
|
(void) arg; /* not used */
|
||||||
if (res->noticeHooks.noticeProc != NULL)
|
if (res->noticeHooks.noticeProc != NULL)
|
||||||
(*res->noticeHooks.noticeProc) (res->noticeHooks.noticeProcArg,
|
res->noticeHooks.noticeProc(res->noticeHooks.noticeProcArg,
|
||||||
PQresultErrorMessage(res));
|
PQresultErrorMessage(res));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,7 +860,7 @@ pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...)
|
|||||||
/*
|
/*
|
||||||
* Pass to receiver, then free it.
|
* Pass to receiver, then free it.
|
||||||
*/
|
*/
|
||||||
(*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
|
res->noticeHooks.noticeRec(res->noticeHooks.noticeRecArg, res);
|
||||||
}
|
}
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
}
|
}
|
||||||
|
@ -1055,7 +1055,7 @@ pqGetErrorNotice2(PGconn *conn, bool isError)
|
|||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
if (res->noticeHooks.noticeRec != NULL)
|
if (res->noticeHooks.noticeRec != NULL)
|
||||||
(*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
|
res->noticeHooks.noticeRec(res->noticeHooks.noticeRecArg, res);
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -960,7 +960,7 @@ pqGetErrorNotice3(PGconn *conn, bool isError)
|
|||||||
/* We can cheat a little here and not copy the message. */
|
/* We can cheat a little here and not copy the message. */
|
||||||
res->errMsg = workBuf.data;
|
res->errMsg = workBuf.data;
|
||||||
if (res->noticeHooks.noticeRec != NULL)
|
if (res->noticeHooks.noticeRec != NULL)
|
||||||
(*res->noticeHooks.noticeRec) (res->noticeHooks.noticeRecArg, res);
|
res->noticeHooks.noticeRec(res->noticeHooks.noticeRecArg, res);
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user