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

Commitfa19a08

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 parent5a7d697 commitfa19a08

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
@@ -138,6 +138,7 @@ gistGetNodeBuffer(GISTBuildBuffers *gfbb, GISTSTATE *giststate,
138138
nodeBuffer->pageBlocknum=InvalidBlockNumber;
139139
nodeBuffer->pageBuffer=NULL;
140140
nodeBuffer->queuedForEmptying= false;
141+
nodeBuffer->isTemp= false;
141142
nodeBuffer->level=level;
142143

143144
/*
@@ -186,8 +187,8 @@ gistAllocateNewPageBuffer(GISTBuildBuffers *gfbb)
186187
{
187188
GISTNodeBufferPage*pageBuffer;
188189

189-
pageBuffer= (GISTNodeBufferPage*)MemoryContextAlloc(gfbb->context,
190-
BLCKSZ);
190+
pageBuffer= (GISTNodeBufferPage*)MemoryContextAllocZero(gfbb->context,
191+
BLCKSZ);
191192
pageBuffer->prev=InvalidBlockNumber;
192193

193194
/* Set page free space */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp