From ad00a20473a82a0770771e075de6656ab534d700 Mon Sep 17 00:00:00 2001 From: Arseny Kositsyn Date: Fri, 20 Feb 2026 13:17:17 +0300 Subject: [PATCH] [PGPRO-17316] Fixed a bug that appeared in e36d1644. A bug appeared in commit e36d1644, due to which, regardless of the strategy and type of the ORDER BY column, the NoMovementScanDirection direction was selected and the index followed the path with internal sorting. The bug has been fixed in this commit. Now, if possible, RUM gets the items from the scan immediately in the correct order. Tags: rum --- src/rumscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rumscan.c b/src/rumscan.c index 0982faaa99..63134aab1e 100644 --- a/src/rumscan.c +++ b/src/rumscan.c @@ -473,7 +473,7 @@ lookupScanDirection(RumState *state, AttrNumber attno, StrategyNumber strategy) for(i = 0; i < MAX_STRATEGIES; i++) { - if (rumConfig->strategyInfo[i].strategy != InvalidStrategy) + if (rumConfig->strategyInfo[i].strategy == InvalidStrategy) break; if (rumConfig->strategyInfo[i].strategy == strategy) return rumConfig->strategyInfo[i].direction;