diff -cprN head/src/backend/commands/explain.c work/src/backend/commands/explain.c *** head/src/backend/commands/explain.c 2009-11-05 07:26:04.000000000 +0900 --- work/src/backend/commands/explain.c 2009-12-07 16:29:14.250487980 +0900 *************** static void ExplainOneQuery(Query *query *** 53,58 **** --- 53,59 ---- static void report_triggers(ResultRelInfo *rInfo, bool show_relname, ExplainState *es); static double elapsed_time(instr_time *starttime); + static void ExplainOneResult(ExplainState *es, QueryDesc *queryDesc); static void ExplainNode(Plan *plan, PlanState *planstate, Plan *outer_plan, const char *relationship, const char *plan_name, *************** ExplainOnePlan(PlannedStmt *plannedstmt, *** 377,383 **** ExplainOpenGroup("Query", NULL, true, es); /* Create textual dump of plan tree */ ! ExplainPrintPlan(es, queryDesc); /* * If we ran the command, run any AFTER triggers it queued. (Note this --- 378,384 ---- ExplainOpenGroup("Query", NULL, true, es); /* Create textual dump of plan tree */ ! ExplainOneResult(es, queryDesc); /* * If we ran the command, run any AFTER triggers it queued. (Note this *************** ExplainOnePlan(PlannedStmt *plannedstmt, *** 448,466 **** ExplainCloseGroup("Query", NULL, true, es); } ! /* ! * ExplainPrintPlan - ! * convert a QueryDesc's plan tree to text and append it to es->str ! * ! * The caller should have set up the options fields of *es, as well as ! * initializing the output buffer es->str. Other fields in *es are ! * initialized here. ! * ! * NB: will not work on utility statements ! */ ! void ! ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc) ! { Assert(queryDesc->plannedstmt != NULL); es->pstmt = queryDesc->plannedstmt; es->rtable = queryDesc->plannedstmt->rtable; --- 449,478 ---- ExplainCloseGroup("Query", NULL, true, es); } ! /* ! * ExplainPrintPlan - setup output and print a plan tree ! */ ! void ! ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc) ! { ! ExplainBeginOutput(es); ! ExplainOneResult(es, queryDesc); ! ExplainEndOutput(es); ! } ! ! /* ! * ExplainOneResult - ! * convert a QueryDesc's plan tree to text and append it to es->str ! * ! * The caller should have set up the options fields of *es, as well as ! * initializing the output buffer es->str. Other fields in *es are ! * initialized here. ! * ! * NB: will not work on utility statements ! */ ! static void ! ExplainOneResult(ExplainState *es, QueryDesc *queryDesc) ! { Assert(queryDesc->plannedstmt != NULL); es->pstmt = queryDesc->plannedstmt; es->rtable = queryDesc->plannedstmt->rtable;