mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
* go modified fiddling with vendor got rid of the vendor directory revendored but with the exact same versions of things maybe better added mods for the images revendored using `GOFLAGS` instead of repeating my self vendor everything to the exact same commit hash as before and fixed ugorji Delete Deproxy.toml empty file cleaned up some file cleaned up some cruft get rid of some unused packages and exclude some Microsoft packages added flags to the variables that get pushed into docker in the makefile It works I suppose added noop excluded what we did not want even less hacky reverted to a version that has not been mangled * get rid of my experiment
175 lines
3.3 KiB
Go
175 lines
3.3 KiB
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
|
|
//
|
|
// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
|
|
//
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package mysql
|
|
|
|
const (
|
|
defaultAuthPlugin = "mysql_native_password"
|
|
defaultMaxAllowedPacket = 4 << 20 // 4 MiB
|
|
minProtocolVersion = 10
|
|
maxPacketSize = 1<<24 - 1
|
|
timeFormat = "2006-01-02 15:04:05.999999"
|
|
)
|
|
|
|
// MySQL constants documentation:
|
|
// http://dev.mysql.com/doc/internals/en/client-server-protocol.html
|
|
|
|
const (
|
|
iOK byte = 0x00
|
|
iAuthMoreData byte = 0x01
|
|
iLocalInFile byte = 0xfb
|
|
iEOF byte = 0xfe
|
|
iERR byte = 0xff
|
|
)
|
|
|
|
// https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags
|
|
type clientFlag uint32
|
|
|
|
const (
|
|
clientLongPassword clientFlag = 1 << iota
|
|
clientFoundRows
|
|
clientLongFlag
|
|
clientConnectWithDB
|
|
clientNoSchema
|
|
clientCompress
|
|
clientODBC
|
|
clientLocalFiles
|
|
clientIgnoreSpace
|
|
clientProtocol41
|
|
clientInteractive
|
|
clientSSL
|
|
clientIgnoreSIGPIPE
|
|
clientTransactions
|
|
clientReserved
|
|
clientSecureConn
|
|
clientMultiStatements
|
|
clientMultiResults
|
|
clientPSMultiResults
|
|
clientPluginAuth
|
|
clientConnectAttrs
|
|
clientPluginAuthLenEncClientData
|
|
clientCanHandleExpiredPasswords
|
|
clientSessionTrack
|
|
clientDeprecateEOF
|
|
)
|
|
|
|
const (
|
|
comQuit byte = iota + 1
|
|
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
|
|
)
|
|
|
|
// https://dev.mysql.com/doc/internals/en/com-query-response.html#packet-Protocol::ColumnType
|
|
type fieldType byte
|
|
|
|
const (
|
|
fieldTypeDecimal fieldType = iota
|
|
fieldTypeTiny
|
|
fieldTypeShort
|
|
fieldTypeLong
|
|
fieldTypeFloat
|
|
fieldTypeDouble
|
|
fieldTypeNULL
|
|
fieldTypeTimestamp
|
|
fieldTypeLongLong
|
|
fieldTypeInt24
|
|
fieldTypeDate
|
|
fieldTypeTime
|
|
fieldTypeDateTime
|
|
fieldTypeYear
|
|
fieldTypeNewDate
|
|
fieldTypeVarChar
|
|
fieldTypeBit
|
|
)
|
|
const (
|
|
fieldTypeJSON fieldType = iota + 0xf5
|
|
fieldTypeNewDecimal
|
|
fieldTypeEnum
|
|
fieldTypeSet
|
|
fieldTypeTinyBLOB
|
|
fieldTypeMediumBLOB
|
|
fieldTypeLongBLOB
|
|
fieldTypeBLOB
|
|
fieldTypeVarString
|
|
fieldTypeString
|
|
fieldTypeGeometry
|
|
)
|
|
|
|
type fieldFlag uint16
|
|
|
|
const (
|
|
flagNotNULL fieldFlag = 1 << iota
|
|
flagPriKey
|
|
flagUniqueKey
|
|
flagMultipleKey
|
|
flagBLOB
|
|
flagUnsigned
|
|
flagZeroFill
|
|
flagBinary
|
|
flagEnum
|
|
flagAutoIncrement
|
|
flagTimestamp
|
|
flagSet
|
|
flagUnknown1
|
|
flagUnknown2
|
|
flagUnknown3
|
|
flagUnknown4
|
|
)
|
|
|
|
// http://dev.mysql.com/doc/internals/en/status-flags.html
|
|
type statusFlag uint16
|
|
|
|
const (
|
|
statusInTrans statusFlag = 1 << iota
|
|
statusInAutocommit
|
|
statusReserved // Not in documentation
|
|
statusMoreResultsExists
|
|
statusNoGoodIndexUsed
|
|
statusNoIndexUsed
|
|
statusCursorExists
|
|
statusLastRowSent
|
|
statusDbDropped
|
|
statusNoBackslashEscapes
|
|
statusMetadataChanged
|
|
statusQueryWasSlow
|
|
statusPsOutParams
|
|
statusInTransReadonly
|
|
statusSessionStateChanged
|
|
)
|
|
|
|
const (
|
|
cachingSha2PasswordRequestPublicKey = 2
|
|
cachingSha2PasswordFastAuthSuccess = 3
|
|
cachingSha2PasswordPerformFullAuthentication = 4
|
|
)
|