mirror of
https://github.com/zr-hebo/sniffer-agent.git
synced 2025-08-10 23:21:40 +08:00
Initial commit
This commit is contained in:
105
session-dealer/mysql/const.go
Normal file
105
session-dealer/mysql/const.go
Normal file
@@ -0,0 +1,105 @@
|
||||
package mysql
|
||||
|
||||
import "errors"
|
||||
|
||||
// Command information.
|
||||
const (
|
||||
ComSleep byte = iota
|
||||
ComQuit
|
||||
ComInitDB
|
||||
ComQuery
|
||||
ComFieldList
|
||||
ComCreateDB
|
||||
ComDropDB
|
||||
ComRefresh
|
||||
ComShutdown
|
||||
ComStatistics
|
||||
ComProcessInfo
|
||||
ComConnect
|
||||
ComProcessKill
|
||||
ComDebug
|
||||
ComPing
|
||||
ComTime
|
||||
ComDelayedInsert
|
||||
ComChangeUser
|
||||
ComBinlogDump
|
||||
ComTableDump
|
||||
ComConnectOut
|
||||
ComRegisterSlave
|
||||
ComStmtPrepare
|
||||
ComStmtExecute
|
||||
ComStmtSendLongData
|
||||
ComStmtClose
|
||||
ComStmtReset
|
||||
ComSetOption
|
||||
ComStmtFetch
|
||||
ComBinlogDumpGtid
|
||||
ComResetConnection
|
||||
)
|
||||
|
||||
const (
|
||||
ComAuth = 141
|
||||
)
|
||||
|
||||
// Client information.
|
||||
const (
|
||||
ClientLongPassword uint32 = 1 << iota
|
||||
ClientFoundRows
|
||||
ClientLongFlag
|
||||
ClientConnectWithDB
|
||||
ClientNoSchema
|
||||
ClientCompress
|
||||
ClientODBC
|
||||
ClientLocalFiles
|
||||
ClientIgnoreSpace
|
||||
ClientProtocol41
|
||||
ClientInteractive
|
||||
ClientSSL
|
||||
ClientIgnoreSigpipe
|
||||
ClientTransactions
|
||||
ClientReserved
|
||||
ClientSecureConnection
|
||||
ClientMultiStatements
|
||||
ClientMultiResults
|
||||
ClientPSMultiResults
|
||||
ClientPluginAuth
|
||||
ClientConnectAtts
|
||||
ClientPluginAuthLenencClientData
|
||||
)
|
||||
|
||||
|
||||
// Auth name information.
|
||||
const (
|
||||
AuthName = "mysql_native_password"
|
||||
)
|
||||
|
||||
|
||||
// MySQL database and tables.
|
||||
const (
|
||||
// SystemDB is the name of system database.
|
||||
SystemDB = "mysql"
|
||||
// UserTable is the table in system db contains user info.
|
||||
UserTable = "User"
|
||||
// DBTable is the table in system db contains db scope privilege info.
|
||||
DBTable = "DB"
|
||||
// GlobalVariablesTable is the table contains global system variables.
|
||||
GlobalVariablesTable = "GLOBAL_VARIABLES"
|
||||
// GlobalStatusTable is the table contains global status variables.
|
||||
GlobalStatusTable = "GLOBAL_STATUS"
|
||||
)
|
||||
|
||||
|
||||
// Identifier length limitations.
|
||||
// See https://dev.mysql.com/doc/refman/5.7/en/identifiers.html
|
||||
const (
|
||||
// MaxPayloadLen is the max packet payload length.
|
||||
MaxPayloadLen = 1<<24 - 1
|
||||
)
|
||||
|
||||
const (
|
||||
datetimeFormat = "2006-01-02 15:04:05"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrMalformPacket = errors.New("malform packet error")
|
||||
)
|
Reference in New Issue
Block a user