|
6 | 6 | *
|
7 | 7 | *
|
8 | 8 | * IDENTIFICATION
|
9 |
| - * /usr/local/devel/pglite/cvs/src/backend/access/gisr/gistget.c,v 1.9 1995/08/01 20:16:02 jolly Exp |
| 9 | + * /usr/local/devel/pglite/cvs/src/backend/access/gisr/gistget.c,v 1.9.1 1996/11/21 01:00:00 vadim Exp |
10 | 10 | *
|
11 | 11 | *-------------------------------------------------------------------------
|
12 | 12 | */
|
@@ -67,7 +67,6 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
|
67 | 67 | GISTSTACK*stk;
|
68 | 68 | BlockNumberblk;
|
69 | 69 | IndexTupleit;
|
70 |
| -ItemPointerip; |
71 | 70 |
|
72 | 71 | b=ReadBuffer(s->relation,GISTP_ROOT);
|
73 | 72 | p=BufferGetPage(b);
|
@@ -107,13 +106,10 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
|
107 | 106 | ItemPointerSet(&(s->currentItemData),BufferGetBlockNumber(b),n);
|
108 | 107 |
|
109 | 108 | it= (IndexTuple)PageGetItem(p,PageGetItemId(p,n));
|
110 |
| -ip= (ItemPointer)palloc(sizeof(ItemPointerData)); |
111 |
| -memmove((char*)ip, (char*)&(it->t_tid), |
112 |
| -sizeof(ItemPointerData)); |
113 |
| -ReleaseBuffer(b); |
114 |
| - |
115 |
| -res=FormRetrieveIndexResult(&(s->currentItemData),ip); |
| 109 | + |
| 110 | +res=FormRetrieveIndexResult(&(s->currentItemData),&(it->t_tid)); |
116 | 111 |
|
| 112 | +ReleaseBuffer(b); |
117 | 113 | return (res);
|
118 | 114 | }else {
|
119 | 115 | stk= (GISTSTACK*)palloc(sizeof(GISTSTACK));
|
@@ -146,7 +142,6 @@ gistnext(IndexScanDesc s, ScanDirection dir)
|
146 | 142 | GISTSTACK*stk;
|
147 | 143 | BlockNumberblk;
|
148 | 144 | IndexTupleit;
|
149 |
| -ItemPointerip; |
150 | 145 |
|
151 | 146 | blk=ItemPointerGetBlockNumber(&(s->currentItemData));
|
152 | 147 | n=ItemPointerGetOffsetNumber(&(s->currentItemData));
|
@@ -192,13 +187,10 @@ gistnext(IndexScanDesc s, ScanDirection dir)
|
192 | 187 | ItemPointerSet(&(s->currentItemData),BufferGetBlockNumber(b),n);
|
193 | 188 |
|
194 | 189 | it= (IndexTuple)PageGetItem(p,PageGetItemId(p,n));
|
195 |
| -ip= (ItemPointer)palloc(sizeof(ItemPointerData)); |
196 |
| -memmove((char*)ip, (char*)&(it->t_tid), |
197 |
| -sizeof(ItemPointerData)); |
198 |
| -ReleaseBuffer(b); |
199 | 190 |
|
200 |
| -res=FormRetrieveIndexResult(&(s->currentItemData),ip); |
| 191 | +res=FormRetrieveIndexResult(&(s->currentItemData),&(it->t_tid)); |
201 | 192 |
|
| 193 | +ReleaseBuffer(b); |
202 | 194 | return (res);
|
203 | 195 | }else {
|
204 | 196 | stk= (GISTSTACK*)palloc(sizeof(GISTSTACK));
|
@@ -340,6 +332,8 @@ gistscancache(IndexScanDesc s, ScanDirection dir)
|
340 | 332 | res=FormRetrieveIndexResult(&(s->currentItemData),ip);
|
341 | 333 | else
|
342 | 334 | res= (RetrieveIndexResult)NULL;
|
| 335 | + |
| 336 | +pfree (ip); |
343 | 337 |
|
344 | 338 | return (res);
|
345 | 339 | }
|
|