Fix GiST buffering build to work when there are included columns.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Oct 2020 22:01:34 +0000 (18:01 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Oct 2020 22:01:34 +0000 (18:01 -0400)
commit962ab473ec3d4c1090ba75fa677167126956c1ee
treeb35ac0e571019ac68ffee84f4426b8b78ca88c68
parent9343bfefa4514e5623cfc2610c44e3d93d776e64
Fix GiST buffering build to work when there are included columns.

gistRelocateBuildBuffersOnSplit did not get the memo about which
attribute count to use.  This could lead to a crash if there were
included columns and buffering build was chosen.  (Because there
are random page-split decisions elsewhere in GiST index build,
the crashes are not entirely deterministic.)

Back-patch to v12 where GiST gained support for included columns.

Pavel Borisov

Discussion: https://postgr.es/m/CALT9ZEECCV5m7wvxg46PC-7x-EybUmnpupBGhSFMoAAay+r6HQ@mail.gmail.com
src/backend/access/gist/gistbuildbuffers.c