Introduce ExplainOnePlanCompat

Since ExplainOnePlan expects BufferUsage as well with PG >= 13,
ExplainOnePlanCompat is added.

Commit on Postgres side:
ed7a5095716ee498ecc406e1b8d5ab92c7662d10
pull/3900/head
Sait Talha Nisanci 2020-05-20 11:48:09 +03:00
parent 6314eba5df
commit 688ab16bba
2 changed files with 5 additions and 3 deletions

View File

@ -313,7 +313,7 @@ ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es)
INSTR_TIME_SET_ZERO(planduration);
ExplainOnePlan(plan, into, es, queryString, params, NULL, &planduration);
ExplainOnePlanCompat(plan, into, es, queryString, params, NULL, &planduration, NULL);
if (es->format == EXPLAIN_FORMAT_TEXT)
{
@ -1463,8 +1463,8 @@ ExplainOneQuery(Query *query, int cursorOptions,
INSTR_TIME_SUBTRACT(planduration, planstart);
/* run it (if needed) and produce output */
ExplainOnePlan(plan, into, es, queryString, params, queryEnv,
&planduration);
ExplainOnePlanCompat(plan, into, es, queryString, params, queryEnv,
&planduration, NULL);
}
}

View File

@ -36,6 +36,7 @@
#define standard_planner_compat(a,b,c,d) standard_planner(a,b,c,d)
#define PortalDefineQuerySelectCompat(a,b,c,e,f) PortalDefineQuery(a,b,c,CMDTAG_SELECT,e,f)
#define getOwnedSequencesCompat(a,b) getOwnedSequences(a)
#define ExplainOnePlanCompat(a,b,c,d,e,f,g,h) ExplainOnePlan(a,b,c,d,e,f,g,h)
#else /* pre PG13 */
#define lnext_compat(l, r) lnext(r)
#define list_delete_cell_compat(l,c,p) list_delete_cell(l,c,p)
@ -44,6 +45,7 @@
#define standard_planner_compat(a,b,c,d) standard_planner(a,c,d)
#define PortalDefineQuerySelectCompat(a,b,c,e,f) PortalDefineQuery(a,b,c,"SELECT",e,f)
#define getOwnedSequencesCompat(a,b) getOwnedSequences(a,b)
#define ExplainOnePlanCompat(a,b,c,d,e,f,g,h) ExplainOnePlan(a,b,c,d,e,f,g)
#endif
#if PG_VERSION_NUM >= PG_VERSION_12