gistchoose_fix-1.patch

application/octet-stream

Filename: gistchoose_fix-1.patch
Type: application/octet-stream
Part: 0
Message: Fix for gistchoose

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/backend/access/gist/gistbuildbuffers.c 0 0
src/backend/access/gist/gistutil.c 0 0
diff --git a/src/backend/access/gist/gistbuildbuffers.c b/src/backend/access/gist/gistbuildbuffers.c
new file mode 100644
index 39aec85..e8deb80
*** a/src/backend/access/gist/gistbuildbuffers.c
--- b/src/backend/access/gist/gistbuildbuffers.c
*************** gistRelocateBuildBuffersOnSplit(GISTBuil
*** 666,672 ****
  				{
  					which = i;
  					which_grow[j] = usize;
! 					if (j < r->rd_att->natts - 1 && i == 0)
  						which_grow[j + 1] = -1;
  					sum_grow += which_grow[j];
  				}
--- 666,672 ----
  				{
  					which = i;
  					which_grow[j] = usize;
! 					if (j < r->rd_att->natts - 1)
  						which_grow[j + 1] = -1;
  					sum_grow += which_grow[j];
  				}
diff --git a/src/backend/access/gist/gistutil.c b/src/backend/access/gist/gistutil.c
new file mode 100644
index df1e2e3..f0a5872
*** a/src/backend/access/gist/gistutil.c
--- b/src/backend/access/gist/gistutil.c
*************** gistchoose(Relation r, Page p, IndexTupl
*** 411,417 ****
  			{
  				which = i;
  				which_grow[j] = usize;
! 				if (j < r->rd_att->natts - 1 && i == FirstOffsetNumber)
  					which_grow[j + 1] = -1;
  				sum_grow += which_grow[j];
  			}
--- 411,417 ----
  			{
  				which = i;
  				which_grow[j] = usize;
! 				if (j < r->rd_att->natts - 1)
  					which_grow[j + 1] = -1;
  				sum_grow += which_grow[j];
  			}