Add support for MariaDB PARSEC authentication. (#1827)
Add the tinyInt1IsBool DSN parameter and TinyInt1IsBool functional option, disabled by default to preserve numeric TINYINT behavior. When enabled, signed, non-ZEROFILL TINYINT(1) columns report BOOLEAN and scan types bool or sql.NullBool; zero is returned as false and 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. (#1453, #1844)
Add a pluggable authentication system with the AuthPlugin interface, AuthContext, and RegisterAuthPlugin. 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)
Changes since v1.10.1.
Return ErrMalformPkt instead of panicking on truncated initial handshake packets, including the greeting received before TLS negotiation. (GHSA-9qjq-77h9-895w, #1850)
Discard connections after a failed LOAD DATA LOCAL INFILE, including reader Close() errors, so unread results from a multi-statement batch cannot be returned to a later caller. Preserve the server's response status and avoid retrying the batch after an upload write failure. (GHSA-4v5x-9mc8-gr98)
Reject interpolateParams=true combined with an unsafe multibyte charset (big5, sjis, gbk, cp932, gb18030) given by charset or Charset(). Previously only collation was checked. Collations are now matched case-insensitively and by their charset prefix. The check also runs again after a BeforeConnect callback has modified the config. Stop rejecting gb2312_bin; GB2312 trailing bytes cannot contain a backslash. The error text changed from invalid DSN: interpolateParams can not be used with unsafe collations to interpolateParams cannot be used with unsafe charsets, because it may also be returned by NewConnector or Connector.Connect after BeforeConnect. Applications comparing the complete error string must update their comparison. (#1836)
Fix interpolateParams not treating -- followed by \v, \f, another control character, DEL, or a raw 0xA0 byte as a comment. Other non-ASCII bytes after -- remain outside the supported interpolation grammar. (#1836)
Fix interpolateParams treating the * that opens /*/ as closing the comment. (#1835)
Honor BeforeConnect changes to the timeout, dialer, logger, and connection attributes without modifying the shared connector. (#1809)
Validate prepared statement arguments and packet size before sending long data, and reset the statement if a long-data write fails. (#1810)
Fix the reported precision of unsigned DECIMAL columns. (#1813)
Preserve full two-byte column collation IDs so IDs above 255 do not cause text columns to be reported as binary columns. (#1818)
Fix the inverted check for collations outside the handshake's one-byte map. Accept them when a charset is supplied, using SET NAMES ... COLLATE; reject them when no charset is supplied instead of silently using the default collation. (#1832)
Preserve and log idle server error packets before discarding a connection, with bounded diagnostics over plain, TLS, and zlib connections. (#1843)
Update GitHub Actions dependencies and add a workflow dependency lockfile. (#1838)
Pin the lint job to Go 1.26 and Staticcheck v0.8.1 for compatibility. (#1824)
Limit Go module Dependabot pull requests to security updates. (#1829)
Test Go 1.27 and MySQL 9.7 while retaining Go 1.24 and the existing database compatibility jobs.
Fix Config.FormatDSN() dropping Addr when Net is empty. It now uses the default tcp network so configs with only Addr round-trip correctly. (#1770)
Fix typed-nil json.RawMessage with interpolateParams=true being interpolated as an empty string. It is now interpolated as SQL NULL, matching server-side prepared statements. (#1782)
Add MariaDB 11.8 and 12.3 to the test matrix. (#1774)
Fix getSystemVar("max_allowed_packet") potentially returned wrong value. (#1754) This affects only when maxAllowedPacket=0 is set.
Bump filippo.io/edwards25519 from 1.1.1 to 1.2.0. (#1756) While older versions have reported CVEs, they do not affect go-mysql.
Update Go versions to 1.24-1.26. (#1763)
Enhance interpolateParams to correctly handle placeholders. (#1732) The question mark (?) within strings and comments will no longer be treated as a placeholder.
tx.Commit() and tx.Rollback() returned ErrInvalidConn always. Now they return cached real error if present. (#1690)
Optimize reading small result sets to fix a performance regression introduced by compression protocol support. (#1707)
Fix db.Ping() on compressed connection. (#1723)
v1.9.2 is a re-release of v1.9.1 due to a release process issue; no changes were made to the content.
strconv.Atoi to parse max_allowed_packet. (#1661)rejectReadOnly option now handles ER_READ_ONLY_MODE (1290) error too. (#1660)Bugfixes:
Major Changes:
SET NAMES charset COLLATE collation. by @methane in #1437collation_id in the handshake packet. But it caused collation mismatch in some situation.SET NAMES utf8mb4 for new connection. This uses server’s default collation for utf8mb4.SET NAMES <charset>. This uses the server's default collation for <charset>.SET NAMES charset COLLATE collation.[]byte to database/sql for avoid unnecessary allocation and conversion.*any to Scan(), database/sql passed the []byte into the target variable.[]byte and conversion cost is negatable.Other changes:
ColumnTypeScanType() from returning sql.RawBytes by @methane in https://github.com/go-sql-driver/mysql/pull/1424Changes:
Bugfixes:
Changes:
(*textRows).readRow in a more clear way (#1230)New Features:
Bugfixes:
Changes:
NullTime is deprecated (#960, #1144)New Features:
driver.Validator interface (#1106, #1174)uint64 from Valuer in ConvertValue (#1143)json.RawMessage for converter and prepared statement (#1059)json.RawMessage as string (#1058)CheckNamedValue (#1090)Bugfixes:
Changes:
New Features:
Bugfixes:
Bugfixes:
Changes:
strict mode (#676)max_allowed_packet by default (#680)ConvertValue() to match the database/sql/driver implementation (#760)0000-00-00T00:00:00 as the time.Time zero value (#783)New Features:
rejectReadOnly DSN option (#604)context.Context support (#608, #612, #627, #761)NewConfig function which initializes a config with default values (#679)ColumnType interfaces (#667, #724)ConvertValue (#623)NamedValueChecker, improving support for uint64 with high bit set (#690, #709, #710)caching_sha2_password authentication plugin support (#794, #800, #801, #802)driver.SessionResetter (#779)sha256_password authentication plugin support (#808)Bugfixes:
tls=true (#564, #718)Changes:
New Features:
interpolateParams=true (#309, #318, #490)Bugfixes:
Changes:
go get installs the current master branch againNew Features:
RegisterDial allows the usage of a custom dial function to establish the network connectioncollation DSN parameter. This parameter should be preferred over the charset parameterSetLoggerBugfixes:
Changes:
utf8_general_ci by default. Adding &charset=UTF8 to the DSN should not be necessary anymore[]byte(nil) is now treated as a NULL value. Before, it was treated like an empty string / []byte("")New Features:
allowOldPasswords=true to the DSN since it is insecureclientFoundRows parameter: Return the number of matching rows instead of the number of rows changed on UPDATEsBugfixes:
time.Timeio.EOF errors when the data was fully readInitial Release