Transaction Commit/Rollback returns conn's cached error, if present#1691
Conversation
WalkthroughThis pull request makes two distinct updates. First, it adds two new entries to the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant mysqlTx
participant mysqlConn
Caller->>mysqlTx: Call Commit()/Rollback()
alt tx.mc is nil
mysqlTx->>Caller: return ErrInvalidConn
else
alt tx.mc.closed is true
mysqlTx->>mysqlConn: Retrieve error (mc.error())
alt error exists
mysqlTx->>Caller: return specific error (e.g., context.Canceled)
else
mysqlTx->>Caller: return ErrInvalidConn
end
else
mysqlTx->>Caller: proceed with transaction commit/rollback
end
end
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🔇 Additional comments (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…o-sql-driver#1691) If a transaction connection has a cached error, return it instead of ErrInvalidConn during Commit/Rollback operations. Fix go-sql-driver#1690
Description
Fix #1690, if a transaction connection has a cached error, return it instead of ErrInvalidConn during Commit/Rollback operations.
Checklist
Summary by CodeRabbit
Chores
Bug Fixes