Skip to content

Commit

Permalink
change minCompressLength to 150
Browse files Browse the repository at this point in the history
  • Loading branch information
methane committed Mar 11, 2024
1 parent 5ec621c commit 3d0d418
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (w *compressedWriter) Write(data []byte) (int, error) {
}

// If payload is less than minCompressLength, don't compress.
if uncompressedLen < defaultMinCompressLength {
if uncompressedLen < minCompressLength {
if _, err := buf.Write(payload); err != nil {
return 0, err
}
Expand Down
12 changes: 6 additions & 6 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ package mysql
import "runtime"

const (
defaultAuthPlugin = "mysql_native_password"
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"
defaultMinCompressLength = 50
defaultAuthPlugin = "mysql_native_password"
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"
minCompressLength = 150

// Connection attributes
// See https://dev.mysql.com/doc/refman/8.0/en/performance-schema-connection-attribute-tables.html#performance-schema-connection-attributes-available
Expand Down

0 comments on commit 3d0d418

Please sign in to comment.