From 4591e42e65cf483147a7c7a4f4cfeac81b21c917 Mon Sep 17 00:00:00 2001 From: ICHINOSE Shogo Date: Fri, 9 Dec 2022 20:51:20 +0900 Subject: [PATCH 1/7] bump actions/checkout@v3 and actions/setup-go@v3 (#1375) * bump actions/checkout@v3 and actions/setup-go@v3 * enable cache of actions/setup-go * Revert "enable cache of actions/setup-go" I don't know why, but some jobs fail with "Could not get cache folder paths". This reverts commit 185228e0e3110b182759332193ebd75ed7054477. --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 703203258..f5ba6b99c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,8 +66,8 @@ jobs: fail-fast: false matrix: ${{ fromJSON(needs.list.outputs.matrix) }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - uses: shogo82148/actions-setup-mysql@v1 From af380e92cd245f1815fa16f42ea65472a7cb06ee Mon Sep 17 00:00:00 2001 From: Samantha Date: Wed, 8 Mar 2023 03:16:29 -0500 Subject: [PATCH 2/7] Use SET syntax as specified in the MySQL documentation (#1402) --- AUTHORS | 1 + connection.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 051327519..6f7041c7a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -83,6 +83,7 @@ Reed Allman Richard Wilkes Robert Russell Runrioter Wung +Samantha Frank Santhosh Kumar Tekuri Sho Iizuka Sho Ikeda diff --git a/connection.go b/connection.go index 9539077cb..947a883e3 100644 --- a/connection.go +++ b/connection.go @@ -71,10 +71,10 @@ func (mc *mysqlConn) handleParams() (err error) { cmdSet.Grow(4 + len(param) + 1 + len(val) + 30*(len(mc.cfg.Params)-1)) cmdSet.WriteString("SET ") } else { - cmdSet.WriteByte(',') + cmdSet.WriteString(", ") } cmdSet.WriteString(param) - cmdSet.WriteByte('=') + cmdSet.WriteString(" = ") cmdSet.WriteString(val) } } From d83ecdc268ff92fa198c0bf64356a1479cc83438 Mon Sep 17 00:00:00 2001 From: Phil Porada Date: Wed, 29 Mar 2023 21:34:18 -0400 Subject: [PATCH 3/7] Add go1.20 and mariadb10.11 to the testing matrix (#1403) * Add go1.20 and mariadb10.11 to the testing matrix * Use latest upstream actions-setup-mysql which has support for mariadb 10.11 * Update authors file --- .github/workflows/test.yml | 6 ++++-- AUTHORS | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f5ba6b99c..d45ed0fa9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,8 +23,9 @@ jobs: import os go = [ # Keep the most recent production release at the top - '1.19', + '1.20', # Older production releases + '1.19', '1.18', '1.17', '1.16', @@ -36,6 +37,7 @@ jobs: '8.0', '5.7', '5.6', + 'mariadb-10.11', 'mariadb-10.6', 'mariadb-10.5', 'mariadb-10.4', @@ -70,7 +72,7 @@ jobs: - uses: actions/setup-go@v3 with: go-version: ${{ matrix.go }} - - uses: shogo82148/actions-setup-mysql@v1 + - uses: shogo82148/actions-setup-mysql@v1.15.0 with: mysql-version: ${{ matrix.mysql }} user: ${{ env.MYSQL_TEST_USER }} diff --git a/AUTHORS b/AUTHORS index 6f7041c7a..fb1478c3b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -78,6 +78,7 @@ Olivier Mengué oscarzhao Paul Bonser Peter Schultz +Phil Porada Rebecca Chin Reed Allman Richard Wilkes From f0e16c6977aae7045c058989971467759e470e99 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 14 Apr 2023 19:00:15 +0900 Subject: [PATCH 4/7] Increase default maxAllowedPacket size. (#1411) 64MiB is same to MySQL 8.0. --- README.md | 2 +- const.go | 2 +- errors.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 25de2e5aa..252bbefdf 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ Please keep in mind, that param values must be [url.QueryEscape](https://golang. ##### `maxAllowedPacket` ``` Type: decimal number -Default: 4194304 +Default: 64*1024*1024 ``` Max packet size allowed in bytes. The default value is 4 MiB and should be adjusted to match the server settings. `maxAllowedPacket=0` can be used to automatically fetch the `max_allowed_packet` variable from server *on every connection*. diff --git a/const.go b/const.go index b1e6b85ef..64e2bced6 100644 --- a/const.go +++ b/const.go @@ -10,7 +10,7 @@ package mysql const ( defaultAuthPlugin = "mysql_native_password" - defaultMaxAllowedPacket = 4 << 20 // 4 MiB + defaultMaxAllowedPacket = 64 << 20 // 64 MiB. See https://github.com/go-sql-driver/mysql/issues/1355 minProtocolVersion = 10 maxPacketSize = 1<<24 - 1 timeFormat = "2006-01-02 15:04:05.999999" diff --git a/errors.go b/errors.go index 7c037e7d6..ff9a8f088 100644 --- a/errors.go +++ b/errors.go @@ -27,7 +27,7 @@ var ( ErrOldProtocol = errors.New("MySQL server does not support required protocol 41+") ErrPktSync = errors.New("commands out of sync. You can't run this command now") ErrPktSyncMul = errors.New("commands out of sync. Did you run multiple statements at once?") - ErrPktTooLarge = errors.New("packet for query is too large. Try adjusting the 'max_allowed_packet' variable on the server") + ErrPktTooLarge = errors.New("packet for query is too large. Try adjusting the `Config.MaxAllowedPacket`") ErrBusyBuffer = errors.New("busy buffer") // errBadConnNoWrite is used for connection errors where nothing was sent to the database yet. From faedeff6d3187aad8fa1d08a206d082f8c371656 Mon Sep 17 00:00:00 2001 From: Simon J Mudd Date: Sat, 15 Apr 2023 15:38:33 +0200 Subject: [PATCH 5/7] Correct maxAllowedPacket default value mentioned in docs to match the new setting (#1412) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 252bbefdf..3b5d229aa 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,7 @@ Type: decimal number Default: 64*1024*1024 ``` -Max packet size allowed in bytes. The default value is 4 MiB and should be adjusted to match the server settings. `maxAllowedPacket=0` can be used to automatically fetch the `max_allowed_packet` variable from server *on every connection*. +Max packet size allowed in bytes. The default value is 64 MiB and should be adjusted to match the server settings. `maxAllowedPacket=0` can be used to automatically fetch the `max_allowed_packet` variable from server *on every connection*. ##### `multiStatements` From 8503110d880a06b863c5a93c8214068c71f16e9d Mon Sep 17 00:00:00 2001 From: cui fliter Date: Tue, 25 Apr 2023 13:46:24 +0800 Subject: [PATCH 6/7] fix some comments (#1417) Signed-off-by: cui fliter --- driver_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver_test.go b/driver_test.go index 4850498d0..a1c776728 100644 --- a/driver_test.go +++ b/driver_test.go @@ -2703,7 +2703,7 @@ func TestContextBeginIsolationLevel(t *testing.T) { if err := row.Scan(&v); err != nil { dbt.Fatal(err) } - // Because writer transaction wasn't commited yet, it should be available + // Because writer transaction wasn't committed yet, it should be available if v != 0 { dbt.Errorf("expected val to be 0, got %d", v) } @@ -2717,7 +2717,7 @@ func TestContextBeginIsolationLevel(t *testing.T) { if err := row.Scan(&v); err != nil { dbt.Fatal(err) } - // Data written by writer transaction is already commited, it should be selectable + // Data written by writer transaction is already committed, it should be selectable if v != 1 { dbt.Errorf("expected val to be 1, got %d", v) } From f20b2863636093e5fbf1481b59bdaff3b0fbb779 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 25 Apr 2023 19:02:15 +0900 Subject: [PATCH 7/7] Update changelog for version 1.7.1 (#1418) --- CHANGELOG.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77024a820..5166e4adb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +## Version 1.7.1 (2023-04-25) + +Changes: + + - bump actions/checkout@v3 and actions/setup-go@v3 (#1375) + - Add go1.20 and mariadb10.11 to the testing matrix (#1403) + - Increase default maxAllowedPacket size. (#1411) + +Bugfixes: + + - Use SET syntax as specified in the MySQL documentation (#1402) + + ## Version 1.7 (2022-11-29) Changes: