8000 Use 0-based numbering in comments about backup blocks. · larkly/postgres-docker@0d20252 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d20252

Browse files
committed
Use 0-based numbering in comments about backup blocks.
The macros and functions that work with backup blocks in the redo function use 0-based numbering, so let's use that consistently in the function that generates the records too. Makes it so much easier to compare the generation and replay functions. Backpatch to 9.0, where we switched from 1-based to 0-based numbering.
1 parent 39b3739 commit 0d20252

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
@@ -1222,7 +1222,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12221222
item = (IndexTuple) PageGetItem(origpage, itemid);
12231223
lastrdata->data = (char *) item;
12241224
lastrdata->len = MAXALIGN(IndexTupleSize(item));
1225-
lastrdata->buffer = buf; /* backup block 1 */
1225+
lastrdata->buffer = buf; /* backup block 0 */
12261226
lastrdata->buffer_std = true;
12271227
}
12281228

@@ -1249,7 +1249,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12491249

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

12661266
lastrdata->data = NULL;
12671267
lastrdata->len = 0;
1268-
lastrdata->buffer = buf; /* backup block 1 */
1268+
lastrdata->buffer = buf; /* backup block 0 */
12691269
lastrdata->buffer_std = true;
12701270
}
12711271

@@ -1298,7 +1298,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
12981298

12991299
lastrdata->data = NULL;
13001300
lastrdata->len = 0;
1301-
lastrdata->buffer = sbuf; /* backup block 2 */
1301+
lastrdata->buffer = sbuf; /* backup block 1 */
13021302
lastrdata->buffer_std = true;
13031303
}
13041304

0 commit comments

Comments
 (0)
0