Changes since v1.10.2.
Requirements
- The driver now requires Go 1.25 or later. The minimum supported server
versions are MySQL 8.0 and MariaDB 10.11. (#1803)
New features
-
Add the
tinyInt1IsBoolDSN parameter andTinyInt1IsBoolfunctional option,
disabled by default to preserve numericTINYINTbehavior. When enabled,
signed, non-ZEROFILLTINYINT(1)columns reportBOOLEANand scan types
boolorsql.NullBool; zero is returned asfalseand non-zero values as
true. This applies to both text-protocol queries and prepared statements.
For non-NULL values, enabling the option makes integer scans fail and string
scans return"false"or"true"instead of numeric strings. (#1805, #1845) -
Add a pluggable authentication system with the
AuthPlugininterface,
AuthContext, andRegisterAuthPlugin. Custom plugins receive the connection
context and an immutable snapshot of the selected credentials, established
transport, and configured RSA public key. (#1696) -
Refactor the built-in authentication methods to use the plugin system and
support multi-step authentication flows with multiple auth switch requests and
continuation packets. Authentication now validates plugin state, rejects
unsolicited public keys, preserves errors from plugins, and starts plugins
only after the TLS handshake has completed. (#1696) -
Add OpenID Connect authentication with the
OIDCTokenoption. The driver
sends the token over TLS. (#1820) -
Add support for MariaDB PARSEC authentication. (#1827)
-
Add optional zstd protocol compression. Import
github.com/go-sql-driver/mysql/zstdfor side effects and enable
compress=trueto use zstd when the server supports it, with zlib as a
fallback. (#1823) -
Preserve the order of DSN system variables when setting them on the server
and when callingFormatDSN. UseAddParamto specify that order when
configuring a connection programmatically. (#1807)
Bugfixes
-
For text queries, return
BIGINT UNSIGNEDvalues tosql.Scanneras
int64when they fit and as decimal bytes for larger values. (#1860) -
Handle omitted column metadata in prepared statement
Execcalls on
MariaDB. (#1862) -
Return
ErrMalformPktfor truncated OK, EOF, column definition, and
statement prepare response packets. (#1858) -
Pass authentication switch data to plugins unchanged. (#1864)
-
Return the server error when available after a partial write. Discard the
connection on SQLSTATE class 08 errors except error 1047. (#1852)