FixIssue-7596
EmelSimsek 2024-05-14 15:39:50 +03:00
parent c4b6fb1dd0
commit 05c88392fd
No known key found for this signature in database
GPG Key ID: EB13DFB77C32D7D8
2 changed files with 20 additions and 1 deletions

View File

@ -816,8 +816,11 @@ AdaptiveExecutor(CitusScanState *scanState)
* be part of the same transaction. * be part of the same transaction.
*/ */
UseCoordinatedTransaction(); UseCoordinatedTransaction();
ParamListInfo boundParams = copyParamList(paramListInfo);
taskList = ExplainAnalyzeTaskList(taskList, defaultTupleDest, tupleDescriptor, taskList = ExplainAnalyzeTaskList(taskList, defaultTupleDest, tupleDescriptor,
paramListInfo); boundParams);
/* /*
* Multiple queries per task is not supported with local execution. See the Assert in * Multiple queries per task is not supported with local execution. See the Assert in

View File

@ -1589,6 +1589,16 @@ FetchPlanQueryForExplainAnalyze(const char *queryString, ParamListInfo params)
{ {
StringInfo fetchQuery = makeStringInfo(); StringInfo fetchQuery = makeStringInfo();
if (params != NULL)
{
/*
* Add a dummy CTE to ensure all parameters are referenced, such that their
* types can be resolved.
*/
appendStringInfo(fetchQuery, "WITH unused AS (%s) ",
ParameterResolutionSubquery(params));
}
appendStringInfoString(fetchQuery, appendStringInfoString(fetchQuery,
"SELECT explain_analyze_output, execution_duration " "SELECT explain_analyze_output, execution_duration "
@ -1613,6 +1623,12 @@ ParameterResolutionSubquery(ParamListInfo params)
for (int paramIndex = 0; paramIndex < params->numParams; paramIndex++) for (int paramIndex = 0; paramIndex < params->numParams; paramIndex++)
{ {
ParamExternData *param = &params->params[paramIndex]; ParamExternData *param = &params->params[paramIndex];
if (param->ptype == 0)
{
continue;
}
char *typeName = format_type_extended(param->ptype, -1, char *typeName = format_type_extended(param->ptype, -1,
FORMAT_TYPE_FORCE_QUALIFY); FORMAT_TYPE_FORCE_QUALIFY);