1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

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
This commit is contained in:
Bruce Momjian
2001-05-15 14:14:49 +00:00
parent 3848a14ed7
commit d0e1091cfd
2 changed files with 18 additions and 11 deletions

View File

@ -241,16 +241,16 @@ gistindex_keytest(IndexTuple tuple,
1,
tupdesc,
&isNull);
gistdentryinit(giststate, &de, (char *) datum, r, p, offset,
IndexTupleSize(tuple) - sizeof(IndexTupleData),
FALSE);
if (isNull)
if (isNull || IndexTupleSize(tuple) == sizeof(IndexTupleData) )
{
/* XXX eventually should check if SK_ISNULL */
return false;
}
gistdentryinit(giststate, &de, (char *) datum, r, p, offset,
IndexTupleSize(tuple) - sizeof(IndexTupleData),
FALSE);
if (key[0].sk_flags & SK_COMMUTE)
{
test = FunctionCall3(&key[0].sk_func,
@ -266,6 +266,9 @@ gistindex_keytest(IndexTuple tuple,
ObjectIdGetDatum(key[0].sk_procedure));
}
if ( (char*)de.pred != (char*)datum )
if ( de.pred ) pfree( de.pred );
if (DatumGetBool(test) == !!(key[0].sk_flags & SK_NEGATE))
return false;