|
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.14 2006/03/31 23:32:05 tgl Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/access/gist/gistxlog.c,v 1.15 2006/04/03 16:45:50 tgl Exp $ |
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
14 | 14 | #include"postgres.h"
|
@@ -173,12 +173,25 @@ decodePageUpdateRecord(PageUpdateRecord *decoded, XLogRecord *record)
|
173 | 173 | staticvoid
|
174 | 174 | gistRedoPageUpdateRecord(XLogRecPtrlsn,XLogRecord*record,boolisnewroot)
|
175 | 175 | {
|
| 176 | +gistxlogPageUpdate*xldata= (gistxlogPageUpdate*)XLogRecGetData(record); |
176 | 177 | PageUpdateRecordxlrec;
|
177 | 178 | Relationreln;
|
178 | 179 | Bufferbuffer;
|
179 | 180 | Pagepage;
|
180 | 181 |
|
181 |
| -/* nothing to do if whole page was backed up (and no info to do it with) */ |
| 182 | +/* we must fix incomplete_inserts list even if XLR_BKP_BLOCK_1 is set */ |
| 183 | +if (ItemPointerIsValid(&(xldata->key))) |
| 184 | +{ |
| 185 | +if (incomplete_inserts!=NIL) |
| 186 | +forgetIncompleteInsert(xldata->node,xldata->key); |
| 187 | + |
| 188 | +if (!isnewroot&&xldata->blkno!=GIST_ROOT_BLKNO) |
| 189 | +pushIncompleteInsert(xldata->node,lsn,xldata->key, |
| 190 | +&(xldata->blkno),1, |
| 191 | +NULL); |
| 192 | +} |
| 193 | + |
| 194 | +/* nothing else to do if page was backed up (and no info to do it with) */ |
182 | 195 | if (record->xl_info&XLR_BKP_BLOCK_1)
|
183 | 196 | return;
|
184 | 197 |
|
@@ -237,17 +250,6 @@ gistRedoPageUpdateRecord(XLogRecPtr lsn, XLogRecord *record, bool isnewroot)
|
237 | 250 | PageSetTLI(page,ThisTimeLineID);
|
238 | 251 | MarkBufferDirty(buffer);
|
239 | 252 | UnlockReleaseBuffer(buffer);
|
240 |
| - |
241 |
| -if (ItemPointerIsValid(&(xlrec.data->key))) |
242 |
| -{ |
243 |
| -if (incomplete_inserts!=NIL) |
244 |
| -forgetIncompleteInsert(xlrec.data->node,xlrec.data->key); |
245 |
| - |
246 |
| -if (!isnewroot&&xlrec.data->blkno!=GIST_ROOT_BLKNO) |
247 |
| -pushIncompleteInsert(xlrec.data->node,lsn,xlrec.data->key, |
248 |
| -&(xlrec.data->blkno),1, |
249 |
| -NULL); |
250 |
| -} |
251 | 253 | }
|
252 | 254 |
|
253 | 255 | staticvoid
|
|