Skip to content

Commit 9b9cb4b

Browse files
Konstantin KnizhnikKosntantin Knizhnik
authored andcommitted
Reintialize page in allocNewBuffer only when buffer is returned
1 parent ad2b69b commit 9b9cb4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/backend/access/spgist/spgutils.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,10 +515,10 @@ allocNewBuffer(Relation index, int flags)
515515
Buffer buffer;
516516

517517
buffer = SpGistNewBuffer(index);
518-
SpGistInitBuffer(buffer, pageflags);
519518

520519
if (pageflags & SPGIST_LEAF)
521520
{
521+
SpGistInitBuffer(buffer, pageflags);
522522
/* Leaf pages have no parity concerns, so just use it */
523523
return buffer;
524524
}
@@ -529,6 +529,7 @@ allocNewBuffer(Relation index, int flags)
529529

530530
if ((flags & GBUF_PARITY_MASK) == blkFlags)
531531
{
532+
SpGistInitBuffer(buffer, pageflags);
532533
/* Page has right parity, use it */
533534
return buffer;
534535
}

0 commit comments

Comments
 (0)