From 3e4346857d73841373b3424147e104a58802f8f3 Mon Sep 17 00:00:00 2001 From: Pavan Deolasee Date: Fri, 31 Oct 2014 13:11:38 +0530 Subject: Allow pg_stat_statements to work with XL XL uses a post-post-analyze hook for it's internal purposes. But this overrides any existing hooks, including that of pg_stat_statements. Setup things so that the previous hook gets called appropriately --- src/backend/parser/analyze.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/backend/parser') 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); } -- cgit v1.2.3