Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[PGPRO-11557] Fix infinite loop with multiple ORDER BY in RUM scan#149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
LimarDeWills wants to merge1 commit intopostgrespro:master
base:master
Choose a base branch
Loading
fromLimarDeWills:PGPRO-11557-fix-orderby-loop

Conversation

LimarDeWills
Copy link

Fixes#66
Problem description:

When executing a query with ORDER BY col1, col2 using a RUM index, and the WHERE clause matches only a subset of the index, the query may enter an infinite loop in scanGetItemFast().

This occurs because entry->curItem is set via entry->curItem = collected.item;, but the corresponding entry->offset does not point to that item in entry->list. As a result, entryFindItem() may prematurely exit without correcting curItem, leading to repeated processing of the same item.
Fix:

Added an extra check in entryFindItem() that ensures:

curItem >= itemoffset is within valid rangeentry->curItem.iptr == entry->list[offset].iptr

If the last condition fails, the function continues scanning the list to realign curItem and offset.

This ensures scanGetItemFast() progresses correctly and prevents infinite looping.

@LimarDeWillsLimarDeWillsforce-pushed thePGPRO-11557-fix-orderby-loop branch fromb548636 to74b4070CompareApril 28, 2025 10:08
@LimarDeWillsLimarDeWillsforce-pushed thePGPRO-11557-fix-orderby-loop branch from74b4070 to337b60eCompareApril 28, 2025 11:46
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

SQL statement runs infinitely
1 participant
@LimarDeWills

[8]ページ先頭

©2009-2025 Movatter.jp