Skip to content

Contain UDF errors and release aggregate state safely - #360

Merged
quinnj merged 1 commit into
masterfrom
investigate/udf-errors
Sep 23, 2026
Merged

quinnj merged 1 commit into
masterfrom
investigate/udf-errors

Conversation

@quinnj

@quinnj quinnj commented Sep 22, 2026

Copy link
Copy Markdown
Member

A registered aggregate that succeeds on one row and throws on the next can leave a freed state buffer referenced by SQLite; closing the database then aborts the reproduced child process. Scalar and aggregate exceptions also escape through their C callback boundary instead of returning a SQLite error.

Report callback and value-conversion failures through SQLite's error API. Transfer aggregate buffer ownership before fallible work, release it exactly once, and preserve the existing empty-input result. The final callback now uses SQLite's single-argument C signature.

Validation: full suites pass on Julia 1.9.4 and 1.12.7 (285 checks each, including 58 new regressions). All four isolated error/reuse/close controls exit normally under allocator scribbling. Independent ownership review and 61 additional grouped/GC/error controls passed. Another 15 checks cover both execution APIs, lazy iteration, statement rollback, explicit transactions, and recovery.

Co-authored by Codex

@quinnj
quinnj merged commit a3e8117 into master Sep 23, 2026
6 checks passed
@quinnj
quinnj deleted the investigate/udf-errors branch September 23, 2026 01:03
quinnj referenced this pull request Sep 30, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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