Closed
Description
When compression is enabled on the client my application fails with connection was bad
, the nested exception is:
io.CopyN failed. err unexpected EOF, copied 0, expected 29
But when disabling compression the application works correctly.
Repro Steps
Start MariaDB in Docker:
docker run --rm -e MYSQL_ROOT_PASSWORD=root -p 3306:3306 mariadb:10.3.39
Create the DB and table found in the attached file
Run this test:
import (
"github.com/go-mysql-org/go-mysql/client"
"github.com/go-mysql-org/go-mysql/mysql"
"github.com/stretchr/testify/assert"
)
func TestServer_ShowFieldTable1(t *testing.T) {
a := assert.New(t)
c, err := client.Connect("localhost:3306", "root", "root", "mydb", func(conn *client.Conn) {
conn.SetCapability(mysql.CLIENT_COMPRESS) // Disable compression and the test will pass
})
a.NoError(err)
execute, err := c.Execute("SHOW FIELDS FROM mydb.table1")
if a.NoError(err) {
rs := execute.Resultset
a.Equal(575, len(rs.RowDatas))
}
}
Metadata
Metadata
Assignees
Labels
No labels