github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/database/mysql/const.go (about) 1 // Go MySQL Driver - A MySQL-Driver for Go's database/sql package 2 // 3 // Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved. 4 // 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/. 8 9 package mysql 10 11 const ( 12 minProtocolVersion byte = 10 13 maxPacketSize = 1<<24 - 1 14 timeFormat = "2006-01-02 15:04:05" 15 ) 16 17 // MySQL constants documentation: 18 // http://dev.mysql.com/doc/internals/en/client-server-protocol.html 19 20 const ( 21 iOK byte = 0x00 22 iLocalInFile byte = 0xfb 23 iEOF byte = 0xfe 24 iERR byte = 0xff 25 ) 26 27 type clientFlag uint32 28 29 const ( 30 clientLongPassword clientFlag = 1 << iota 31 clientFoundRows 32 clientLongFlag 33 clientConnectWithDB 34 clientNoSchema 35 clientCompress 36 clientODBC 37 clientLocalFiles 38 clientIgnoreSpace 39 clientProtocol41 40 clientInteractive 41 clientSSL 42 clientIgnoreSIGPIPE 43 clientTransactions 44 clientReserved 45 clientSecureConn 46 clientMultiStatements 47 clientMultiResults 48 ) 49 50 const ( 51 comQuit byte = iota + 1 52 comInitDB 53 comQuery 54 comFieldList 55 comCreateDB 56 comDropDB 57 comRefresh 58 comShutdown 59 comStatistics 60 comProcessInfo 61 comConnect 62 comProcessKill 63 comDebug 64 comPing 65 comTime 66 comDelayedInsert 67 comChangeUser 68 comBinlogDump 69 comTableDump 70 comConnectOut 71 comRegiserSlave 72 comStmtPrepare 73 comStmtExecute 74 comStmtSendLongData 75 comStmtClose 76 comStmtReset 77 comSetOption 78 comStmtFetch 79 ) 80 81 const ( 82 fieldTypeDecimal byte = iota 83 fieldTypeTiny 84 fieldTypeShort 85 fieldTypeLong 86 fieldTypeFloat 87 fieldTypeDouble 88 fieldTypeNULL 89 fieldTypeTimestamp 90 fieldTypeLongLong 91 fieldTypeInt24 92 fieldTypeDate 93 fieldTypeTime 94 fieldTypeDateTime 95 fieldTypeYear 96 fieldTypeNewDate 97 fieldTypeVarChar 98 fieldTypeBit 99 ) 100 const ( 101 fieldTypeNewDecimal byte = iota + 0xf6 102 fieldTypeEnum 103 fieldTypeSet 104 fieldTypeTinyBLOB 105 fieldTypeMediumBLOB 106 fieldTypeLongBLOB 107 fieldTypeBLOB 108 fieldTypeVarString 109 fieldTypeString 110 fieldTypeGeometry 111 ) 112 113 type fieldFlag uint16 114 115 const ( 116 flagNotNULL fieldFlag = 1 << iota 117 flagPriKey 118 flagUniqueKey 119 flagMultipleKey 120 flagBLOB 121 flagUnsigned 122 flagZeroFill 123 flagBinary 124 flagEnum 125 flagAutoIncrement 126 flagTimestamp 127 flagSet 128 flagUnknown1 129 flagUnknown2 130 flagUnknown3 131 flagUnknown4 132 )