Skip to content

fix(sql-editor): harden result paging and simplify recent UI code#102

Merged
huyplb merged 1 commit into
mainfrom
cursor/sql-editor-paging-hardening
Jul 25, 2026
Merged

fix(sql-editor): harden result paging and simplify recent UI code#102
huyplb merged 1 commit into
mainfrom
cursor/sql-editor-paging-hardening

Conversation

@huyplb

@huyplb huyplb commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Fail closed on page wrap with offset, skip wraps for non-SELECT, ignore stale page fetches after a new Run, and gate Next on pageMeta. Also tidy the recent SQL Editor helpers.


Note

Medium Risk
Changes core SQL execute paging semantics and result store concurrency; mistakes could break Next/Prev or show wrong rows, but behavior is covered by new tests and fail-closed rules.

Overview
SQL result paging is tightened end-to-end so Next/Prev stay trustworthy. The execute path adds isPageableStatement so only SELECT/VALUES (via statementVerb) get LIMIT/OFFSET wraps; UPDATE/DDL/SET run raw at offset 0, and offset > 0 on non-SELECTs errors without hitting the DB. When wrap fails at offset > 0, the API fails closed (Paging failed: …) instead of falling back to unwrapped SQL that would repeat page 0.

The store bumps pageEpoch on each Run and loadResultPage ignores stale responses via isCurrentPageEpoch; paging is blocked while a run is in flight. ResultsPanel only enables prev/next from pageMeta.hasNext (not truncated alone) and disables controls during refresh.

Smaller cleanups: shared filterCallParameters for schema explorer and Monaco completion, GridToolbar / bindAxisDrag refactors, and minor theme color-mix helper in uiStore.

Reviewed by Cursor Bugbot for commit 2a099f6. Bugbot is set up for automated code reviews on this repo. Configure here.

Fail closed on page wrap with offset, skip wraps for non-SELECT, ignore stale page fetches after a new Run, and gate Next on pageMeta. Also tidy the recent SQL Editor helpers.

Co-authored-by: Cursor <cursoragent@cursor.com>
@cursor

cursor Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_4f499b36-d5d6-4984-8ff5-89e2d2b864a5)

@huyplb
huyplb merged commit a78a040 into main Jul 25, 2026
8 of 9 checks passed
@huyplb
huyplb deleted the cursor/sql-editor-paging-hardening branch July 25, 2026 05:26
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