Older go-mysql-driver used collation_id in the handshake packet. But it caused collation mismatch in some situation.
If you don't specify charset nor collation, go-mysql-driver sends SET NAMES utf8mb4 for new connection. This uses server's default collation for utf8mb4.
If you specify charset, go-mysql-driver sends SET NAMES <charset>. This uses the server's default collation for <charset>.
If you specify collation and/or charset, go-mysql-driver sends SET NAMES charset COLLATE collation.
When text protocol is used, go-mysql-driver passed bare []byte to database/sql for avoid unnecessary allocation and conversion.
If user specified *any to Scan(), database/sql passed the []byte into the target variabe.
This confused users because most user doesn't know when text/binary protocol used.
go-mysql-driver 1.8 converts integer/float values into int64/double even in text protocol. This doesn't increase allocation compared to []byte and conversion cost is negilible.
New options start using the Functional Option Pattern to avoid increasing technical debt in the Config object. Future version may introduce Functional Option for existing options, but not for now.
fix race condition when context is canceled in #1562 and #1570
Version 1.8.0 (2024-03-09)
Major Changes:
Use SET NAMES charset COLLATE collation. by @methane in #1437
Older go-mysql-driver used collation_id in the handshake packet. But it caused collation mismatch in some situation.
If you don't specify charset nor collation, go-mysql-driver sends SET NAMES utf8mb4 for new connection. This uses server's default collation for utf8mb4.
If you specify charset, go-mysql-driver sends SET NAMES <charset>. This uses the server's default collation for <charset>.
If you specify collation and/or charset, go-mysql-driver sends SET NAMES charset COLLATE collation.
Parse numbers on text protocol too by @methane in #1452
When text protocol is used, go-mysql-driver passed bare []byte to database/sql for avoid unnecessary allocation and conversion.
If user specified *any to Scan(), database/sql passed the []byte into the target variable.
This confused users because most user doesn't know when text/binary protocol used.
go-mysql-driver 1.8 converts integer/float values into int64/double even in text protocol. This doesn't increase allocation compared to []byte and conversion cost is negatable.
New options start using the Functional Option Pattern to avoid increasing technical debt in the Config object. Future version may introduce Functional Option for existing options, but not for now.
Make TimeTruncate functional option by @methane in 1552
Add BeforeConnect callback to configuration object by @ItalyPaleAle in #1469
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps github.com/go-sql-driver/mysql from 1.7.1 to 1.8.1.
Release notes
Sourced from github.com/go-sql-driver/mysql's releases.
... (truncated)
Changelog
Sourced from github.com/go-sql-driver/mysql's changelog.
Commits
4395c45
update changelog for releasing v1.8.1 (#1576)7eeaba6
Fix issue 1567 (#1570) (#1571)65395d8
fix race condition when context is canceled (#1565)1e75613
add wrapper method to call mc.cfg.Logger (#1564)33fa6e5
replace interface{} with any (#1561)33b7747
Add BeforeConnect callback to configuration object (#1469)6964272
Make TimeTruncate functional option (#1552)097fe6e
Update workflows (#1547)f019727
add TiDB support in README.md (#1333)743e263
IntroducetimeTruncate
parameter fortime.Time
arguments (#1541)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show