diff --git a/src/gausskernel/process/tcop/pquery.cpp b/src/gausskernel/process/tcop/pquery.cpp index 3d451c4c3..6c36cbf4a 100644 --- a/src/gausskernel/process/tcop/pquery.cpp +++ b/src/gausskernel/process/tcop/pquery.cpp @@ -1727,6 +1727,10 @@ static void PortalRunUtility(Portal portal, Node* utilityStmt, bool isTopLevel, #endif /* PGXC */ completionTag); + if (proutility_cxt.parse_tree != NULL && nodeTag(proutility_cxt.parse_tree) == T_ExplainStmt && ((ExplainStmt*)proutility_cxt.parse_tree)->planinfo != NULL) { + ((ExplainStmt*)utilityStmt)->planinfo = ((ExplainStmt*)proutility_cxt.parse_tree)->planinfo; + } + /* Some utility statements may change context on us */ MemoryContextSwitchTo(PortalGetHeapMemory(portal));