Skip to content

Reject empty or comment only SQL - #1956

Merged
gwenn merged 1 commit into
rusqlite:masterfrom
gwenn:empty_stmt
Nov 13, 2026
Merged

gwenn merged 1 commit into
rusqlite:masterfrom
gwenn:empty_stmt

Conversation

@gwenn

@gwenn gwenn commented Nov 13, 2026

Copy link
Copy Markdown
Collaborator

Fix #1955

@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.61%. Comparing base (812d631) to head (9ef7e69).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/error.rs 0.00% 2 Missing ⚠️
src/cache.rs 66.66% 1 Missing ⚠️
src/lib.rs 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1956      +/-   ##
==========================================
+ Coverage   88.46%   88.61%   +0.15%     
==========================================
  Files          62       62              
  Lines       11711    11343     -368     
==========================================
- Hits        10360    10052     -308     
+ Misses       1351     1291      -60     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gwenn
gwenn merged commit 1eccf8f into rusqlite:master Nov 13, 2026
18 checks passed
@gwenn
gwenn deleted the empty_stmt branch November 13, 2026 20:48
q-uint pushed a commit to Swiss-Subnet/ic that referenced this pull request Nov 26, 2026
…finity#12232)

Updates rusqlite from 0.42.0 to 0.43.0 and tokio-rusqlite from 0.9.0 to
0.10.0 in both the Cargo and the Bazel build, so Rosetta, their only
user, stays on the latest releases. This follows up on dfinity#12194, which
stopped at rusqlite 0.42 because no tokio-rusqlite release accepted 0.43
before 0.10.0.

# Changes

- `Cargo.toml`: rusqlite `0.42.0` → `0.43.0` ([release
notes](https://github.com/rusqlite/rusqlite/releases/tag/v0.43.0)).
- `bazel/rust.MODULE.bazel`: rusqlite `^0.42.0` → `^0.43.0` and
tokio-rusqlite `^0.9` → `^0.10`.
- `rs/rosetta-api/icrc1/Cargo.toml`: tokio-rusqlite `0.9` → `0.10`.
tokio-rusqlite 0.10.0 only raises its rusqlite requirement to `^0.43.0`;
its code is the same as in 0.9.0.
- `Cargo.lock`, `Cargo.Bazel.toml.lock` and `Cargo.Bazel.json.lock`:
only rusqlite and tokio-rusqlite move.

# Behaviour changes

- **Rebuilt with rusqlite 0.43.0:**
- ICP Rosetta: `//rs/rosetta-api/icp:ic-rosetta-api`,
`:ic-rosetta-api-rosetta-blocks` and the image `:rosetta_image`;
- ICRC Rosetta: `//rs/rosetta-api/icrc1:ic-icrc-rosetta-bin` and the
image `:ic_icrc_rosetta_image`;
- the ICRC Rosetta client
`//rs/rosetta-api/icrc1/client:ic-icrc-rosetta-client-bin`;
  - the system-test binaries, whose driver links `ic-rosetta-api`.

The bundled SQLite stays 3.54.1, because libsqlite3-sys stays at 0.40.0.
- **Empty SQL** (rusqlite/rusqlite#1956): `prepare`, `prepare_cached`,
`execute`, `query_row` and `query_one` now return the new `Error::Empty`
("SQL is empty or comment only") for SQL that holds only whitespace, `;`
or comments. In 0.42, `prepare` returned a statement that failed with
`SQLITE_MISUSE` when stepped. Rosetta passes no such SQL. On master
87617d5, in the Rosetta files that use rusqlite, every SQL argument
to these calls is either a non-empty statement or starts with fixed
`SELECT`, `INSERT`, `DELETE` or `CREATE INDEX` text.

FYI @dfinity/defi, who own `rs/rosetta-api`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

# Statement::clear_bindings on a statement prepared from empty SQL dereferences NULL (non-bundled builds)

1 participant