Merge pull request #718 from citusdata/fix-700-5.2

Skip over unreferenced parameters when router executing prepared stat…
pull/736/head
Andres Freund 2016-08-05 14:28:23 -07:00 committed by GitHub
commit 75cd7a7d6f
1 changed files with 6 additions and 1 deletions

View File

@ -821,7 +821,12 @@ ExtractParametersFromParamListInfo(ParamListInfo paramListInfo, Oid **parameterT
(*parameterTypes)[parameterIndex] = parameterData->ptype; (*parameterTypes)[parameterIndex] = parameterData->ptype;
} }
if (parameterData->isnull) /*
* If the parameter is NULL, or is not referenced / used (ptype == 0
* would otherwise have errored out inside standard_planner()),
* don't pass a value to the remote side.
*/
if (parameterData->isnull || parameterData->ptype == 0)
{ {
(*parameterValues)[parameterIndex] = NULL; (*parameterValues)[parameterIndex] = NULL;
continue; continue;