pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix uninitialized cache use in gtsvector_picksplit()
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix uninitialized cache use in gtsvector_picksplit()
@ 2026-11-11 00:31  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-11 00:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix uninitialized cache use in gtsvector_picksplit()

When a page split involves two entries, the seed selection loop does not
run and the seeds default to entries 1 and 2.  The cache of the last
entry was filled only after the initial union keys were built from it,
hence the right side of the union could be computed from memory that was
not initialized.  This could cause index scans to miss matching rows.

This issue is fixed by filling the cache of the last entry before
forming the initial unions, by moving around a fillcache().

GiST indexes based on tsvector may need a REINDEX, if these are based on
a single column.

Issue spotted originally by valgrind.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19780-93fb5c0e4ec2af18@postgresql.org
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/19a5f3e405da30a6355f60dd8f1ddc497c4016fe

Modified Files
--------------
src/backend/utils/adt/tsgistidx.c     |  6 ++++--
src/test/regress/expected/tsearch.out | 17 +++++++++++++++++
src/test/regress/sql/tsearch.sql      | 13 +++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix uninitialized cache use in gtsvector_picksplit()
@ 2026-11-11 00:31  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-11 00:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix uninitialized cache use in gtsvector_picksplit()

When a page split involves two entries, the seed selection loop does not
run and the seeds default to entries 1 and 2.  The cache of the last
entry was filled only after the initial union keys were built from it,
hence the right side of the union could be computed from memory that was
not initialized.  This could cause index scans to miss matching rows.

This issue is fixed by filling the cache of the last entry before
forming the initial unions, by moving around a fillcache().

GiST indexes based on tsvector may need a REINDEX, if these are based on
a single column.

Issue spotted originally by valgrind.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19780-93fb5c0e4ec2af18@postgresql.org
Backpatch-through: 15

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/21b7a3fd683e2ef1923007fdda93d72d7b611bc3

Modified Files
--------------
src/backend/utils/adt/tsgistidx.c     |  6 ++++--
src/test/regress/expected/tsearch.out | 17 +++++++++++++++++
src/test/regress/sql/tsearch.sql      | 13 +++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix uninitialized cache use in gtsvector_picksplit()
@ 2026-11-11 00:31  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-11 00:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix uninitialized cache use in gtsvector_picksplit()

When a page split involves two entries, the seed selection loop does not
run and the seeds default to entries 1 and 2.  The cache of the last
entry was filled only after the initial union keys were built from it,
hence the right side of the union could be computed from memory that was
not initialized.  This could cause index scans to miss matching rows.

This issue is fixed by filling the cache of the last entry before
forming the initial unions, by moving around a fillcache().

GiST indexes based on tsvector may need a REINDEX, if these are based on
a single column.

Issue spotted originally by valgrind.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19780-93fb5c0e4ec2af18@postgresql.org
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/672081106e339da8abd60a71b3888913fc1a61bf

Modified Files
--------------
src/backend/utils/adt/tsgistidx.c     |  6 ++++--
src/test/regress/expected/tsearch.out | 17 +++++++++++++++++
src/test/regress/sql/tsearch.sql      | 13 +++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix uninitialized cache use in gtsvector_picksplit()
@ 2026-11-11 00:31  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-11 00:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix uninitialized cache use in gtsvector_picksplit()

When a page split involves two entries, the seed selection loop does not
run and the seeds default to entries 1 and 2.  The cache of the last
entry was filled only after the initial union keys were built from it,
hence the right side of the union could be computed from memory that was
not initialized.  This could cause index scans to miss matching rows.

This issue is fixed by filling the cache of the last entry before
forming the initial unions, by moving around a fillcache().

GiST indexes based on tsvector may need a REINDEX, if these are based on
a single column.

Issue spotted originally by valgrind.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19780-93fb5c0e4ec2af18@postgresql.org
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/578f74fd8b6c17e8991db6881c9c26c48e37fa28

Modified Files
--------------
src/backend/utils/adt/tsgistidx.c     |  6 ++++--
src/test/regress/expected/tsearch.out | 17 +++++++++++++++++
src/test/regress/sql/tsearch.sql      | 13 +++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix uninitialized cache use in gtsvector_picksplit()
@ 2026-11-11 00:31  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-11 00:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix uninitialized cache use in gtsvector_picksplit()

When a page split involves two entries, the seed selection loop does not
run and the seeds default to entries 1 and 2.  The cache of the last
entry was filled only after the initial union keys were built from it,
hence the right side of the union could be computed from memory that was
not initialized.  This could cause index scans to miss matching rows.

This issue is fixed by filling the cache of the last entry before
forming the initial unions, by moving around a fillcache().

GiST indexes based on tsvector may need a REINDEX, if these are based on
a single column.

Issue spotted originally by valgrind.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19780-93fb5c0e4ec2af18@postgresql.org
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1d657c6e013e152ed37b42a22ee9f291179ee50f

Modified Files
--------------
src/backend/utils/adt/tsgistidx.c     |  6 ++++--
src/test/regress/expected/tsearch.out | 17 +++++++++++++++++
src/test/regress/sql/tsearch.sql      | 13 +++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Fix uninitialized cache use in gtsvector_picksplit()
@ 2026-11-11 00:31  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: Michael Paquier @ 2026-11-11 00:31 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix uninitialized cache use in gtsvector_picksplit()

When a page split involves two entries, the seed selection loop does not
run and the seeds default to entries 1 and 2.  The cache of the last
entry was filled only after the initial union keys were built from it,
hence the right side of the union could be computed from memory that was
not initialized.  This could cause index scans to miss matching rows.

This issue is fixed by filling the cache of the last entry before
forming the initial unions, by moving around a fillcache().

GiST indexes based on tsvector may need a REINDEX, if these are based on
a single column.

Issue spotted originally by valgrind.

Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Shihao Zhong <zhong950419@gmail.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://postgr.es/m/19780-93fb5c0e4ec2af18@postgresql.org
Backpatch-through: 15

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a9faa96b661fb17c5482bf1952a1740ce1622659

Modified Files
--------------
src/backend/utils/adt/tsgistidx.c     |  6 ++++--
src/test/regress/expected/tsearch.out | 17 +++++++++++++++++
src/test/regress/sql/tsearch.sql      | 13 +++++++++++++
3 files changed, 34 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2026-11-11 00:31 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-11-11 00:31 pgsql: Fix uninitialized cache use in gtsvector_picksplit() Michael Paquier <michael@paquier.xyz>
2026-11-11 00:31 pgsql: Fix uninitialized cache use in gtsvector_picksplit() Michael Paquier <michael@paquier.xyz>
2026-11-11 00:31 pgsql: Fix uninitialized cache use in gtsvector_picksplit() Michael Paquier <michael@paquier.xyz>
2026-11-11 00:31 pgsql: Fix uninitialized cache use in gtsvector_picksplit() Michael Paquier <michael@paquier.xyz>
2026-11-11 00:31 pgsql: Fix uninitialized cache use in gtsvector_picksplit() Michael Paquier <michael@paquier.xyz>
2026-11-11 00:31 pgsql: Fix uninitialized cache use in gtsvector_picksplit() Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox