Commit 4844adc8 authored by Marc G. Fournier's avatar Marc G. Fournier

Fixes;

 Postgres is not able to cluster a relation on which an rtree index is
 defined. Postmaster gives the following error message:

 Too Large Allocation Request("!(0 < (size) && (size) <= (0xfffffff)):size=0
 [0x0]", File:"/export/home/postgres/src/backend/utils/mmgr/mcxt.c", Line: 220)
  !(0 <(size) && (size) <= (0xfffffff)) (0) [No such file or directory]

Submitted by: Dirk Koeser <koeser@informatik.uni-rostock.de>
parent bde34552
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.1.1.1 1996/07/09 06:21:13 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/access/rtree/Attic/rtscan.c,v 1.2 1996/08/15 07:30:22 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -122,15 +122,13 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key) ...@@ -122,15 +122,13 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
} else { } else {
/* initialize opaque data */ /* initialize opaque data */
p = (RTreeScanOpaque) palloc(sizeof(RTreeScanOpaqueData)); p = (RTreeScanOpaque) palloc(sizeof(RTreeScanOpaqueData));
p->s_internalKey =
(ScanKey) palloc(sizeof(ScanKeyData) * s->numberOfKeys);
p->s_stack = p->s_markstk = (RTSTACK *) NULL; p->s_stack = p->s_markstk = (RTSTACK *) NULL;
p->s_internalNKey = s->numberOfKeys; p->s_internalNKey = s->numberOfKeys;
p->s_flags = 0x0; p->s_flags = 0x0;
for (i = 0; i < s->numberOfKeys; i++)
p->s_internalKey[i].sk_argument = s->keyData[i].sk_argument;
s->opaque = p; s->opaque = p;
if (s->numberOfKeys > 0) { if (s->numberOfKeys > 0) {
p->s_internalKey =
(ScanKey) palloc(sizeof(ScanKeyData) * s->numberOfKeys);
/* /*
* Scans on internal pages use different operators than they * Scans on internal pages use different operators than they
...@@ -140,6 +138,7 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key) ...@@ -140,6 +138,7 @@ rtrescan(IndexScanDesc s, bool fromEnd, ScanKey key)
*/ */
for (i = 0; i < s->numberOfKeys; i++) { for (i = 0; i < s->numberOfKeys; i++) {
p->s_internalKey[i].sk_argument = s->keyData[i].sk_argument;
internal_proc = RTMapOperator(s->relation, internal_proc = RTMapOperator(s->relation,
s->keyData[i].sk_attno, s->keyData[i].sk_attno,
s->keyData[i].sk_procedure); s->keyData[i].sk_procedure);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment