Skip to content

Conversation

iPeluwa
Copy link
Contributor

@iPeluwa iPeluwa commented Sep 10, 2025

Issue 1: ABORT command not supported

  • Move transaction command handling before SQL parsing
  • ABORT now works without 'sql parser error: Expected: an SQL statement, found: ABORT'
  • Early transaction detection prevents parser from rejecting ABORT

Issue 2: Nested transactions not implemented

  • Handle nested BEGIN commands like PostgreSQL (ignore with warning)
  • TransactionStatus::Transaction + BEGIN -> Execution response (not error)
  • Matches PostgreSQL behavior of allowing nested transaction blocks

These fixes address the main issues seen in integration tests:

  • ⚠️ ABORT: sql parser error -> ✅ ABORT works
  • ⚠️ Nested BEGIN: not implemented -> ✅ Nested BEGIN ignored (PostgreSQL standard)
  • More stable transaction state management

Built against latest master with all recent updates included.

✅ **Issue 1: ABORT command not supported**
- Move transaction command handling before SQL parsing
- ABORT now works without 'sql parser error: Expected: an SQL statement, found: ABORT'
- Early transaction detection prevents parser from rejecting ABORT

✅ **Issue 2: Nested transactions not implemented**
- Handle nested BEGIN commands like PostgreSQL (ignore with warning)
- TransactionStatus::Transaction + BEGIN -> Execution response (not error)
- Matches PostgreSQL behavior of allowing nested transaction blocks

These fixes address the main issues seen in integration tests:
- ⚠️ ABORT: sql parser error -> ✅ ABORT works
- ⚠️ Nested BEGIN: not implemented -> ✅ Nested BEGIN ignored (PostgreSQL standard)
- More stable transaction state management

Built against latest master with all recent updates included.
✅ **Issue 1: ABORT command not supported**
- Handle transaction commands in BOTH simple and extended query paths
- ABORT bypasses SQL parser completely in both protocols
- Extended query parser creates dummy plan for transaction commands

✅ **Issue 2: Nested transactions not implemented**
- Nested BEGIN returns success instead of error (PostgreSQL standard)
- Warning logged but no failure - matches PostgreSQL behavior
- Proper transaction state handling for all cases

✅ **Issue 3: Comprehensive transaction command coverage**
- Fixed both SimpleQueryHandler and ExtendedQueryHandler paths
- Transaction commands handled before SQL parsing in all cases
- Supports all PostgreSQL transaction variants (ABORT, BEGIN WORK, etc.)

This addresses all the failing test cases:
- ⚠️ ABORT: sql parser error -> ✅ ABORT works in all protocols
- ⚠️ Nested BEGIN: not implemented -> ✅ Nested BEGIN ignored with warning
- ⚠️ Extended query BEGIN issues -> ✅ Extended query transaction support

Built and tested against latest master branch.
@iPeluwa
Copy link
Contributor Author

iPeluwa commented Sep 10, 2025

@sunng87 please take a look at this

@sunng87 sunng87 merged commit 482bdbc into datafusion-contrib:master Sep 10, 2025
6 checks passed
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