Skip to content

Commit 243b3df

Browse files
committed
Merge branch 'master' into compression
2 parents e9f5b24 + af8d793 commit 243b3df

File tree

3 files changed

+47
-4
lines changed

3 files changed

+47
-4
lines changed

CHANGELOG.md

+42
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
## Version 1.8.1 (2024-03-26)
2+
3+
Bugfixes:
4+
5+
- fix race condition when context is canceled in [#1562](https://github.com/go-sql-driver/mysql/pull/1562) and [#1570](https://github.com/go-sql-driver/mysql/pull/1570)
6+
7+
## Version 1.8.0 (2024-03-09)
8+
9+
Major Changes:
10+
11+
- Use `SET NAMES charset COLLATE collation`. by @methane in [#1437](https://github.com/go-sql-driver/mysql/pull/1437)
12+
- Older go-mysql-driver used `collation_id` in the handshake packet. But it caused collation mismatch in some situation.
13+
- 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.
14+
- If you specify charset, go-mysql-driver sends `SET NAMES <charset>`. This uses the server's default collation for `<charset>`.
15+
- If you specify collation and/or charset, go-mysql-driver sends `SET NAMES charset COLLATE collation`.
16+
- PathEscape dbname in DSN. by @methane in [#1432](https://github.com/go-sql-driver/mysql/pull/1432)
17+
- This is backward incompatible in rare case. Check your DSN.
18+
- Drop Go 1.13-17 support by @methane in [#1420](https://github.com/go-sql-driver/mysql/pull/1420)
19+
- Use Go 1.18+
20+
- Parse numbers on text protocol too by @methane in [#1452](https://github.com/go-sql-driver/mysql/pull/1452)
21+
- When text protocol is used, go-mysql-driver passed bare `[]byte` to database/sql for avoid unnecessary allocation and conversion.
22+
- If user specified `*any` to `Scan()`, database/sql passed the `[]byte` into the target variable.
23+
- This confused users because most user doesn't know when text/binary protocol used.
24+
- 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.
25+
- 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.
26+
- Make TimeTruncate functional option by @methane in [1552](https://github.com/go-sql-driver/mysql/pull/1552)
27+
- Add BeforeConnect callback to configuration object by @ItalyPaleAle in [#1469](https://github.com/go-sql-driver/mysql/pull/1469)
28+
29+
30+
Other changes:
31+
32+
- Adding DeregisterDialContext to prevent memory leaks with dialers we don't need anymore by @jypelle in https://github.com/go-sql-driver/mysql/pull/1422
33+
- Make logger configurable per connection by @frozenbonito in https://github.com/go-sql-driver/mysql/pull/1408
34+
- Fix ColumnType.DatabaseTypeName for mediumint unsigned by @evanelias in https://github.com/go-sql-driver/mysql/pull/1428
35+
- Add connection attributes by @Daemonxiao in https://github.com/go-sql-driver/mysql/pull/1389
36+
- Stop `ColumnTypeScanType()` from returning `sql.RawBytes` by @methane in https://github.com/go-sql-driver/mysql/pull/1424
37+
- Exec() now provides access to status of multiple statements. by @mherr-google in https://github.com/go-sql-driver/mysql/pull/1309
38+
- Allow to change (or disable) the default driver name for registration by @dolmen in https://github.com/go-sql-driver/mysql/pull/1499
39+
- Add default connection attribute '_server_host' by @oblitorum in https://github.com/go-sql-driver/mysql/pull/1506
40+
- QueryUnescape DSN ConnectionAttribute value by @zhangyangyu in https://github.com/go-sql-driver/mysql/pull/1470
41+
- Add client_ed25519 authentication by @Gusted in https://github.com/go-sql-driver/mysql/pull/1518
42+
143
## Version 1.7.1 (2023-04-25)
244

345
Changes:

connection_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ func TestInterpolateParamsUint64(t *testing.T) {
121121

122122
func TestCheckNamedValue(t *testing.T) {
123123
value := driver.NamedValue{Value: ^uint64(0)}
124-
x := &mysqlConn{}
125-
err := x.CheckNamedValue(&value)
124+
mc := &mysqlConn{}
125+
err := mc.CheckNamedValue(&value)
126126

127127
if err != nil {
128128
t.Fatal("uint64 high-bit not convertible", err)

packets.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ import (
2121
"time"
2222
)
2323

24-
// Packets documentation:
25-
// http://dev.mysql.com/doc/internals/en/client-server-protocol.html
24+
// MySQL client/server protocol documentations.
25+
// https://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOCOL.html
26+
// https://mariadb.com/kb/en/clientserver-protocol/
2627

2728
// Read packet to buffer 'data'
2829
func (mc *mysqlConn) readPacket() ([]byte, error) {

0 commit comments

Comments
 (0)