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

Commit0128a77

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 parent0d4c75f commit0128a77

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
@@ -1221,7 +1221,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12211221
item= (IndexTuple)PageGetItem(origpage,itemid);
12221222
lastrdata->data= (char*)item;
12231223
lastrdata->len=MAXALIGN(IndexTupleSize(item));
1224-
lastrdata->buffer=buf;/* backup block1 */
1224+
lastrdata->buffer=buf;/* backup block0 */
12251225
lastrdata->buffer_std= true;
12261226
}
12271227

@@ -1248,7 +1248,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12481248

12491249
lastrdata->data= (char*)newitem;
12501250
lastrdata->len=MAXALIGN(newitemsz);
1251-
lastrdata->buffer=buf;/* backup block1 */
1251+
lastrdata->buffer=buf;/* backup block0 */
12521252
lastrdata->buffer_std= true;
12531253
}
12541254
elseif (ropaque->btpo.level==0)
@@ -1257,14 +1257,14 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12571257
* Although we don't need to WAL-log the new item, we still need
12581258
* XLogInsert to consider storing a full-page image of the left
12591259
* page, so make an empty entry referencing that buffer. This also
1260-
* ensures that the left page is always backup block1.
1260+
* ensures that the left page is always backup block0.
12611261
*/
12621262
lastrdata->next=lastrdata+1;
12631263
lastrdata++;
12641264

12651265
lastrdata->data=NULL;
12661266
lastrdata->len=0;
1267-
lastrdata->buffer=buf;/* backup block1 */
1267+
lastrdata->buffer=buf;/* backup block0 */
12681268
lastrdata->buffer_std= true;
12691269
}
12701270

@@ -1297,7 +1297,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12971297

12981298
lastrdata->data=NULL;
12991299
lastrdata->len=0;
1300-
lastrdata->buffer=sbuf;/* backup block2 */
1300+
lastrdata->buffer=sbuf;/* backup block1 */
13011301
lastrdata->buffer_std= true;
13021302
}
13031303

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp