mirror of
https://github.com/postgres/postgres.git
synced 2025-05-17 06:41:24 +03:00
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.
This commit is contained in:
parent
777d07d7a3
commit
e0c04b7c38
@ -1230,7 +1230,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
|
|||||||
item = (IndexTuple) PageGetItem(origpage, itemid);
|
item = (IndexTuple) PageGetItem(origpage, itemid);
|
||||||
lastrdata->data = (char *) item;
|
lastrdata->data = (char *) item;
|
||||||
lastrdata->len = MAXALIGN(IndexTupleSize(item));
|
lastrdata->len = MAXALIGN(IndexTupleSize(item));
|
||||||
lastrdata->buffer = buf; /* backup block 1 */
|
lastrdata->buffer = buf; /* backup block 0 */
|
||||||
lastrdata->buffer_std = true;
|
lastrdata->buffer_std = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1257,7 +1257,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
|
|||||||
|
|
||||||
lastrdata->data = (char *) newitem;
|
lastrdata->data = (char *) newitem;
|
||||||
lastrdata->len = MAXALIGN(newitemsz);
|
lastrdata->len = MAXALIGN(newitemsz);
|
||||||
lastrdata->buffer = buf; /* backup block 1 */
|
lastrdata->buffer = buf; /* backup block 0 */
|
||||||
lastrdata->buffer_std = true;
|
lastrdata->buffer_std = true;
|
||||||
}
|
}
|
||||||
else if (ropaque->btpo.level == 0)
|
else if (ropaque->btpo.level == 0)
|
||||||
@ -1266,14 +1266,14 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
|
|||||||
* Although we don't need to WAL-log the new item, we still need
|
* Although we don't need to WAL-log the new item, we still need
|
||||||
* XLogInsert to consider storing a full-page image of the left
|
* XLogInsert to consider storing a full-page image of the left
|
||||||
* page, so make an empty entry referencing that buffer. This also
|
* page, so make an empty entry referencing that buffer. This also
|
||||||
* ensures that the left page is always backup block 1.
|
* ensures that the left page is always backup block 0.
|
||||||
*/
|
*/
|
||||||
lastrdata->next = lastrdata + 1;
|
lastrdata->next = lastrdata + 1;
|
||||||
lastrdata++;
|
lastrdata++;
|
||||||
|
|
||||||
lastrdata->data = NULL;
|
lastrdata->data = NULL;
|
||||||
lastrdata->len = 0;
|
lastrdata->len = 0;
|
||||||
lastrdata->buffer = buf; /* backup block 1 */
|
lastrdata->buffer = buf; /* backup block 0 */
|
||||||
lastrdata->buffer_std = true;
|
lastrdata->buffer_std = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1306,7 +1306,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
|
|||||||
|
|
||||||
lastrdata->data = NULL;
|
lastrdata->data = NULL;
|
||||||
lastrdata->len = 0;
|
lastrdata->len = 0;
|
||||||
lastrdata->buffer = sbuf; /* backup block 2 */
|
lastrdata->buffer = sbuf; /* backup block 1 */
|
||||||
lastrdata->buffer_std = true;
|
lastrdata->buffer_std = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user