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

Commit7b60468

Browse files
committed
Fix variable initialization when using buffering build with GiST
This can cause valgrind to complain, as the flag marking a buffer as atemporary copy was not getting initialized.While on it, fill in with zeros newly-created buffer pages. This doesnot matter when loading a block from a temporary file, but it makes thepush of an index tuple into a new buffer page safer.This has been introduced by1d27dcf, so backpatch all the way down to9.4.Author: Alexander LakhinDiscussion:https://postgr.es/m/15899-0d24fb273b3dd90c@postgresql.orgBackpatch-through: 9.4
1 parentd49c127 commit7b60468

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎src/backend/access/gist/gistbuildbuffers.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
140140
nodeBuffer->pageBlocknum=InvalidBlockNumber;
141141
nodeBuffer->pageBuffer=NULL;
142142
nodeBuffer->queuedForEmptying= false;
143+
nodeBuffer->isTemp= false;
143144
nodeBuffer->level=level;
144145

145146
/*
@@ -188,8 +189,8 @@ gistAllocateNewPageBuffer(GISTBuildBuffers *gfbb)
188189
{
189190
GISTNodeBufferPage*pageBuffer;
190191

191-
pageBuffer= (GISTNodeBufferPage*)MemoryContextAlloc(gfbb->context,
192-
BLCKSZ);
192+
pageBuffer= (GISTNodeBufferPage*)MemoryContextAllocZero(gfbb->context,
193+
BLCKSZ);
193194
pageBuffer->prev=InvalidBlockNumber;
194195

195196
/* Set page free space */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp