projects
/
gevel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bf5ed50
)
fix support nulls for versions >= 9.1
author
Teodor Sigaev
<teodor@sigaev.ru>
Thu, 12 Nov 2015 21:40:44 +0000
(
00:40
+0300)
committer
Teodor Sigaev
<teodor@sigaev.ru>
Thu, 12 Nov 2015 21:40:44 +0000
(
00:40
+0300)
gevel.c
patch
|
blob
|
history
diff --git
a/gevel.c
b/gevel.c
index
b464de0
..
f0e3738
100644
(file)
--- a/
gevel.c
+++ b/
gevel.c
@@
-625,7
+625,7
@@
refindPosition(GinStatState *st)
#endif
if ( cmp == 0 )
{
#endif
if ( cmp == 0 )
{
- if ( !st->index->rd_att->attrs[st->attnum]->attbyval )
+ if (
st->curval &&
!st->index->rd_att->attrs[st->attnum]->attbyval )
pfree( (void*) st->curval );
return true;
}
pfree( (void*) st->curval );
return true;
}
@@
-683,14
+683,24
@@
gin_setup_firstcall(FuncCallContext *funcctx, text *name, int attnum) {
static void
processTuple( FuncCallContext *funcctx, GinStatState *st, IndexTuple itup ) {
MemoryContext oldcontext;
static void
processTuple( FuncCallContext *funcctx, GinStatState *st, IndexTuple itup ) {
MemoryContext oldcontext;
-#if PG_VERSION_NUM < 80400
+#if PG_VERSION_NUM >= 90100
+ Datum key;
+#elif PG_VERSION_NUM < 80400
bool isnull;
#endif
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
bool isnull;
#endif
oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx);
+
+#if PG_VERSION_NUM >= 90100
+ key = gintuple_get_key(&st->ginstate, itup, &st->category);
+
+ if (st->category != GIN_CAT_NORM_KEY)
+ st->curval = (Datum)0;
+ else
+#endif
st->curval = datumCopy(
#if PG_VERSION_NUM >= 90100
st->curval = datumCopy(
#if PG_VERSION_NUM >= 90100
-
gintuple_get_key(&st->ginstate, itup, &st->category)
,
+
key
,
#elif PG_VERSION_NUM >= 80400
gin_index_getattr(&st->ginstate, itup),
#else
#elif PG_VERSION_NUM >= 80400
gin_index_getattr(&st->ginstate, itup),
#else