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

Commite0c04b7

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 parent777d07d commite0c04b7

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
@@ -1230,7 +1230,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12301230
item= (IndexTuple)PageGetItem(origpage,itemid);
12311231
lastrdata->data= (char*)item;
12321232
lastrdata->len=MAXALIGN(IndexTupleSize(item));
1233-
lastrdata->buffer=buf;/* backup block1 */
1233+
lastrdata->buffer=buf;/* backup block0 */
12341234
lastrdata->buffer_std= true;
12351235
}
12361236

@@ -1257,7 +1257,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12571257

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

12741274
lastrdata->data=NULL;
12751275
lastrdata->len=0;
1276-
lastrdata->buffer=buf;/* backup block1 */
1276+
lastrdata->buffer=buf;/* backup block0 */
12771277
lastrdata->buffer_std= true;
12781278
}
12791279

@@ -1306,7 +1306,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
13061306

13071307
lastrdata->data=NULL;
13081308
lastrdata->len=0;
1309-
lastrdata->buffer=sbuf;/* backup block2 */
1309+
lastrdata->buffer=sbuf;/* backup block1 */
13101310
lastrdata->buffer_std= true;
13111311
}
13121312

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp