* commandTag: compile-time-constant tag for query, or NULL if empty query
* param_types: array of parameter type OIDs, or NULL if none
* num_params: number of parameters
+ * cursor_options: options bitmask that was/will be passed to planner
* stmt_list: list of PlannedStmts/utility stmts, or list of Query trees
* fully_planned: are we caching planner or rewriter output?
* fixed_result: TRUE to disallow changes in result tupdesc
const char *commandTag,
Oid *param_types,
int num_params,
+ int cursor_options,
List *stmt_list,
bool fully_planned,
bool fixed_result)
else
plansource->param_types = NULL;
plansource->num_params = num_params;
+ plansource->cursor_options = cursor_options;
plansource->fully_planned = fully_planned;
plansource->fixed_result = fixed_result;
plansource->search_path = search_path;
const char *commandTag,
Oid *param_types,
int num_params,
+ int cursor_options,
List *stmt_list,
bool fully_planned,
bool fixed_result,
plansource->commandTag = commandTag; /* no copying needed */
plansource->param_types = param_types;
plansource->num_params = num_params;
+ plansource->cursor_options = cursor_options;
plansource->fully_planned = fully_planned;
plansource->fixed_result = fixed_result;
plansource->search_path = search_path;
if (plansource->fully_planned)
{
/*
- * Generate plans for queries. We don't need any boundParams, and
- * currently we don't need to worry about cursor options because
- * cursor plans are never saved in the plancache (that might have
- * to change someday). Also, assume snapshot is not set yet
+ * Generate plans for queries. Assume snapshot is not set yet
* (XXX this may be wasteful, won't all callers have done that?)
*/
- slist = pg_plan_queries(slist, 0, NULL, true);
+ slist = pg_plan_queries(slist, plansource->cursor_options, NULL,
+ true);
}
/*
const char *commandTag; /* command tag (a constant!), or NULL */
Oid *param_types; /* array of parameter type OIDs, or NULL */
int num_params; /* length of param_types array */
+ int cursor_options; /* cursor options used for planning */
bool fully_planned; /* do we cache planner or rewriter output? */
bool fixed_result; /* disallow change in result tupdesc? */
struct OverrideSearchPath *search_path; /* saved search_path */
const char *commandTag,
Oid *param_types,
int num_params,
+ int cursor_options,
List *stmt_list,
bool fully_planned,
bool fixed_result);
const char *commandTag,
Oid *param_types,
int num_params,
+ int cursor_options,
List *stmt_list,
bool fully_planned,
bool fixed_result,