summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Vondra2017-07-05 23:37:33 +0000
committerTomas Vondra2017-07-05 23:37:33 +0000
commit9b7535fe8e5fbbf555bc106bb823a70179b72cb2 (patch)
treeb418d397f1e6822d1f1bf4b7f753b57438de3afc
parentce532e6cc507322c4909f641d57e6ba1dc9c858a (diff)
Fix compilation errors in stormstats
There were three simple issues: 1) missing headers, so shmem-related functions were not defined 2) using LWLockId instead of plain LWLock 3) missing ProcessUtility changes from commit ab1f0c8225714aaa18d This commit fixes all of those compile-time issues.
-rw-r--r--contrib/stormstats/stormstats.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/contrib/stormstats/stormstats.c b/contrib/stormstats/stormstats.c
index ee13bc7ff7..12af8ab3ca 100644
--- a/contrib/stormstats/stormstats.c
+++ b/contrib/stormstats/stormstats.c
@@ -20,12 +20,15 @@
#include "funcapi.h"
#include "stormstats.h"
#include "storage/fd.h"
+#include "storage/shmem.h"
+#include "storage/lwlock.h"
#include "pgxc/pgxc.h"
#include "pgxc/pgxcnode.h"
#include "pgxc/planner.h"
#include "pgxc/execRemote.h"
+
/* mark this dynamic library to be compatible with PG */
PG_MODULE_MAGIC;
@@ -72,7 +75,7 @@ typedef struct LocalStatsEntry
typedef struct StormSharedState
{
- LWLockId lock;
+ LWLock *lock;
} StormSharedState;
static bool sp_save; /* whether to save stats across shutdown */
@@ -109,26 +112,25 @@ static ProcessUtility_hook_type prev_ProcessUtility = NULL;
static int max_tracked_dbs;
static void
-ProcessUtility_callback(Node *parsetree,
- const char *queryString,
- ProcessUtilityContext context,
+ProcessUtility_callback(PlannedStmt *pstmt,
+ const char *queryString, ProcessUtilityContext context,
ParamListInfo params,
+ QueryEnvironment *queryEnv,
DestReceiver *dest,
-#ifdef PGXC
bool sentToRemote,
-#endif /* PGXC */
char *completionTag)
{
+ Node *parsetree;
+
elog( DEBUG1, "STORMSTATS: using plugin." );
- standard_ProcessUtility(parsetree, queryString, context, params, dest,
-#ifdef PGXC
- sentToRemote,
-#endif /* PGXC */
- completionTag);
+ standard_ProcessUtility(pstmt, queryString, context, params, queryEnv,
+ dest, sentToRemote, completionTag);
stats_store(get_database_name(MyDatabaseId), CMD_UNKNOWN, false, true);
+ parsetree = pstmt->utilityStmt;
+
/*
* Check if it's a CREATE/DROP DATABASE command. Update entries in the
* shared hash table accordingly.