Skip to content

Commit dd62f56

Browse files
author
Konstantin Knizhnik
committed
Reintialize page in allocNewBuffer only when buffer is returned
1 parent db424d4 commit dd62f56

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
@@ -517,10 +517,10 @@ allocNewBuffer(Relation index, int flags)
517517
Buffer buffer;
518518

519519
buffer = SpGistNewBuffer(index);
520-
SpGistInitBuffer(buffer, pageflags);
521520

522521
if (pageflags & SPGIST_LEAF)
523522
{
523+
SpGistInitBuffer(buffer, pageflags);
524524
/* Leaf pages have no parity concerns, so just use it */
525525
return buffer;
526526
}
@@ -531,6 +531,7 @@ allocNewBuffer(Relation index, int flags)
531531

532532
if ((flags & GBUF_PARITY_MASK) == blkFlags)
533533
{
534+
SpGistInitBuffer(buffer, pageflags);
534535
/* Page has right parity, use it */
535536
return buffer;
536537
}

0 commit comments

Comments
 (0)