Commit 41bd155d authored by Kevin Grittner's avatar Kevin Grittner

Fix two undocumented parameters to functions from ENR patch.

On ProcessUtility document the parameter, to match others.

On CreateCachedPlan drop the queryEnv parameter.  It was not
referenced within the function, and had been added on the
assumption that with some unknown future usage of QueryEnvironment
it might be useful to do something there.  We have avoided other
"just in case" implementation of unused paramters, so drop it here.

Per gripe from Tom Lane
parent c655899b
...@@ -91,7 +91,7 @@ PrepareQuery(PrepareStmt *stmt, const char *queryString, ...@@ -91,7 +91,7 @@ PrepareQuery(PrepareStmt *stmt, const char *queryString,
* to see the unmodified raw parse tree. * to see the unmodified raw parse tree.
*/ */
plansource = CreateCachedPlan(rawstmt, queryString, plansource = CreateCachedPlan(rawstmt, queryString,
CreateCommandTag(stmt->query), NULL); CreateCommandTag(stmt->query));
/* Transform list of TypeNames to array of type OIDs */ /* Transform list of TypeNames to array of type OIDs */
nargs = list_length(stmt->argtypes); nargs = list_length(stmt->argtypes);
......
...@@ -1777,8 +1777,7 @@ _SPI_prepare_plan(const char *src, SPIPlanPtr plan) ...@@ -1777,8 +1777,7 @@ _SPI_prepare_plan(const char *src, SPIPlanPtr plan)
*/ */
plansource = CreateCachedPlan(parsetree, plansource = CreateCachedPlan(parsetree,
src, src,
CreateCommandTag(parsetree->stmt), CreateCommandTag(parsetree->stmt));
_SPI_current->queryEnv);
/* /*
* Parameter datatypes are driven by parserSetup hook if provided, * Parameter datatypes are driven by parserSetup hook if provided,
......
...@@ -1318,8 +1318,7 @@ exec_parse_message(const char *query_string, /* string to execute */ ...@@ -1318,8 +1318,7 @@ exec_parse_message(const char *query_string, /* string to execute */
* Create the CachedPlanSource before we do parse analysis, since it * Create the CachedPlanSource before we do parse analysis, since it
* needs to see the unmodified raw parse tree. * needs to see the unmodified raw parse tree.
*/ */
psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag, psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag);
NULL);
/* /*
* Set up a snapshot if parse analysis will need one. * Set up a snapshot if parse analysis will need one.
...@@ -1371,8 +1370,7 @@ exec_parse_message(const char *query_string, /* string to execute */ ...@@ -1371,8 +1370,7 @@ exec_parse_message(const char *query_string, /* string to execute */
/* Empty input string. This is legal. */ /* Empty input string. This is legal. */
raw_parse_tree = NULL; raw_parse_tree = NULL;
commandTag = NULL; commandTag = NULL;
psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag, psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag);
NULL);
querytree_list = NIL; querytree_list = NIL;
} }
......
...@@ -308,6 +308,8 @@ CheckRestrictedOperation(const char *cmdname) ...@@ -308,6 +308,8 @@ CheckRestrictedOperation(const char *cmdname)
* context: identifies source of statement (toplevel client command, * context: identifies source of statement (toplevel client command,
* non-toplevel client command, subcommand of a larger utility command) * non-toplevel client command, subcommand of a larger utility command)
* params: parameters to use during execution * params: parameters to use during execution
* queryEnv: environment for parse through execution (e.g., ephemeral named
* tables like trigger transition tables). May be NULL.
* dest: where to send results * dest: where to send results
* completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE * completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE
* in which to store a command completion status string. * in which to store a command completion status string.
......
...@@ -151,8 +151,7 @@ InitPlanCache(void) ...@@ -151,8 +151,7 @@ InitPlanCache(void)
CachedPlanSource * CachedPlanSource *
CreateCachedPlan(RawStmt *raw_parse_tree, CreateCachedPlan(RawStmt *raw_parse_tree,
const char *query_string, const char *query_string,
const char *commandTag, const char *commandTag)
QueryEnvironment *queryEnv)
{ {
CachedPlanSource *plansource; CachedPlanSource *plansource;
MemoryContext source_context; MemoryContext source_context;
......
...@@ -149,8 +149,7 @@ extern void ResetPlanCache(void); ...@@ -149,8 +149,7 @@ extern void ResetPlanCache(void);
extern CachedPlanSource *CreateCachedPlan(struct RawStmt *raw_parse_tree, extern CachedPlanSource *CreateCachedPlan(struct RawStmt *raw_parse_tree,
const char *query_string, const char *query_string,
const char *commandTag, const char *commandTag);
QueryEnvironment *queryEnv);
extern CachedPlanSource *CreateOneShotCachedPlan(struct RawStmt *raw_parse_tree, extern CachedPlanSource *CreateOneShotCachedPlan(struct RawStmt *raw_parse_tree,
const char *query_string, const char *query_string,
const char *commandTag); const char *commandTag);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment