Skip to content

Commit 42279b2

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 0fc9434 commit 42279b2

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 block 1 */
1213+
lastrdata->buffer = buf; /* backup block 0 */
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 block 1 */
1240+
lastrdata->buffer = buf; /* backup block 0 */
12411241
lastrdata->buffer_std = true;
12421242
}
12431243
else if (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 block 1.
1249+
* ensures that the left page is always backup block 0.
12501250
*/
12511251
lastrdata->next = lastrdata + 1;
12521252
lastrdata++;
12531253

12541254
lastrdata->data = NULL;
12551255
lastrdata->len = 0;
1256-
lastrdata->buffer = buf; /* backup block 1 */
1256+
lastrdata->buffer = buf; /* backup block 0 */
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 block 2 */
1289+
lastrdata->buffer = sbuf; /* backup block 1 */
12901290
lastrdata->buffer_std = true;
12911291
}
12921292

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy