github go-sql-driver/mysql v1.8.0

latest release: v1.8.1
8 months ago

What's Changed

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.
  • PathEscape dbname in DSN. by @methane in #1432

    • This is backward incompatible in rare case. Check your DSN.
  • Drop Go 1.13-17 support by @methane in #1420

    • Use Go 1.18+
  • 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 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.

Other changes

New Contributors

Full Changelog: v1.7.1...v1.8.0

Don't miss a new mysql release

NewReleases is sending notifications on new releases.