Skip to content

fix(sql-editor): prevent Last Id paging from skipping rows - #388

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-bug-management-5cbe
Draft

fix(sql-editor): prevent Last Id paging from skipping rows#388
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/critical-bug-management-5cbe

Conversation

@cursor

@cursor cursor Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Bug

Last Id paging inferred result uniqueness from any table name substring in the SQL. Joins can emit several rows for one primary-key value, so advancing with WHERE id > last_id silently skipped the remaining joined rows. Prefix table names could also borrow uniqueness metadata from the wrong cached table.

Fix

Only enable keyset paging when the statement resolves unambiguously to one cached table and has no join, APPLY, comma-FROM, or set operation. Ambiguous queries safely retain OFFSET paging.

Validation

  • Added regressions for joined rows and prefix-colliding table names
  • npx vitest run: 265 files passed, 3,621 tests passed
  • cd apps/web && npx tsc --noEmit
Open in Web View Automation 

cursoragent and others added 3 commits September 8, 2026 09:28
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Co-authored-by: huy.phan9 <huyplb@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant