1 // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
3 // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
7 // You can obtain one at http://mozilla.org/MPL/2.0/.
12 defaultAuthPlugin = "mysql_native_password"
13 defaultMaxAllowedPacket = 4 << 20 // 4 MiB
14 minProtocolVersion = 10
15 maxPacketSize = 1<<24 - 1
16 timeFormat = "2006-01-02 15:04:05.999999"
19 // MySQL constants documentation:
20 // http://dev.mysql.com/doc/internals/en/client-server-protocol.html
24 iAuthMoreData byte = 0x01
25 iLocalInFile byte = 0xfb
30 // https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags
31 type clientFlag uint32
34 clientLongPassword clientFlag = 1 << iota
55 clientPluginAuthLenEncClientData
56 clientCanHandleExpiredPasswords
62 comQuit byte = iota + 1
92 // https://dev.mysql.com/doc/internals/en/com-query-response.html#packet-Protocol::ColumnType
96 fieldTypeDecimal fieldType = iota
115 fieldTypeJSON fieldType = iota + 0xf5
128 type fieldFlag uint16
131 flagNotNULL fieldFlag = 1 << iota
149 // http://dev.mysql.com/doc/internals/en/status-flags.html
150 type statusFlag uint16
153 statusInTrans statusFlag = 1 << iota
155 statusReserved // Not in documentation
156 statusMoreResultsExists
157 statusNoGoodIndexUsed
162 statusNoBackslashEscapes
163 statusMetadataChanged
166 statusInTransReadonly
167 statusSessionStateChanged
171 cachingSha2PasswordRequestPublicKey = 2
172 cachingSha2PasswordFastAuthSuccess = 3
173 cachingSha2PasswordPerformFullAuthentication = 4