projects
/
online_analyze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4ff8547
)
fix compile with pg < 9.6, fix memory context allocation
local_hash
author
Teodor Sigaev
<teodor@sigaev.ru>
Thu, 24 Nov 2016 09:04:21 +0000
(12:04 +0300)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Thu, 24 Nov 2016 09:04:21 +0000
(12:04 +0300)
online_analyze.c
patch
|
blob
|
history
diff --git
a/online_analyze.c
b/online_analyze.c
index
93276ab
..
b1a3578
100644
(file)
--- a/
online_analyze.c
+++ b/
online_analyze.c
@@
-109,7
+109,7
@@
typedef struct OnlineAnalyzeTableStat {
static MemoryContext onlineAnalyzeMemoryContext = NULL;
static HTAB *relstats = NULL;
static MemoryContext onlineAnalyzeMemoryContext = NULL;
static HTAB *relstats = NULL;
-static void relstatsInit();
+static void relstatsInit(
void
);
static int
oid_cmp(const void *a, const void *b)
static int
oid_cmp(const void *a, const void *b)
@@
-645,7
+645,7
@@
onlineAnalyzeHookerUtility(Node *parsetree, const char *queryString,
#endif
static void
#endif
static void
-relstatsInit()
+relstatsInit(
void
)
{
HASHCTL hash_ctl;
int flags = 0;
{
HASHCTL hash_ctl;
int flags = 0;
@@
-666,12
+666,17
@@
relstatsInit()
onlineAnalyzeMemoryContext =
AllocSetContextCreate(CacheMemoryContext,
"online_analyze storage context",
onlineAnalyzeMemoryContext =
AllocSetContextCreate(CacheMemoryContext,
"online_analyze storage context",
- ALLOCSET_DEFAULT_SIZES);
+#if PG_VERSION_NUM < 90600
+ ALLOCSET_DEFAULT_MINSIZE,
+ ALLOCSET_DEFAULT_INITSIZE,
+ ALLOCSET_DEFAULT_MAXSIZE
+#else
+ ALLOCSET_DEFAULT_SIZES
+#endif
+ );
}
}
- hash_ctl.hcxt = AllocSetContextCreate(CacheMemoryContext,
- "online_analyze storage context",
- ALLOCSET_DEFAULT_SIZES);
+ hash_ctl.hcxt = onlineAnalyzeMemoryContext;
flags |= HASH_CONTEXT;
hash_ctl.keysize = sizeof(Oid);
flags |= HASH_CONTEXT;
hash_ctl.keysize = sizeof(Oid);