8000 Fix missing initialization of buffer_std field in _bt_newroot(). · eldilibra/postgres@9561f6e · GitHub
[go: up one dir, main page]

Skip to content

Commit 9561f6e

Browse files
committed
Fix missing initialization of buffer_std field in _bt_newroot().
This would only have any effect if the old root page needed to have a full-page image made (ie, this was the first mod to it since a checkpoint), *and* if the byte left uninitialized chanced to contain zero. In that case the WAL code would fail to remove the "hole" from the full-page image, which would bloat the WAL log a bit but not have any effect worse than that. Found by buildfarm member skink, whose valgrind run noticed the use of an uninitialized value. Apparently timing in the regression tests is such that the triggering condition is rare, or valgrind testing would have seen this before. Oversight in commit 40dae7e. This bug affects only the 9.4 branch, since in later branches refactoring of the WAL-log-creation APIs fixed it. Report: <20160521203101.jp5yxquhhkabvo56@alap3.anarazel.de>
1 parent e0ca9a4 commit 9561f6e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/backend/access/nbtree/nbtinsert.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,6 +2118,7 @@ _bt_newroot(Relation rel, Buffer lbuf, Buffer rbuf)
21182118
rdata[2].data = NULL;
21192119
rdata[2].len = 0;
21202120
rdata[2].buffer = lbuf;
2121+
rdata[2].buffer_std = true;
21212122
rdata[2].next = NULL;
21222123

21232124
recptr = XLogInsert(RM_BTREE_ID, XLOG_BTREE_NEWROOT, rdata);

0 commit comments

Comments
 (0)
0