Fix FormatDSN missing ConnectionAttributes#1619
Fix FormatDSN missing ConnectionAttributes#1619methane merged 3 commits intogo-sql-driver:masterfrom
Conversation
WalkthroughA new entry has been added to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Config
participant DSNBuilder
User->>Config: Create DSN with ConnectionAttributes
Config->>DSNBuilder: FormatDSN()
alt ConnectionAttributes present
DSNBuilder->>DSNBuilder: Append connectionAttributes to DSN
end
DSNBuilder->>User: Return formatted DSN
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🔇 Additional comments (4)
✨ Finishing Touches
🪧 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 (
|
There was a problem hiding this comment.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- AUTHORS (1 hunks)
- dsn.go (1 hunks)
- dsn_test.go (2 hunks)
Files skipped from review due to trivial changes (1)
- AUTHORS
Additional comments not posted (3)
dsn_test.go (2)
80-82: New test entry for connection attributes looks good.The new test entry for
testDSNscorrectly includes connection attributes and other necessary parameters.
115-116: New test case for unescaped connection attributes looks good.The new test case in
TestDSNParserInvalidcorrectly checks for unescaped connection attributes, enhancing the robustness of the test suite.dsn.go (1)
293-295: New conditional block for connection attributes looks good.The new conditional block in the
FormatDSNmethod correctly includes connection attributes in the formatted DSN if they are set.
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) | require | minor | `v1.8.1` -> `v1.9.1` | --- ### Release Notes <details> <summary>go-sql-driver/mysql (github.com/go-sql-driver/mysql)</summary> ### [`v1.9.1`](https://github.com/go-sql-driver/mysql/blob/HEAD/CHANGELOG.md#v191-2025-03-21) [Compare Source](go-sql-driver/mysql@v1.9.0...v1.9.1) ##### Major Changes - Add Charset() option. ([#​1679](go-sql-driver/mysql#1679)) ##### Bugfixes - go.mod: fix go version format ([#​1682](go-sql-driver/mysql#1682)) - Fix FormatDSN missing ConnectionAttributes ([#​1619](go-sql-driver/mysql#1619)) ### [`v1.9.0`](https://github.com/go-sql-driver/mysql/blob/HEAD/CHANGELOG.md#v190-2025-02-18) [Compare Source](go-sql-driver/mysql@v1.8.1...v1.9.0) ##### Major Changes - Implement zlib compression. ([#​1487](go-sql-driver/mysql#1487)) - Supported Go version is updated to Go 1.21+. ([#​1639](go-sql-driver/mysql#1639)) - Add support for VECTOR type introduced in MySQL 9.0. ([#​1609](go-sql-driver/mysql#1609)) - Config object can have custom dial function. ([#​1527](go-sql-driver/mysql#1527)) ##### Bugfixes - Fix auth errors when username/password are too long. ([#​1625](go-sql-driver/mysql#1625)) - Check if MySQL supports CLIENT_CONNECT_ATTRS before sending client attributes. ([#​1640](go-sql-driver/mysql#1640)) - Fix auth switch request handling. ([#​1666](go-sql-driver/mysql#1666)) ##### Other changes - Add "filename:line" prefix to log in go-mysql. Custom loggers now show it. ([#​1589](go-sql-driver/mysql#1589)) - Improve error handling. It reduces the "busy buffer" errors. ([#​1595](go-sql-driver/mysql#1595), [#​1601](go-sql-driver/mysql#1601), [#​1641](go-sql-driver/mysql#1641)) - Use `strconv.Atoi` to parse max_allowed_packet. ([#​1661](go-sql-driver/mysql#1661)) - `rejectReadOnly` option now handles ER_READ_ONLY_MODE (1290) error too. ([#​1660](go-sql-driver/mysql#1660)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "* 0-3 * * *" (UTC), Automerge - "* 0-3 * * *" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIwNS4xIiwidGFyZ2V0QnJhbmNoIjoiZm9yZ2VqbyIsImxhYmVscyI6WyJkZXBlbmRlbmN5LXVwZ3JhZGUiLCJ0ZXN0L25vdC1uZWVkZWQiXX0=--> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7293 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org> Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Merged upstream commits from v1.8.1 to v1.9.2, which includes: Major changes: - Implement zlib compression (go-sql-driver#1487) - Add support for VECTOR type (MySQL 9.0) (go-sql-driver#1609) - Add Charset() option (go-sql-driver#1679) - Config object can have custom dial function (go-sql-driver#1527) - Supported Go version updated to Go 1.21+ (go-sql-driver#1639) Bug fixes: - Fix auth errors when username/password are too long (go-sql-driver#1625) - Check if MySQL supports CLIENT_CONNECT_ATTRS before sending (go-sql-driver#1640) - Fix auth switch request handling (go-sql-driver#1666) - Fix FormatDSN missing ConnectionAttributes (go-sql-driver#1619) Other improvements: - Better error handling to reduce "busy buffer" errors - Add filename:line prefix to logs (go-sql-driver#1589) - Improved max_allowed_packet parsing (go-sql-driver#1661) - rejectReadOnly option now handles ER_READ_ONLY_MODE error (go-sql-driver#1660) Preserved local customizations: - skipParseNumbers DSN option (p2) - Custom _client_name connection attribute (p4) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Description
Took into account
ConnectionAttributesconfig, if set, inFormatDSNFixes #1618
Checklist
Summary by CodeRabbit
New Features
Documentation
AUTHORSfile to acknowledge Bogdan Constantinescu as a contributor.