mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Make better use of ParseState in ProcessUtility
Pass ParseState into the functions called from standard_ProcessUtility() instead passing the query string and query environment separately. No functionality change, but it makes the notation consistent. We had already started moving things into that direction piece by piece, and this completes it. Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/6e7aa4a1-be6a-1a75-b1f9-83a678e5184a@2ndquadrant.com
This commit is contained in:
@@ -396,6 +396,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
|
||||
|
||||
pstate = make_parsestate(NULL);
|
||||
pstate->p_sourcetext = queryString;
|
||||
pstate->p_queryEnv = queryEnv;
|
||||
|
||||
switch (nodeTag(parsetree))
|
||||
{
|
||||
@@ -500,8 +501,8 @@ standard_ProcessUtility(PlannedStmt *pstmt,
|
||||
* Portal (cursor) manipulation
|
||||
*/
|
||||
case T_DeclareCursorStmt:
|
||||
PerformCursorOpen((DeclareCursorStmt *) parsetree, params,
|
||||
queryString, isTopLevel);
|
||||
PerformCursorOpen(pstate, (DeclareCursorStmt *) parsetree, params,
|
||||
isTopLevel);
|
||||
break;
|
||||
|
||||
case T_ClosePortalStmt:
|
||||
@@ -558,13 +559,14 @@ standard_ProcessUtility(PlannedStmt *pstmt,
|
||||
|
||||
case T_PrepareStmt:
|
||||
CheckRestrictedOperation("PREPARE");
|
||||
PrepareQuery((PrepareStmt *) parsetree, queryString,
|
||||
PrepareQuery(pstate, (PrepareStmt *) parsetree,
|
||||
pstmt->stmt_location, pstmt->stmt_len);
|
||||
break;
|
||||
|
||||
case T_ExecuteStmt:
|
||||
ExecuteQuery((ExecuteStmt *) parsetree, NULL,
|
||||
queryString, params,
|
||||
ExecuteQuery(pstate,
|
||||
(ExecuteStmt *) parsetree, NULL,
|
||||
params,
|
||||
dest, completionTag);
|
||||
break;
|
||||
|
||||
@@ -667,8 +669,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
|
||||
break;
|
||||
|
||||
case T_ExplainStmt:
|
||||
ExplainQuery(pstate, (ExplainStmt *) parsetree, queryString, params,
|
||||
queryEnv, dest);
|
||||
ExplainQuery(pstate, (ExplainStmt *) parsetree, params, dest);
|
||||
break;
|
||||
|
||||
case T_AlterSystemStmt:
|
||||
@@ -1490,9 +1491,8 @@ ProcessUtilitySlow(ParseState *pstate,
|
||||
break;
|
||||
|
||||
case T_CreateTableAsStmt:
|
||||
address = ExecCreateTableAs((CreateTableAsStmt *) parsetree,
|
||||
queryString, params, queryEnv,
|
||||
completionTag);
|
||||
address = ExecCreateTableAs(pstate, (CreateTableAsStmt *) parsetree,
|
||||
params, queryEnv, completionTag);
|
||||
break;
|
||||
|
||||
case T_RefreshMatViewStmt:
|
||||
|
Reference in New Issue
Block a user