aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-05-15 14:14:49 +0000
committerBruce Momjian <bruce@momjian.us>2001-05-15 14:14:49 +0000
commitd0e1091cfd2f69c0b1056c7e14281299f70b5679 (patch)
tree873e28cf3a20810102e3d5ea09f5115800875d77 /src/backend/access/gist/gist.c
parent3848a14ed7014bd6df0dfe8dedbeb545eb331e82 (diff)
downloadpostgresql-d0e1091cfd2f69c0b1056c7e14281299f70b5679.tar.gz
postgresql-d0e1091cfd2f69c0b1056c7e14281299f70b5679.zip
we found a problem in GiST with massive insert/update operations
with many NULLs ( inserting of NULL into indexed field cause ERROR: MemoryContextAlloc: invalid request size) As a workaround 'vacuum analyze' could be used. This patch resolves the problem, please upply to 7.1.1 sources and current cvs tree. Oleg Bartunov
Diffstat (limited to 'src/backend/access/gist/gist.c')
-rw-r--r--src/backend/access/gist/gist.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/backend/access/gist/gist.c b/src/backend/access/gist/gist.c
index 8e7b530dea5..4b239c76c8b 100644
--- a/src/backend/access/gist/gist.c
+++ b/src/backend/access/gist/gist.c
@@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.75 2001/05/15 03:49:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/access/gist/gist.c,v 1.76 2001/05/15 14:14:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1199,13 +1199,17 @@ gistdentryinit(GISTSTATE *giststate, GISTENTRY *e, char *pr, Relation r,
gistentryinit(*e, pr, r, pg, o, b, l);
if (giststate->haskeytype)
{
- dep = (GISTENTRY *)
- DatumGetPointer(FunctionCall1(&giststate->decompressFn,
+ if ( b ) {
+ dep = (GISTENTRY *)
+ DatumGetPointer(FunctionCall1(&giststate->decompressFn,
PointerGetDatum(e)));
- gistentryinit(*e, dep->pred, dep->rel, dep->page, dep->offset, dep->bytes,
+ gistentryinit(*e, dep->pred, dep->rel, dep->page, dep->offset, dep->bytes,
dep->leafkey);
- if (dep != e)
- pfree(dep);
+ if (dep != e)
+ pfree(dep);
+ } else {
+ gistentryinit(*e, (char*)NULL, r, pg, o, 0, l);
+ }
}
}