Merge pull request #22 from zr-hebo/develop

添加 mysql packet最大允许值设置
This commit is contained in:
河伯 2020-11-24 10:28:51 +08:00 committed by GitHub
commit c925149f97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 8 deletions

View File

@ -16,7 +16,8 @@ var (
strictMode bool
adminUser string
adminPasswd string
// MaxMysqlPacketLen is the max packet payload length.
MaxMysqlPacketLen int
coverRangePool = NewCoveragePool()
localStmtCache = util.NewSliceBufferPool("statement cache", MaxMysqlPacketLen)
@ -27,6 +28,7 @@ func init() {
flag.BoolVar(&strictMode,"strict_mode", false, "strict mode. Default is false")
flag.StringVar(&adminUser,"admin_user", "", "admin user name. When set strict mode, must set admin user to query session info")
flag.StringVar(&adminPasswd,"admin_passwd", "", "admin user passwd. When use strict mode, must set admin user to query session info")
flag.IntVar(&MaxMysqlPacketLen, "max_packet_length", 128 * 1024, "max mysql packet length. Default is 128 * 1024")
}
func CheckParams() {

View File

@ -91,13 +91,6 @@ const (
GlobalStatusTable = "GLOBAL_STATUS"
)
// Identifier length limitations.
const (
// MaxMysqlPacketLen is the max packet payload length.
MaxMysqlPacketLen = 128 * 1024
)
const (
millSecondUnit = int64(time.Millisecond)
)