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

Commit42279b2

Browse files
committed
Use 0-based numbering in comments about backup blocks.
The macros and functions that work with backup blocks in the redo functionuse 0-based numbering, so let's use that consistently in the function thatgenerates the records too. Makes it so much easier to compare thegeneration and replay functions.Backpatch to 9.0, where we switched from 1-based to 0-based numbering.
1 parent0fc9434 commit42279b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12101210
item= (IndexTuple)PageGetItem(origpage,itemid);
12111211
lastrdata->data= (char*)item;
12121212
lastrdata->len=MAXALIGN(IndexTupleSize(item));
1213-
lastrdata->buffer=buf;/* backup block1 */
1213+
lastrdata->buffer=buf;/* backup block0 */
12141214
lastrdata->buffer_std= true;
12151215
}
12161216

@@ -1237,7 +1237,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12371237

12381238
lastrdata->data= (char*)newitem;
12391239
lastrdata->len=MAXALIGN(newitemsz);
1240-
lastrdata->buffer=buf;/* backup block1 */
1240+
lastrdata->buffer=buf;/* backup block0 */
12411241
lastrdata->buffer_std= true;
12421242
}
12431243
elseif (ropaque->btpo.level==0)
@@ -1246,14 +1246,14 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12461246
* Although we don't need to WAL-log the new item, we still need
12471247
* XLogInsert to consider storing a full-page image of the left
12481248
* page, so make an empty entry referencing that buffer. This also
1249-
* ensures that the left page is always backup block1.
1249+
* ensures that the left page is always backup block0.
12501250
*/
12511251
lastrdata->next=lastrdata+1;
12521252
lastrdata++;
12531253

12541254
lastrdata->data=NULL;
12551255
lastrdata->len=0;
1256-
lastrdata->buffer=buf;/* backup block1 */
1256+
lastrdata->buffer=buf;/* backup block0 */
12571257
lastrdata->buffer_std= true;
12581258
}
12591259

@@ -1286,7 +1286,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12861286

12871287
lastrdata->data=NULL;
12881288
lastrdata->len=0;
1289-
lastrdata->buffer=sbuf;/* backup block2 */
1289+
lastrdata->buffer=sbuf;/* backup block1 */
12901290
lastrdata->buffer_std= true;
12911291
}
12921292

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp