Skip to content

Commit c9f9fdd

Browse files
Konstantin KnizhnikKosntantin Knizhnik
authored andcommitted
Reintialize page in allocNewBuffer only when buffer is returned
1 parent 4cacada commit c9f9fdd

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
@@ -523,10 +523,10 @@ allocNewBuffer(Relation index, int flags)
523523
Buffer buffer;
524524

525525
buffer = SpGistNewBuffer(index);
526-
SpGistInitBuffer(buffer, pageflags);
527526

528527
if (pageflags & SPGIST_LEAF)
529528
{
529+
SpGistInitBuffer(buffer, pageflags);
530530
/* Leaf pages have no parity concerns, so just use it */
531531
return buffer;
532532
}
@@ -537,6 +537,7 @@ allocNewBuffer(Relation index, int flags)
537537

538538
if ((flags & GBUF_PARITY_MASK) == blkFlags)
539539
{
540+
SpGistInitBuffer(buffer, pageflags);
540541
/* Page has right parity, use it */
541542
return buffer;
542543
}

0 commit comments

Comments
 (0)