Skip to content

fix: reject multiple statements in single-statement APIs - #2277

Open
zfaustk wants to merge 1 commit into
tursodatabase:mainfrom
zfaustk:fix/reject-multiple-statements
Open

fix: reject multiple statements in single-statement APIs#2277
zfaustk wants to merge 1 commit into
tursodatabase:mainfrom
zfaustk:fix/reject-multiple-statements

Conversation

@zfaustk

@zfaustk zfaustk commented Aug 30, 2026

Copy link
Copy Markdown

Summary

Fixes #2244.

Single-statement Connection::execute and Connection::query calls now reject
multiple executable SQL statements before any statement is stepped. The
explicit execute_batch API keeps its existing multi-statement behavior.

The guard is applied to local connections and embedded-replica
RemoteConnection/RemoteStatement paths. This prevents the first statement
from partially mutating the database when a second statement is supplied.

Verification

  • cargo test -p libsql --test integration_tests --no-default-features --features core,stream -- --nocapture (30 passed, 1 ignored)
  • cargo test -p libsql --test replication --no-default-features --features replication -- --nocapture (2 passed)
  • cargo check -p libsql --no-default-features --features core,replication (passed)
  • cargo check -p libsql --no-default-features --features core,sync (passed)
  • cargo check -p libsql --no-default-features --features core,remote (passed)
  • cargo fmt --all -- --check (passed)
  • git diff --check (passed)

The full all-feature workspace check was not completed locally because the
environment does not provide cmake; hosted CI will provide the remaining
matrix.

AI assistance was used for implementation and review; the final diff and
verification results were checked against the repository source and tests.

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.

no error on multiple statements within one query

1 participant