Skip to content

fix(ios): run every statement in the query editor - #3404

Merged
datlechin merged 2 commits into
mainfrom
fix/ios-multi-statement-run
Oct 13, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/ios-multi-statement-run

Conversation

@datlechin

Copy link
Copy Markdown
Member

Why

On iPhone and iPad, a query holding several statements ran only the first. The editor sent the whole text in one call, and SQLite compiles only the first statement, so CREATE TABLE ran and the INSERT was dropped. CREATE TABLE changes no rows, so the result area went back to its empty placeholder, which looked like a freeze.

Change

  • The editor splits the text by the engine's grammar and the session's quoting settings, then runs each statement in order. Each statement commits as it runs. On SQL Server, each GO batch runs whole. The first failure ends the run and reports Statement 2/3 failed, plus whether the earlier statements stand.
  • A statement that returns no rows now shows its outcome. Oracle writes report their row count.
  • Drivers: errors after the first rows are reported, Stop reaches a running SQLite, PostgreSQL or DuckDB statement, and a stopped stream can no longer end the next query. A PostgreSQL read is cancelled at the row cap instead of downloading the rest. MySQL CALL no longer breaks the connection (Mac too). SQLite DDL no longer repeats the last row count (Mac too).
  • On iOS, Redis line breaks separate arguments, and empty quoted values are kept.

Verified

SQLiteDriverFileTests runs the reported text against a real file and gets 7 rows. Each driver fix was measured before and after against SQLite 3.54, PostgreSQL 18, MySQL 8.4 and DuckDB 1.5.2. The iOS tests compile here and run on CI, since this machine has no simulator runtime, so there are no screenshots.

Not in this PR

  • MySQL Stop and the row cap still read the rest of the result. iOS has no KILL QUERY path yet.
  • A PostgreSQL SELECT that calls a writing function is cancelled at the 10,000-row cap, which undoes those writes. The Mac does the same.
  • SQL Server shows a batch's first result set.
  • On MySQL with ANSI_QUOTES, a double-quoted identifier ending in a backslash splits wrongly. The Mac does the same, because the server never reports ANSI_QUOTES.
  • SQLite Stop during a lock wait still waits out the 5-second busy timeout.

Fixes #3399

Signed-off-by: Dat Ngo Quoc <datlechin@gmail.com>
@datlechin
datlechin merged commit 53a4613 into main Oct 13, 2026
4 checks passed
@datlechin
datlechin deleted the fix/ios-multi-statement-run branch October 13, 2026 12:16
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.

iPad insert statement will freeze on run

1 participant