Skip to content

Prevent type inference from re-executing DDL - #354

Merged
quinnj merged 1 commit into
masterfrom
fix/issue-353-type-scan
Aug 25, 2026
Merged

Prevent type inference from re-executing DDL#354
quinnj merged 1 commit into
masterfrom
fix/issue-353-type-scan

Conversation

@quinnj

@quinnj quinnj commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

  • restrict forward type inference to strict queries that produced a row
  • stop the type scan for every status other than SQLITE_ROW
  • cover ALTER TABLE ... ADD COLUMN on strict tables in normal and strict result modes

SQLite can expose a hidden result column for this schema change. SQLite.jl previously re-stepped the completed statement while inferring that column's type. The schema change then ran again, returned SQLITE_ERROR, and the scan loop continued forever.

Validation

  • Julia 1.9: 227/227 tests pass
  • Julia 1.10: 227/227 tests pass
  • Julia 1.12: 227/227 tests pass
  • documentation builds
  • Test.detect_ambiguities(SQLite; recursive=true) reports no ambiguities

Fixes #353

Co-authored by Codex

Only scan rows to infer stored types for strict queries that returned SQLITE_ROW. Treat every non-ROW result as terminal.

This prevents schema-changing statements with hidden result columns from being re-executed after SQLITE_DONE and spinning on SQLITE_ERROR.

Fixes #353
@quinnj
quinnj merged commit 02810d3 into master Aug 25, 2026
6 checks passed
@quinnj
quinnj deleted the fix/issue-353-type-scan branch August 25, 2026 04:17
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.

SQLite runs infinetly in 1.8.1 and not in 1.8.0

1 participant