Skip to content

Commit f07a0be

Browse files
authored
Merge branch 'master' into add-beforeconnect
2 parents ef007e0 + f019727 commit f07a0be

12 files changed

+338
-186
lines changed

Diff for: .github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
9797
- name: test
9898
run: |
99-
go test -v '-race' '-covermode=atomic' '-coverprofile=coverage.out'
99+
go test -v '-race' '-covermode=atomic' '-coverprofile=coverage.out' -parallel 10
100100
101101
- name: Send coverage
102102
uses: shogo82148/actions-goveralls@v1

Diff for: AUTHORS

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Animesh Ray <mail.rayanimesh at gmail.com>
2121
Arne Hormann <arnehormann at gmail.com>
2222
Ariel Mashraki <ariel at mashraki.co.il>
2323
Asta Xie <xiemengjun at gmail.com>
24+
Brian Hendriks <brian at dolthub.com>
2425
Bulat Gaifullin <gaifullinbf at gmail.com>
2526
Caine Jette <jette at alum.mit.edu>
2627
Carlos Nieto <jose.carlos at menteslibres.net>
@@ -55,6 +56,7 @@ Jason Ng <oblitorum at gmail.com>
5556
Jean-Yves Pellé <jy at pelle.link>
5657
Jeff Hodges <jeff at somethingsimilar.com>
5758
Jeffrey Charles <jeffreycharles at gmail.com>
59+
Jennifer Purevsuren <jennifer at dolthub.com>
5860
Jerome Meyer <jxmeyer at gmail.com>
5961
Jiajia Zhong <zhong2plus at gmail.com>
6062
Jian Zhen <zhenjl at gmail.com>
@@ -84,6 +86,7 @@ Oliver Bone <owbone at github.com>
8486
Olivier Mengué <dolmen at cpan.org>
8587
oscarzhao <oscarzhaosl at gmail.com>
8688
Paul Bonser <misterpib at gmail.com>
89+
Paulius Lozys <pauliuslozys at gmail.com>
8790
Peter Schultz <peter.schultz at classmarkets.com>
8891
Phil Porada <philporada at gmail.com>
8992
Rebecca Chin <rchin at pivotal.io>
@@ -116,13 +119,13 @@ Zhang Xiang <angwerzx at 126.com>
116119
Zhenye Xie <xiezhenye at gmail.com>
117120
Zhixin Wen <john.wenzhixin at gmail.com>
118121
Ziheng Lyu <zihenglv at gmail.com>
119-
Brian Hendriks <brian at dolthub.com>
120122

121123
# Organizations
122124

123125
Barracuda Networks, Inc.
124126
Counting Ltd.
125127
DigitalOcean Inc.
128+
Dolthub Inc.
126129
dyves labs AG
127130
Facebook Inc.
128131
GitHub Inc.
@@ -137,4 +140,3 @@ Pivotal Inc.
137140
Shattered Silicon Ltd.
138141
Stripe Inc.
139142
Zendesk Inc.
140-
Dolthub Inc.

Diff for: README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,16 @@ A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) pac
4040
* Optional placeholder interpolation
4141

4242
## Requirements
43-
* Go 1.18 or higher. We aim to support the 3 latest versions of Go.
44-
* MySQL (5.6+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+)
43+
44+
* Go 1.19 or higher. We aim to support the 3 latest versions of Go.
45+
* MySQL (5.7+) and MariaDB (10.3+) are supported.
46+
* [TiDB](https://github.com/pingcap/tidb) is supported by PingCAP.
47+
* Do not ask questions about TiDB in our issue tracker or forum.
48+
* [Document](https://docs.pingcap.com/tidb/v6.1/dev-guide-sample-application-golang)
49+
* [Forum](https://ask.pingcap.com/)
50+
* go-mysql would work with Percona Server, Google CloudSQL or Sphinx (2.2.3+).
51+
* Maintainers won't support them. Do not expect issues are investigated and resolved by maintainers.
52+
* Investigate issues yourself and please send a pull request to fix it.
4553

4654
---------------------------------------
4755

@@ -285,6 +293,15 @@ Note that this sets the location for time.Time values but does not change MySQL'
285293

286294
Please keep in mind, that param values must be [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`.
287295

296+
##### `timeTruncate`
297+
298+
```
299+
Type: duration
300+
Default: 0
301+
```
302+
303+
[Truncate time values](https://pkg.go.dev/time#Duration.Truncate) to the specified duration. The value must be a decimal number with a unit suffix (*"ms"*, *"s"*, *"m"*, *"h"*), such as *"30s"*, *"0.5m"* or *"1m30s"*.
304+
288305
##### `maxAllowedPacket`
289306
```
290307
Type: decimal number

Diff for: conncheck_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
)
1818

1919
func TestStaleConnectionChecks(t *testing.T) {
20-
runTests(t, dsn, func(dbt *DBTest) {
20+
runTestsParallel(t, dsn, func(dbt *DBTest, _ string) {
2121
dbt.mustExec("SET @@SESSION.wait_timeout = 2")
2222

2323
if err := dbt.db.Ping(); err != nil {

Diff for: connection.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
251251
buf = append(buf, "'0000-00-00'"...)
252252
} else {
253253
buf = append(buf, '\'')
254-
buf, err = appendDateTime(buf, v.In(mc.cfg.Loc))
254+
buf, err = appendDateTime(buf, v.In(mc.cfg.Loc), mc.cfg.TimeTruncate)
255255
if err != nil {
256256
return "", err
257257
}

0 commit comments

Comments
 (0)