!3011 修复pbe场景下explain plan的core问题

Merge pull request !3011 from 仲夏十三/mas9
This commit is contained in:
opengauss-bot
2023-03-03 09:21:52 +00:00
committed by Gitee

View File

@ -1729,6 +1729,10 @@ static void PortalRunUtility(Portal portal, Node* utilityStmt, bool isTopLevel,
isTopLevel ? PROCESS_UTILITY_TOPLEVEL : PROCESS_UTILITY_QUERY);
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));