mirror of https://github.com/citusdata/citus.git
Make sure to access PARAM_EXTERN accurately in PG 11
PG 11 has change the way that PARAM_EXTERN is processed.
This commit ensures that Citus follows the same pattern.
For details see the related Postgres commit:
6719b238e8
pull/2457/head
parent
c7891115ef
commit
9e2e2a7300
|
@ -1563,22 +1563,30 @@ HasUnresolvedExternParamsWalker(Node *expression, ParamListInfo boundParams)
|
||||||
/* check whether parameter is available (and valid) */
|
/* check whether parameter is available (and valid) */
|
||||||
if (boundParams && paramId > 0 && paramId <= boundParams->numParams)
|
if (boundParams && paramId > 0 && paramId <= boundParams->numParams)
|
||||||
{
|
{
|
||||||
ParamExternData *externParam = &boundParams->params[paramId - 1];
|
ParamExternData *externParam = NULL;
|
||||||
Oid paramType = externParam->ptype;
|
Oid paramType = InvalidOid;
|
||||||
|
|
||||||
/* give hook a chance in case parameter is dynamic */
|
/* give hook a chance in case parameter is dynamic */
|
||||||
if (!OidIsValid(paramType) && boundParams->paramFetch != NULL)
|
if (boundParams->paramFetch != NULL)
|
||||||
{
|
{
|
||||||
#if (PG_VERSION_NUM >= 110000)
|
#if (PG_VERSION_NUM >= 110000)
|
||||||
ParamExternData externParamPlaceholder;
|
ParamExternData externParamPlaceholder;
|
||||||
externParam = (*boundParams->paramFetch)(boundParams, paramId, false,
|
externParam = (*boundParams->paramFetch)(boundParams, paramId, false,
|
||||||
&externParamPlaceholder);
|
&externParamPlaceholder);
|
||||||
#else
|
#else
|
||||||
(*boundParams->paramFetch)(boundParams, paramId);
|
externParam = &boundParams->params[paramId - 1];
|
||||||
|
if (!OidIsValid(externParam->ptype))
|
||||||
|
{
|
||||||
|
(*boundParams->paramFetch)(boundParams, paramId);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
paramType = externParam->ptype;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
externParam = &boundParams->params[paramId - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
paramType = externParam->ptype;
|
||||||
if (OidIsValid(paramType))
|
if (OidIsValid(paramType))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue