pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
@ 2022-04-21 00:18  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2022-04-21 00:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix CLUSTER tuplesorts on abbreviated expressions.

CLUSTER sort won't use the datum1 SortTuple field when clustering
against an index whose leading key is an expression.  This makes it
unsafe to use the abbreviated keys optimization, which was missed by the
logic that sets up SortSupport state.  Affected tuplesorts output tuples
in a completely bogus order as a result (the wrong SortSupport based
comparator was used for the leading attribute).

This issue is similar to the bug fixed on the master branch by recent
commit cc58eecc5d.  But it's a far older issue, that dates back to the
introduction of the abbreviated keys optimization by commit 4ea51cdfe8.

Backpatch to all supported versions.

Author: Peter Geoghegan <pg@bowt.ie>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.com
Backpatch: 10-

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1272630a249798a0fce6a00383c78f8129434523

Modified Files
--------------
src/backend/utils/sort/tuplesort.c    |  4 +++-
src/test/regress/expected/cluster.out | 14 ++++++++++++++
src/test/regress/sql/cluster.sql      |  6 ++++++
3 files changed, 23 insertions(+), 1 deletion(-)



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

* pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
@ 2022-04-21 00:18  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2022-04-21 00:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix CLUSTER tuplesorts on abbreviated expressions.

CLUSTER sort won't use the datum1 SortTuple field when clustering
against an index whose leading key is an expression.  This makes it
unsafe to use the abbreviated keys optimization, which was missed by the
logic that sets up SortSupport state.  Affected tuplesorts output tuples
in a completely bogus order as a result (the wrong SortSupport based
comparator was used for the leading attribute).

This issue is similar to the bug fixed on the master branch by recent
commit cc58eecc5d.  But it's a far older issue, that dates back to the
introduction of the abbreviated keys optimization by commit 4ea51cdfe8.

Backpatch to all supported versions.

Author: Peter Geoghegan <pg@bowt.ie>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.com
Backpatch: 10-

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/utils/sort/tuplesort.c    |   4 +-
src/test/regress/expected/cluster.out | 121 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql      |  43 ++++++++++++
3 files changed, 167 insertions(+), 1 deletion(-)



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

* pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
@ 2022-04-21 00:18  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2022-04-21 00:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix CLUSTER tuplesorts on abbreviated expressions.

CLUSTER sort won't use the datum1 SortTuple field when clustering
against an index whose leading key is an expression.  This makes it
unsafe to use the abbreviated keys optimization, which was missed by the
logic that sets up SortSupport state.  Affected tuplesorts output tuples
in a completely bogus order as a result (the wrong SortSupport based
comparator was used for the leading attribute).

This issue is similar to the bug fixed on the master branch by recent
commit cc58eecc5d.  But it's a far older issue, that dates back to the
introduction of the abbreviated keys optimization by commit 4ea51cdfe8.

Backpatch to all supported versions.

Author: Peter Geoghegan <pg@bowt.ie>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.com
Backpatch: 10-

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/8ab0ebb9a842dc6063d1374a38b47a3b7ee64afe

Modified Files
--------------
src/backend/utils/sort/tuplesort.c    |  8 ++++----
src/test/regress/expected/cluster.out | 14 ++++++++++++++
src/test/regress/sql/cluster.sql      |  6 ++++++
3 files changed, 24 insertions(+), 4 deletions(-)



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

* pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
@ 2022-04-21 00:18  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2022-04-21 00:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix CLUSTER tuplesorts on abbreviated expressions.

CLUSTER sort won't use the datum1 SortTuple field when clustering
against an index whose leading key is an expression.  This makes it
unsafe to use the abbreviated keys optimization, which was missed by the
logic that sets up SortSupport state.  Affected tuplesorts output tuples
in a completely bogus order as a result (the wrong SortSupport based
comparator was used for the leading attribute).

This issue is similar to the bug fixed on the master branch by recent
commit cc58eecc5d.  But it's a far older issue, that dates back to the
introduction of the abbreviated keys optimization by commit 4ea51cdfe8.

Backpatch to all supported versions.

Author: Peter Geoghegan <pg@bowt.ie>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.com
Backpatch: 10-

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/utils/sort/tuplesort.c    |   4 +-
src/test/regress/expected/cluster.out | 121 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/cluster.sql      |  43 ++++++++++++
3 files changed, 167 insertions(+), 1 deletion(-)



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

* pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
@ 2022-04-21 00:18  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2022-04-21 00:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix CLUSTER tuplesorts on abbreviated expressions.

CLUSTER sort won't use the datum1 SortTuple field when clustering
against an index whose leading key is an expression.  This makes it
unsafe to use the abbreviated keys optimization, which was missed by the
logic that sets up SortSupport state.  Affected tuplesorts output tuples
in a completely bogus order as a result (the wrong SortSupport based
comparator was used for the leading attribute).

This issue is similar to the bug fixed on the master branch by recent
commit cc58eecc5d.  But it's a far older issue, that dates back to the
introduction of the abbreviated keys optimization by commit 4ea51cdfe8.

Backpatch to all supported versions.

Author: Peter Geoghegan <pg@bowt.ie>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.com
Backpatch: 10-

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5487585e376dd25d2cabc8a63a33c0286b3a199c

Modified Files
--------------
src/backend/utils/sort/tuplesort.c    |  4 +++-
src/test/regress/expected/cluster.out | 14 ++++++++++++++
src/test/regress/sql/cluster.sql      |  6 ++++++
3 files changed, 23 insertions(+), 1 deletion(-)



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

* pgsql: Fix CLUSTER tuplesorts on abbreviated expressions.
@ 2022-04-21 00:18  Peter Geoghegan <pg@bowt.ie>
  0 siblings, 0 replies; 6+ messages in thread

From: Peter Geoghegan @ 2022-04-21 00:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix CLUSTER tuplesorts on abbreviated expressions.

CLUSTER sort won't use the datum1 SortTuple field when clustering
against an index whose leading key is an expression.  This makes it
unsafe to use the abbreviated keys optimization, which was missed by the
logic that sets up SortSupport state.  Affected tuplesorts output tuples
in a completely bogus order as a result (the wrong SortSupport based
comparator was used for the leading attribute).

This issue is similar to the bug fixed on the master branch by recent
commit cc58eecc5d.  But it's a far older issue, that dates back to the
introduction of the abbreviated keys optimization by commit 4ea51cdfe8.

Backpatch to all supported versions.

Author: Peter Geoghegan <pg@bowt.ie>
Author: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CA+hUKG+bA+bmwD36_oDxAoLrCwZjVtST2fqe=b4=qZcmU7u89A@mail.gmail.com
Backpatch: 10-

Branch
------
REL_14_STABLE

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

Modified Files
--------------
src/backend/utils/sort/tuplesort.c    |  4 +++-
src/test/regress/expected/cluster.out | 14 ++++++++++++++
src/test/regress/sql/cluster.sql      |  6 ++++++
3 files changed, 23 insertions(+), 1 deletion(-)



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


end of thread, other threads:[~2022-04-21 00:18 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 00:18 pgsql: Fix CLUSTER tuplesorts on abbreviated expressions. Peter Geoghegan <pg@bowt.ie>
2022-04-21 00:18 pgsql: Fix CLUSTER tuplesorts on abbreviated expressions. Peter Geoghegan <pg@bowt.ie>
2022-04-21 00:18 pgsql: Fix CLUSTER tuplesorts on abbreviated expressions. Peter Geoghegan <pg@bowt.ie>
2022-04-21 00:18 pgsql: Fix CLUSTER tuplesorts on abbreviated expressions. Peter Geoghegan <pg@bowt.ie>
2022-04-21 00:18 pgsql: Fix CLUSTER tuplesorts on abbreviated expressions. Peter Geoghegan <pg@bowt.ie>
2022-04-21 00:18 pgsql: Fix CLUSTER tuplesorts on abbreviated expressions. Peter Geoghegan <pg@bowt.ie>

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