summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/parser/analyze.c9
-rw-r--r--src/backend/tcop/postgres.c2
2 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 85feefdfce..c7befc1ba4 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -2545,6 +2545,11 @@ transformExecDirectStmt(ParseState *pstate, ExecDirectStmt *stmt)
if (!is_local)
result->utilityStmt = (Node *) step;
+ /*
+ * Reset the queryId since the caller would do that anyways.
+ */
+ result->queryId = 0;
+
return result;
}
@@ -2900,6 +2905,8 @@ applyLockingClause(Query *qry, Index rtindex,
}
#ifdef XCP
+post_parse_analyze_hook_type prev_ParseAnalyze_callback;
+
/*
* Check if the query contains references to any pg_catalog tables that should
* be remapped to storm_catalog. The list is obtained from the
@@ -2908,6 +2915,8 @@ applyLockingClause(Query *qry, Index rtindex,
void
ParseAnalyze_callback(ParseState *pstate, Query *query)
{
+ if (prev_ParseAnalyze_callback)
+ prev_ParseAnalyze_callback(pstate, query);
ParseAnalyze_rtable_walk(query->rtable);
}
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 43d37f927c..1143be2cc9 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -4285,6 +4285,8 @@ PostgresMain(int argc, char *argv[], const char *username)
}
/* Set up the post parse analyze hook */
+ if (post_parse_analyze_hook)
+ prev_ParseAnalyze_callback = post_parse_analyze_hook;
post_parse_analyze_hook = ParseAnalyze_callback;
/* if we exit, try to release cluster lock properly */