Skip to content

fix: panic on empty no-op query (Issue #228) - #241

Merged
vmvarela merged 2 commits into
masterfrom
fix/empty-query-228
Sep 12, 2026
Merged

vmvarela merged 2 commits into
masterfrom
fix/empty-query-228

Conversation

@vmvarela

Copy link
Copy Markdown
Owner

Closes #228.

What: guard stmt == null en execQuery — queries que compilan a ningún statement (ej ;) emiten resultado vacío válido en vez de panic en stmt.?.

  • src/main.zig: early return para table/markdown, col_count=0, streaming con ?*stmt sin step.
  • src/format.zig: OutputWriter.begin acepta ?*stmt.
  • repl queda cubierto (reusa execQuery); printQueryPlan no hace unwrap.

Test:

  • ./zig-out/bin/sql-pipe --no-stdin --no-table --json ';' → [] exit 0 (antes panic).
  • Matriz csv/ndjson/xml/html/sql/table/markdown vacíos exit 0; query normal OK.
  • zig build unit-test y zig build test exit 0.

@github-actions github-actions Bot added the type:bug Something isn't working label Sep 12, 2026
@vmvarela
vmvarela merged commit 90f5487 into master Sep 12, 2026
4 checks passed
@vmvarela
vmvarela deleted the fix/empty-query-228 branch September 12, 2026 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Panic on empty / no-op query (e.g. ';')

1 participant