summaryrefslogtreecommitdiff
path: root/src/test/modules/delay_execution/delay_execution.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2025-10-08 08:33:29 -0400
committerRobert Haas <rhaas@postgresql.org>2025-10-08 08:33:29 -0400
commitc83ac02ec7309edb7561eee93895c31a54b93d3d (patch)
tree6cae6dc6ebe7615af87e6df9ac9aa0c019c4d1e8 /src/test/modules/delay_execution/delay_execution.c
parent8e11859102f947e6145acdd809e5cdcdfbe90fa5 (diff)
Add ExplainState argument to pg_plan_query() and planner().
This allows extensions to have access to any data they've stored in the ExplainState during planning. Unfortunately, it won't help with EXPLAIN EXECUTE is used, but since that case is less common, this still seems like an improvement. Since planner() has quite a few arguments now, also add some documentation of those arguments and the return value. Author: Robert Haas <rhaas@postgresql.org> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Andrei Lepikhov <lepihov@gmail.com> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: http://postgr.es/m/CA+TgmoYWKHU2hKr62Toyzh-kTDEnMDeLw7gkOOnjL-TnOUq0kQ@mail.gmail.com
Diffstat (limited to 'src/test/modules/delay_execution/delay_execution.c')
-rw-r--r--src/test/modules/delay_execution/delay_execution.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/modules/delay_execution/delay_execution.c b/src/test/modules/delay_execution/delay_execution.c
index 7bc97f84a1c..d933e9a6e53 100644
--- a/src/test/modules/delay_execution/delay_execution.c
+++ b/src/test/modules/delay_execution/delay_execution.c
@@ -40,17 +40,18 @@ static planner_hook_type prev_planner_hook = NULL;
/* planner_hook function to provide the desired delay */
static PlannedStmt *
delay_execution_planner(Query *parse, const char *query_string,
- int cursorOptions, ParamListInfo boundParams)
+ int cursorOptions, ParamListInfo boundParams,
+ ExplainState *es)
{
PlannedStmt *result;
/* Invoke the planner, possibly via a previous hook user */
if (prev_planner_hook)
result = prev_planner_hook(parse, query_string, cursorOptions,
- boundParams);
+ boundParams, es);
else
result = standard_planner(parse, query_string, cursorOptions,
- boundParams);
+ boundParams, es);
/* If enabled, delay by taking and releasing the specified lock */
if (post_planning_lock_id != 0)