]> granicus.if.org Git - postgresql/commitdiff
Fix two undocumented parameters to functions from ENR patch.
authorKevin Grittner <kgrittn@postgresql.org>
Sat, 1 Apr 2017 20:21:05 +0000 (15:21 -0500)
committerKevin Grittner <kgrittn@postgresql.org>
Sat, 1 Apr 2017 20:21:05 +0000 (15:21 -0500)
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

src/backend/commands/prepare.c
src/backend/executor/spi.c
src/backend/tcop/postgres.c
src/backend/tcop/utility.c
src/backend/utils/cache/plancache.c
src/include/utils/plancache.h

index 5b3f777f2c3277af2f5c9d68f32c8d9efd80ba00..00cc51392089fbd242b64a68ce95d933fb359eb6 100644 (file)
@@ -91,7 +91,7 @@ PrepareQuery(PrepareStmt *stmt, const char *queryString,
         * to see the unmodified raw parse tree.
         */
        plansource = CreateCachedPlan(rawstmt, queryString,
-                                                                 CreateCommandTag(stmt->query), NULL);
+                                                                 CreateCommandTag(stmt->query));
 
        /* Transform list of TypeNames to array of type OIDs */
        nargs = list_length(stmt->argtypes);
index 54c022d0132c72b89ccc4d6c56584b87a784e65b..2f07a444b4d47f194e56f0cdd25e403859ed6f75 100644 (file)
@@ -1777,8 +1777,7 @@ _SPI_prepare_plan(const char *src, SPIPlanPtr plan)
                 */
                plansource = CreateCachedPlan(parsetree,
                                                                          src,
-                                                                         CreateCommandTag(parsetree->stmt),
-                                                                         _SPI_current->queryEnv);
+                                                                         CreateCommandTag(parsetree->stmt));
 
                /*
                 * Parameter datatypes are driven by parserSetup hook if provided,
index 139c4c0f68cc6afab0e2f0e96506afde0a618dfd..a2282058c0d796eae3fc2f51f47b918f78c80652 100644 (file)
@@ -1318,8 +1318,7 @@ exec_parse_message(const char *query_string,      /* string to execute */
                 * Create the CachedPlanSource before we do parse analysis, since it
                 * needs to see the unmodified raw parse tree.
                 */
-               psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag,
-                                                               NULL);
+               psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag);
 
                /*
                 * Set up a snapshot if parse analysis will need one.
@@ -1371,8 +1370,7 @@ exec_parse_message(const char *query_string,      /* string to execute */
                /* Empty input string.  This is legal. */
                raw_parse_tree = NULL;
                commandTag = NULL;
-               psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag,
-                                                               NULL);
+               psrc = CreateCachedPlan(raw_parse_tree, query_string, commandTag);
                querytree_list = NIL;
        }
 
index b610c8e7ceef61dd2713bee3303b33fb23abc9af..c0fd0f967f6292ebaf432e3572f2189b249a579b 100644 (file)
@@ -308,6 +308,8 @@ CheckRestrictedOperation(const char *cmdname)
  *     context: identifies source of statement (toplevel client command,
  *             non-toplevel client command, subcommand of a larger utility command)
  *     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
  *     completionTag: points to a buffer of size COMPLETION_TAG_BUFSIZE
  *             in which to store a command completion status string.
index a116d5ed63ee12d2463ba513afe3f4166cb25021..50da116cf446df39bc5fa374a3814d631b7bd4dc 100644 (file)
@@ -151,8 +151,7 @@ InitPlanCache(void)
 CachedPlanSource *
 CreateCachedPlan(RawStmt *raw_parse_tree,
                                 const char *query_string,
-                                const char *commandTag,
-                                QueryEnvironment *queryEnv)
+                                const char *commandTag)
 {
        CachedPlanSource *plansource;
        MemoryContext source_context;
index 48d4ac94b2ac7bb56b072abab4686e0ac6a100ef..9611f5a10c3c0176756c37ac246757f8716c0dc3 100644 (file)
@@ -149,8 +149,7 @@ extern void ResetPlanCache(void);
 
 extern CachedPlanSource *CreateCachedPlan(struct RawStmt *raw_parse_tree,
                                 const char *query_string,
-                                const char *commandTag,
-                                QueryEnvironment *queryEnv);
+                                const char *commandTag);
 extern CachedPlanSource *CreateOneShotCachedPlan(struct RawStmt *raw_parse_tree,
                                                const char *query_string,
                                                const char *commandTag);