Skip to content

[codex] Fix SQL BEGIN transaction tracking#424

Merged
Piccirello merged 2 commits intomainfrom
codex/fix-sql-begin-tx-tracking
Apr 16, 2026
Merged

[codex] Fix SQL BEGIN transaction tracking#424
Piccirello merged 2 commits intomainfrom
codex/fix-sql-begin-tx-tracking

Conversation

@bill-ph
Copy link
Copy Markdown
Collaborator

@bill-ph bill-ph commented Apr 16, 2026

Summary

  • track raw SQL BEGIN and START TRANSACTION statements in the shared SQL transaction-state helper
  • update the Flight SQL update path to always apply SQL transaction-state tracking after statement execution
  • add regression coverage for successful and failed SQL-level transaction starts

Why

A raw SQL BEGIN was intentionally excluded from isTransactionControlStmt, but session.sqlTxActive was only updated inside the transaction-control guard. That meant SQL-level transactions were not marked active after BEGIN, so later statements could be retried as if they were autocommit and mask the original transaction failure.

Validation

  • go test ./duckdbservice/...
  • just lint

@bill-ph bill-ph marked this pull request as ready for review April 16, 2026 17:58
@Piccirello Piccirello merged commit 1eb399e into main Apr 16, 2026
14 checks passed
@Piccirello Piccirello deleted the codex/fix-sql-begin-tx-tracking branch April 16, 2026 21:46
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.

2 participants