Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitde9b43f

Browse files
committed
Back-patch fix for 'btree: failed to add item to the page in _bt_sort (2)'
failure during index creation. This problem should be gone in currentsources, but I just thought I'd commit the 7.0.* patch in case anyoneelse needs it.
1 parenta860a40 commitde9b43f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎src/backend/access/nbtree/nbtsort.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* Portions Copyright (c) 1994, Regents of the University of California
2929
*
3030
* IDENTIFICATION
31-
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.52 2000/04/12 17:14:49momjian Exp $
31+
* $Header: /cvsroot/pgsql/src/backend/access/nbtree/nbtsort.c,v 1.52.2.1 2001/01/04 21:51:49tgl Exp $
3232
*
3333
*-------------------------------------------------------------------------
3434
*/
@@ -321,7 +321,7 @@ _bt_buildadd(Relation index, Size keysz, ScanKey scankey,
321321
btisz,
322322
(PageGetPageSize(npage)-sizeof(PageHeaderData)-MAXALIGN(sizeof(BTPageOpaqueData))) /3-sizeof(ItemIdData));
323323

324-
if (pgspc<btisz)
324+
while (pgspc<btisz)
325325
{
326326
Bufferobuf=nbuf;
327327
Pageopage=npage;
@@ -436,6 +436,13 @@ _bt_buildadd(Relation index, Size keysz, ScanKey scankey,
436436
* we aren't locking).
437437
*/
438438
_bt_wrtbuf(index,obuf);
439+
440+
/*
441+
* Recompute pgspc and loop back to check free space again. If
442+
* we were forced to split at a bad split point, we might need
443+
* to split again.
444+
*/
445+
pgspc=PageGetFreeSpace(npage);
439446
}
440447

441448
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp