From 0d2aa4d4937bb0500823edfc7d620f4e5fa45b9c Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 14 Oct 2024 15:36:02 +0200 Subject: Track sort direction in SortGroupClause Functions make_pathkey_from_sortop() and transformWindowDefinitions(), which receive a SortGroupClause, were determining the sort order (ascending vs. descending) by comparing that structure's operator strategy to BTLessStrategyNumber, but could just as easily have gotten it from the SortGroupClause object, if it had such a field, so add one. This reduces the number of places that hardcode the assumption that the strategy refers specifically to a btree strategy, rather than some other index AM's operators. Author: Mark Dilger Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com --- src/include/catalog/catversion.h | 2 +- src/include/nodes/parsenodes.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index 38f0f9c1588..842c43c0b68 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -57,6 +57,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 202410114 +#define CATALOG_VERSION_NO 202410141 #endif diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 5b62df32733..c92cef3d16d 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -1438,6 +1438,7 @@ typedef struct SortGroupClause Index tleSortGroupRef; /* reference into targetlist */ Oid eqop; /* the equality operator ('=' op) */ Oid sortop; /* the ordering operator ('<' op), or 0 */ + bool reverse_sort; /* is sortop a "greater than" operator? */ bool nulls_first; /* do NULLs come before normal values? */ /* can eqop be implemented by hashing? */ bool hashable pg_node_attr(query_jumble_ignore); -- cgit v1.2.3