1
0
Fork 0
forked from forgejo/forgejo

Integrate public as bindata optionally (#293)

* Dropped unused codekit config

* Integrated dynamic and static bindata for public

* Ignore public bindata

* Add a general generate make task

* Integrated flexible public assets into web command

* Updated vendoring, added all missiong govendor deps

* Made the linter happy with the bindata and dynamic code

* Moved public bindata definition to modules directory

* Ignoring the new bindata path now

* Updated to the new public modules import path

* Updated public bindata command and drop the new prefix
This commit is contained in:
Thomas Boerger 2016-11-29 17:26:36 +01:00 committed by Lunny Xiao
parent 4680c349dd
commit b6a95a8cb3
691 changed files with 305318 additions and 1272 deletions

106
vendor/github.com/pingcap/tidb/mysql/bit.go generated vendored Normal file
View file

@ -0,0 +1,106 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
import (
"fmt"
"strconv"
"strings"
"github.com/juju/errors"
)
// Bit is for mysql bit type.
type Bit struct {
// Value holds the value for bit type.
Value uint64
// Width is the display with for bit value.
// e.g, with is 8, 0 is for 0b00000000.
Width int
}
// String implements fmt.Stringer interface.
func (b Bit) String() string {
format := fmt.Sprintf("0b%%0%db", b.Width)
return fmt.Sprintf(format, b.Value)
}
// ToNumber changes bit type to float64 for numeric operation.
// MySQL treats bit as double type.
func (b Bit) ToNumber() float64 {
return float64(b.Value)
}
// ToString returns the binary string for bit type.
func (b Bit) ToString() string {
byteSize := (b.Width + 7) / 8
buf := make([]byte, byteSize)
for i := byteSize - 1; i >= 0; i-- {
buf[byteSize-i-1] = byte(b.Value >> uint(i*8))
}
return string(buf)
}
// Min and Max bit width.
const (
MinBitWidth = 1
MaxBitWidth = 64
// UnspecifiedBitWidth is the unspecified with if you want to calculate bit width dynamically.
UnspecifiedBitWidth = -1
)
// ParseBit parses bit string.
// The string format can be b'val', B'val' or 0bval, val must be 0 or 1.
// Width is the display width for bit representation. -1 means calculating
// width dynamically, using following algorithm: (len("011101") + 7) & ^7,
// e.g, if bit string is 0b01, the above will return 8 for its bit width.
func ParseBit(s string, width int) (Bit, error) {
if len(s) == 0 {
return Bit{}, errors.Errorf("invalid empty string for parsing bit type")
}
if s[0] == 'b' || s[0] == 'B' {
// format is b'val' or B'val'
s = strings.Trim(s[1:], "'")
} else if strings.HasPrefix(s, "0b") {
s = s[2:]
} else {
// here means format is not b'val', B'val' or 0bval.
return Bit{}, errors.Errorf("invalid bit type format %s", s)
}
if width == UnspecifiedBitWidth {
width = (len(s) + 7) & ^7
}
if width == 0 {
width = MinBitWidth
}
if width < MinBitWidth || width > MaxBitWidth {
return Bit{}, errors.Errorf("invalid display width for bit type, must in [1, 64], but %d", width)
}
n, err := strconv.ParseUint(s, 2, 64)
if err != nil {
return Bit{}, errors.Trace(err)
}
if n > (uint64(1)<<uint64(width))-1 {
return Bit{}, errors.Errorf("bit %s is too long for width %d", s, width)
}
return Bit{Value: n, Width: width}, nil
}

556
vendor/github.com/pingcap/tidb/mysql/charset.go generated vendored Normal file
View file

@ -0,0 +1,556 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// CharsetIDs maps charset name to its default collation ID.
var CharsetIDs = map[string]uint8{
"big5": 1,
"dec8": 3,
"cp850": 4,
"hp8": 6,
"koi8r": 7,
"latin1": 8,
"latin2": 9,
"swe7": 10,
"ascii": 11,
"ujis": 12,
"sjis": 13,
"hebrew": 16,
"tis620": 18,
"euckr": 19,
"koi8u": 22,
"gb2312": 24,
"greek": 25,
"cp1250": 26,
"gbk": 28,
"latin5": 30,
"armscii8": 32,
"utf8": 33,
"ucs2": 35,
"cp866": 36,
"keybcs2": 37,
"macce": 38,
"macroman": 39,
"cp852": 40,
"latin7": 41,
"utf8mb4": 45,
"cp1251": 51,
"utf16": 54,
"utf16le": 56,
"cp1256": 57,
"cp1257": 59,
"utf32": 60,
"binary": 63,
"geostd8": 92,
"cp932": 95,
"eucjpms": 97,
}
// Charsets maps charset name to its default collation name.
var Charsets = map[string]string{
"big5": "big5_chinese_ci",
"dec8": "dec8_swedish_ci",
"cp850": "cp850_general_ci",
"hp8": "hp8_english_ci",
"koi8r": "koi8r_general_ci",
"latin1": "latin1_swedish_ci",
"latin2": "latin2_general_ci",
"swe7": "swe7_swedish_ci",
"ascii": "ascii_general_ci",
"ujis": "ujis_japanese_ci",
"sjis": "sjis_japanese_ci",
"hebrew": "hebrew_general_ci",
"tis620": "tis620_thai_ci",
"euckr": "euckr_korean_ci",
"koi8u": "koi8u_general_ci",
"gb2312": "gb2312_chinese_ci",
"greek": "greek_general_ci",
"cp1250": "cp1250_general_ci",
"gbk": "gbk_chinese_ci",
"latin5": "latin5_turkish_ci",
"armscii8": "armscii8_general_ci",
"utf8": "utf8_general_ci",
"ucs2": "ucs2_general_ci",
"cp866": "cp866_general_ci",
"keybcs2": "keybcs2_general_ci",
"macce": "macce_general_ci",
"macroman": "macroman_general_ci",
"cp852": "cp852_general_ci",
"latin7": "latin7_general_ci",
"utf8mb4": "utf8mb4_general_ci",
"cp1251": "cp1251_general_ci",
"utf16": "utf16_general_ci",
"utf16le": "utf16le_general_ci",
"cp1256": "cp1256_general_ci",
"cp1257": "cp1257_general_ci",
"utf32": "utf32_general_ci",
"binary": "binary",
"geostd8": "geostd8_general_ci",
"cp932": "cp932_japanese_ci",
"eucjpms": "eucjpms_japanese_ci",
}
// Collations maps MySQL default collation ID to its name.
var Collations = map[uint8]string{
1: "big5_chinese_ci",
2: "latin2_czech_cs",
3: "dec8_swedish_ci",
4: "cp850_general_ci",
5: "latin1_german1_ci",
6: "hp8_english_ci",
7: "koi8r_general_ci",
8: "latin1_swedish_ci",
9: "latin2_general_ci",
10: "swe7_swedish_ci",
11: "ascii_general_ci",
12: "ujis_japanese_ci",
13: "sjis_japanese_ci",
14: "cp1251_bulgarian_ci",
15: "latin1_danish_ci",
16: "hebrew_general_ci",
18: "tis620_thai_ci",
19: "euckr_korean_ci",
20: "latin7_estonian_cs",
21: "latin2_hungarian_ci",
22: "koi8u_general_ci",
23: "cp1251_ukrainian_ci",
24: "gb2312_chinese_ci",
25: "greek_general_ci",
26: "cp1250_general_ci",
27: "latin2_croatian_ci",
28: "gbk_chinese_ci",
29: "cp1257_lithuanian_ci",
30: "latin5_turkish_ci",
31: "latin1_german2_ci",
32: "armscii8_general_ci",
33: "utf8_general_ci",
34: "cp1250_czech_cs",
35: "ucs2_general_ci",
36: "cp866_general_ci",
37: "keybcs2_general_ci",
38: "macce_general_ci",
39: "macroman_general_ci",
40: "cp852_general_ci",
41: "latin7_general_ci",
42: "latin7_general_cs",
43: "macce_bin",
44: "cp1250_croatian_ci",
45: "utf8mb4_general_ci",
46: "utf8mb4_bin",
47: "latin1_bin",
48: "latin1_general_ci",
49: "latin1_general_cs",
50: "cp1251_bin",
51: "cp1251_general_ci",
52: "cp1251_general_cs",
53: "macroman_bin",
54: "utf16_general_ci",
55: "utf16_bin",
56: "utf16le_general_ci",
57: "cp1256_general_ci",
58: "cp1257_bin",
59: "cp1257_general_ci",
60: "utf32_general_ci",
61: "utf32_bin",
62: "utf16le_bin",
63: "binary",
64: "armscii8_bin",
65: "ascii_bin",
66: "cp1250_bin",
67: "cp1256_bin",
68: "cp866_bin",
69: "dec8_bin",
70: "greek_bin",
71: "hebrew_bin",
72: "hp8_bin",
73: "keybcs2_bin",
74: "koi8r_bin",
75: "koi8u_bin",
77: "latin2_bin",
78: "latin5_bin",
79: "latin7_bin",
80: "cp850_bin",
81: "cp852_bin",
82: "swe7_bin",
83: "utf8_bin",
84: "big5_bin",
85: "euckr_bin",
86: "gb2312_bin",
87: "gbk_bin",
88: "sjis_bin",
89: "tis620_bin",
90: "ucs2_bin",
91: "ujis_bin",
92: "geostd8_general_ci",
93: "geostd8_bin",
94: "latin1_spanish_ci",
95: "cp932_japanese_ci",
96: "cp932_bin",
97: "eucjpms_japanese_ci",
98: "eucjpms_bin",
99: "cp1250_polish_ci",
101: "utf16_unicode_ci",
102: "utf16_icelandic_ci",
103: "utf16_latvian_ci",
104: "utf16_romanian_ci",
105: "utf16_slovenian_ci",
106: "utf16_polish_ci",
107: "utf16_estonian_ci",
108: "utf16_spanish_ci",
109: "utf16_swedish_ci",
110: "utf16_turkish_ci",
111: "utf16_czech_ci",
112: "utf16_danish_ci",
113: "utf16_lithuanian_ci",
114: "utf16_slovak_ci",
115: "utf16_spanish2_ci",
116: "utf16_roman_ci",
117: "utf16_persian_ci",
118: "utf16_esperanto_ci",
119: "utf16_hungarian_ci",
120: "utf16_sinhala_ci",
121: "utf16_german2_ci",
122: "utf16_croatian_ci",
123: "utf16_unicode_520_ci",
124: "utf16_vietnamese_ci",
128: "ucs2_unicode_ci",
129: "ucs2_icelandic_ci",
130: "ucs2_latvian_ci",
131: "ucs2_romanian_ci",
132: "ucs2_slovenian_ci",
133: "ucs2_polish_ci",
134: "ucs2_estonian_ci",
135: "ucs2_spanish_ci",
136: "ucs2_swedish_ci",
137: "ucs2_turkish_ci",
138: "ucs2_czech_ci",
139: "ucs2_danish_ci",
140: "ucs2_lithuanian_ci",
141: "ucs2_slovak_ci",
142: "ucs2_spanish2_ci",
143: "ucs2_roman_ci",
144: "ucs2_persian_ci",
145: "ucs2_esperanto_ci",
146: "ucs2_hungarian_ci",
147: "ucs2_sinhala_ci",
148: "ucs2_german2_ci",
149: "ucs2_croatian_ci",
150: "ucs2_unicode_520_ci",
151: "ucs2_vietnamese_ci",
159: "ucs2_general_mysql500_ci",
160: "utf32_unicode_ci",
161: "utf32_icelandic_ci",
162: "utf32_latvian_ci",
163: "utf32_romanian_ci",
164: "utf32_slovenian_ci",
165: "utf32_polish_ci",
166: "utf32_estonian_ci",
167: "utf32_spanish_ci",
168: "utf32_swedish_ci",
169: "utf32_turkish_ci",
170: "utf32_czech_ci",
171: "utf32_danish_ci",
172: "utf32_lithuanian_ci",
173: "utf32_slovak_ci",
174: "utf32_spanish2_ci",
175: "utf32_roman_ci",
176: "utf32_persian_ci",
177: "utf32_esperanto_ci",
178: "utf32_hungarian_ci",
179: "utf32_sinhala_ci",
180: "utf32_german2_ci",
181: "utf32_croatian_ci",
182: "utf32_unicode_520_ci",
183: "utf32_vietnamese_ci",
192: "utf8_unicode_ci",
193: "utf8_icelandic_ci",
194: "utf8_latvian_ci",
195: "utf8_romanian_ci",
196: "utf8_slovenian_ci",
197: "utf8_polish_ci",
198: "utf8_estonian_ci",
199: "utf8_spanish_ci",
200: "utf8_swedish_ci",
201: "utf8_turkish_ci",
202: "utf8_czech_ci",
203: "utf8_danish_ci",
204: "utf8_lithuanian_ci",
205: "utf8_slovak_ci",
206: "utf8_spanish2_ci",
207: "utf8_roman_ci",
208: "utf8_persian_ci",
209: "utf8_esperanto_ci",
210: "utf8_hungarian_ci",
211: "utf8_sinhala_ci",
212: "utf8_german2_ci",
213: "utf8_croatian_ci",
214: "utf8_unicode_520_ci",
215: "utf8_vietnamese_ci",
223: "utf8_general_mysql500_ci",
224: "utf8mb4_unicode_ci",
225: "utf8mb4_icelandic_ci",
226: "utf8mb4_latvian_ci",
227: "utf8mb4_romanian_ci",
228: "utf8mb4_slovenian_ci",
229: "utf8mb4_polish_ci",
230: "utf8mb4_estonian_ci",
231: "utf8mb4_spanish_ci",
232: "utf8mb4_swedish_ci",
233: "utf8mb4_turkish_ci",
234: "utf8mb4_czech_ci",
235: "utf8mb4_danish_ci",
236: "utf8mb4_lithuanian_ci",
237: "utf8mb4_slovak_ci",
238: "utf8mb4_spanish2_ci",
239: "utf8mb4_roman_ci",
240: "utf8mb4_persian_ci",
241: "utf8mb4_esperanto_ci",
242: "utf8mb4_hungarian_ci",
243: "utf8mb4_sinhala_ci",
244: "utf8mb4_german2_ci",
245: "utf8mb4_croatian_ci",
246: "utf8mb4_unicode_520_ci",
247: "utf8mb4_vietnamese_ci",
}
// CollationNames maps MySQL default collation name to its ID
var CollationNames = map[string]uint8{
"big5_chinese_ci": 1,
"latin2_czech_cs": 2,
"dec8_swedish_ci": 3,
"cp850_general_ci": 4,
"latin1_german1_ci": 5,
"hp8_english_ci": 6,
"koi8r_general_ci": 7,
"latin1_swedish_ci": 8,
"latin2_general_ci": 9,
"swe7_swedish_ci": 10,
"ascii_general_ci": 11,
"ujis_japanese_ci": 12,
"sjis_japanese_ci": 13,
"cp1251_bulgarian_ci": 14,
"latin1_danish_ci": 15,
"hebrew_general_ci": 16,
"tis620_thai_ci": 18,
"euckr_korean_ci": 19,
"latin7_estonian_cs": 20,
"latin2_hungarian_ci": 21,
"koi8u_general_ci": 22,
"cp1251_ukrainian_ci": 23,
"gb2312_chinese_ci": 24,
"greek_general_ci": 25,
"cp1250_general_ci": 26,
"latin2_croatian_ci": 27,
"gbk_chinese_ci": 28,
"cp1257_lithuanian_ci": 29,
"latin5_turkish_ci": 30,
"latin1_german2_ci": 31,
"armscii8_general_ci": 32,
"utf8_general_ci": 33,
"cp1250_czech_cs": 34,
"ucs2_general_ci": 35,
"cp866_general_ci": 36,
"keybcs2_general_ci": 37,
"macce_general_ci": 38,
"macroman_general_ci": 39,
"cp852_general_ci": 40,
"latin7_general_ci": 41,
"latin7_general_cs": 42,
"macce_bin": 43,
"cp1250_croatian_ci": 44,
"utf8mb4_general_ci": 45,
"utf8mb4_bin": 46,
"latin1_bin": 47,
"latin1_general_ci": 48,
"latin1_general_cs": 49,
"cp1251_bin": 50,
"cp1251_general_ci": 51,
"cp1251_general_cs": 52,
"macroman_bin": 53,
"utf16_general_ci": 54,
"utf16_bin": 55,
"utf16le_general_ci": 56,
"cp1256_general_ci": 57,
"cp1257_bin": 58,
"cp1257_general_ci": 59,
"utf32_general_ci": 60,
"utf32_bin": 61,
"utf16le_bin": 62,
"binary": 63,
"armscii8_bin": 64,
"ascii_bin": 65,
"cp1250_bin": 66,
"cp1256_bin": 67,
"cp866_bin": 68,
"dec8_bin": 69,
"greek_bin": 70,
"hebrew_bin": 71,
"hp8_bin": 72,
"keybcs2_bin": 73,
"koi8r_bin": 74,
"koi8u_bin": 75,
"latin2_bin": 77,
"latin5_bin": 78,
"latin7_bin": 79,
"cp850_bin": 80,
"cp852_bin": 81,
"swe7_bin": 82,
"utf8_bin": 83,
"big5_bin": 84,
"euckr_bin": 85,
"gb2312_bin": 86,
"gbk_bin": 87,
"sjis_bin": 88,
"tis620_bin": 89,
"ucs2_bin": 90,
"ujis_bin": 91,
"geostd8_general_ci": 92,
"geostd8_bin": 93,
"latin1_spanish_ci": 94,
"cp932_japanese_ci": 95,
"cp932_bin": 96,
"eucjpms_japanese_ci": 97,
"eucjpms_bin": 98,
"cp1250_polish_ci": 99,
"utf16_unicode_ci": 101,
"utf16_icelandic_ci": 102,
"utf16_latvian_ci": 103,
"utf16_romanian_ci": 104,
"utf16_slovenian_ci": 105,
"utf16_polish_ci": 106,
"utf16_estonian_ci": 107,
"utf16_spanish_ci": 108,
"utf16_swedish_ci": 109,
"utf16_turkish_ci": 110,
"utf16_czech_ci": 111,
"utf16_danish_ci": 112,
"utf16_lithuanian_ci": 113,
"utf16_slovak_ci": 114,
"utf16_spanish2_ci": 115,
"utf16_roman_ci": 116,
"utf16_persian_ci": 117,
"utf16_esperanto_ci": 118,
"utf16_hungarian_ci": 119,
"utf16_sinhala_ci": 120,
"utf16_german2_ci": 121,
"utf16_croatian_ci": 122,
"utf16_unicode_520_ci": 123,
"utf16_vietnamese_ci": 124,
"ucs2_unicode_ci": 128,
"ucs2_icelandic_ci": 129,
"ucs2_latvian_ci": 130,
"ucs2_romanian_ci": 131,
"ucs2_slovenian_ci": 132,
"ucs2_polish_ci": 133,
"ucs2_estonian_ci": 134,
"ucs2_spanish_ci": 135,
"ucs2_swedish_ci": 136,
"ucs2_turkish_ci": 137,
"ucs2_czech_ci": 138,
"ucs2_danish_ci": 139,
"ucs2_lithuanian_ci": 140,
"ucs2_slovak_ci": 141,
"ucs2_spanish2_ci": 142,
"ucs2_roman_ci": 143,
"ucs2_persian_ci": 144,
"ucs2_esperanto_ci": 145,
"ucs2_hungarian_ci": 146,
"ucs2_sinhala_ci": 147,
"ucs2_german2_ci": 148,
"ucs2_croatian_ci": 149,
"ucs2_unicode_520_ci": 150,
"ucs2_vietnamese_ci": 151,
"ucs2_general_mysql500_ci": 159,
"utf32_unicode_ci": 160,
"utf32_icelandic_ci": 161,
"utf32_latvian_ci": 162,
"utf32_romanian_ci": 163,
"utf32_slovenian_ci": 164,
"utf32_polish_ci": 165,
"utf32_estonian_ci": 166,
"utf32_spanish_ci": 167,
"utf32_swedish_ci": 168,
"utf32_turkish_ci": 169,
"utf32_czech_ci": 170,
"utf32_danish_ci": 171,
"utf32_lithuanian_ci": 172,
"utf32_slovak_ci": 173,
"utf32_spanish2_ci": 174,
"utf32_roman_ci": 175,
"utf32_persian_ci": 176,
"utf32_esperanto_ci": 177,
"utf32_hungarian_ci": 178,
"utf32_sinhala_ci": 179,
"utf32_german2_ci": 180,
"utf32_croatian_ci": 181,
"utf32_unicode_520_ci": 182,
"utf32_vietnamese_ci": 183,
"utf8_unicode_ci": 192,
"utf8_icelandic_ci": 193,
"utf8_latvian_ci": 194,
"utf8_romanian_ci": 195,
"utf8_slovenian_ci": 196,
"utf8_polish_ci": 197,
"utf8_estonian_ci": 198,
"utf8_spanish_ci": 199,
"utf8_swedish_ci": 200,
"utf8_turkish_ci": 201,
"utf8_czech_ci": 202,
"utf8_danish_ci": 203,
"utf8_lithuanian_ci": 204,
"utf8_slovak_ci": 205,
"utf8_spanish2_ci": 206,
"utf8_roman_ci": 207,
"utf8_persian_ci": 208,
"utf8_esperanto_ci": 209,
"utf8_hungarian_ci": 210,
"utf8_sinhala_ci": 211,
"utf8_german2_ci": 212,
"utf8_croatian_ci": 213,
"utf8_unicode_520_ci": 214,
"utf8_vietnamese_ci": 215,
"utf8_general_mysql500_ci": 223,
"utf8mb4_unicode_ci": 224,
"utf8mb4_icelandic_ci": 225,
"utf8mb4_latvian_ci": 226,
"utf8mb4_romanian_ci": 227,
"utf8mb4_slovenian_ci": 228,
"utf8mb4_polish_ci": 229,
"utf8mb4_estonian_ci": 230,
"utf8mb4_spanish_ci": 231,
"utf8mb4_swedish_ci": 232,
"utf8mb4_turkish_ci": 233,
"utf8mb4_czech_ci": 234,
"utf8mb4_danish_ci": 235,
"utf8mb4_lithuanian_ci": 236,
"utf8mb4_slovak_ci": 237,
"utf8mb4_spanish2_ci": 238,
"utf8mb4_roman_ci": 239,
"utf8mb4_persian_ci": 240,
"utf8mb4_esperanto_ci": 241,
"utf8mb4_hungarian_ci": 242,
"utf8mb4_sinhala_ci": 243,
"utf8mb4_german2_ci": 244,
"utf8mb4_croatian_ci": 245,
"utf8mb4_unicode_520_ci": 246,
"utf8mb4_vietnamese_ci": 247,
}
// MySQL collation informations.
const (
DefaultCharset = "utf8"
DefaultCollationID = 33
BinaryCollationID = 63
DefaultCollationName = "utf8_general_ci"
)

261
vendor/github.com/pingcap/tidb/mysql/const.go generated vendored Normal file
View file

@ -0,0 +1,261 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// Version informations.
const (
MinProtocolVersion byte = 10
MaxPayloadLen int = 1<<24 - 1
ServerVersion string = "5.5.31-TiDB-1.0"
)
// Header informations.
const (
OKHeader byte = 0x00
ErrHeader byte = 0xff
EOFHeader byte = 0xfe
LocalInFileHeader byte = 0xfb
)
// Server informations.
const (
ServerStatusInTrans uint16 = 0x0001
ServerStatusAutocommit uint16 = 0x0002
ServerMoreResultsExists uint16 = 0x0008
ServerStatusNoGoodIndexUsed uint16 = 0x0010
ServerStatusNoIndexUsed uint16 = 0x0020
ServerStatusCursorExists uint16 = 0x0040
ServerStatusLastRowSend uint16 = 0x0080
ServerStatusDBDropped uint16 = 0x0100
ServerStatusNoBackslashEscaped uint16 = 0x0200
ServerStatusMetadataChanged uint16 = 0x0400
ServerStatusWasSlow uint16 = 0x0800
ServerPSOutParams uint16 = 0x1000
)
// Command informations.
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
ComDaemon
ComBinlogDumpGtid
ComResetConnection
)
// Client informations.
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
)
// Cache type informations.
const (
TypeNoCache byte = 0xff
)
// Auth name informations.
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"
// TablePrivTable is the table in system db contains table scope privilege info.
TablePrivTable = "Tables_priv"
// ColumnPrivTable is the table in system db contains column scope privilege info.
ColumnPrivTable = "Columns_priv"
// GlobalVariablesTable is the table contains global system variables.
GlobalVariablesTable = "GLOBAL_VARIABLES"
// GlobalStatusTable is the table contains global status variables.
GlobalStatusTable = "GLOBAL_STATUS"
// TiDBTable is the table contains tidb info.
TiDBTable = "tidb"
)
// PrivilegeType privilege
type PrivilegeType uint32
const (
_ PrivilegeType = 1 << iota
// CreatePriv is the privilege to create schema/table.
CreatePriv
// SelectPriv is the privilege to read from table.
SelectPriv
// InsertPriv is the privilege to insert data into table.
InsertPriv
// UpdatePriv is the privilege to update data in table.
UpdatePriv
// DeletePriv is the privilege to delete data from table.
DeletePriv
// ShowDBPriv is the privilege to run show databases statement.
ShowDBPriv
// CreateUserPriv is the privilege to create user.
CreateUserPriv
// DropPriv is the privilege to drop schema/table.
DropPriv
// GrantPriv is the privilege to grant privilege to user.
GrantPriv
// AlterPriv is the privilege to run alter statement.
AlterPriv
// ExecutePriv is the privilege to run execute statement.
ExecutePriv
// IndexPriv is the privilege to create/drop index.
IndexPriv
// AllPriv is the privilege for all actions.
AllPriv
)
// Priv2UserCol is the privilege to mysql.user table column name.
var Priv2UserCol = map[PrivilegeType]string{
CreatePriv: "Create_priv",
SelectPriv: "Select_priv",
InsertPriv: "Insert_priv",
UpdatePriv: "Update_priv",
DeletePriv: "Delete_priv",
ShowDBPriv: "Show_db_priv",
CreateUserPriv: "Create_user_priv",
DropPriv: "Drop_priv",
GrantPriv: "Grant_priv",
AlterPriv: "Alter_priv",
ExecutePriv: "Execute_priv",
IndexPriv: "Index_priv",
}
// Col2PrivType is the privilege tables column name to privilege type.
var Col2PrivType = map[string]PrivilegeType{
"Create_priv": CreatePriv,
"Select_priv": SelectPriv,
"Insert_priv": InsertPriv,
"Update_priv": UpdatePriv,
"Delete_priv": DeletePriv,
"Show_db_priv": ShowDBPriv,
"Create_user_priv": CreateUserPriv,
"Drop_priv": DropPriv,
"Grant_priv": GrantPriv,
"Alter_priv": AlterPriv,
"Execute_priv": ExecutePriv,
"Index_priv": IndexPriv,
}
// AllGlobalPrivs is all the privileges in global scope.
var AllGlobalPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, GrantPriv, AlterPriv, ShowDBPriv, ExecutePriv, IndexPriv, CreateUserPriv}
// Priv2Str is the map for privilege to string.
var Priv2Str = map[PrivilegeType]string{
CreatePriv: "Create",
SelectPriv: "Select",
InsertPriv: "Insert",
UpdatePriv: "Update",
DeletePriv: "Delete",
ShowDBPriv: "Show Databases",
CreateUserPriv: "Create User",
DropPriv: "Drop",
GrantPriv: "Grant Option",
AlterPriv: "Alter",
ExecutePriv: "Execute",
IndexPriv: "Index",
}
// Priv2SetStr is the map for privilege to string.
var Priv2SetStr = map[PrivilegeType]string{
CreatePriv: "Create",
SelectPriv: "Select",
InsertPriv: "Insert",
UpdatePriv: "Update",
DeletePriv: "Delete",
DropPriv: "Drop",
GrantPriv: "Grant",
AlterPriv: "Alter",
ExecutePriv: "Execute",
IndexPriv: "Index",
}
// SetStr2Priv is the map for privilege set string to privilege type.
var SetStr2Priv = map[string]PrivilegeType{
"Create": CreatePriv,
"Select": SelectPriv,
"Insert": InsertPriv,
"Update": UpdatePriv,
"Delete": DeletePriv,
"Drop": DropPriv,
"Grant": GrantPriv,
"Alter": AlterPriv,
"Execute": ExecutePriv,
"Index": IndexPriv,
}
// AllDBPrivs is all the privileges in database scope.
var AllDBPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, GrantPriv, AlterPriv, ExecutePriv, IndexPriv}
// AllTablePrivs is all the privileges in table scope.
var AllTablePrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv, DeletePriv, CreatePriv, DropPriv, GrantPriv, AlterPriv, IndexPriv}
// AllColumnPrivs is all the privileges in column scope.
var AllColumnPrivs = []PrivilegeType{SelectPriv, InsertPriv, UpdatePriv}
// AllPrivilegeLiteral is the string literal for All Privilege.
const AllPrivilegeLiteral = "ALL PRIVILEGES"

755
vendor/github.com/pingcap/tidb/mysql/decimal.go generated vendored Normal file
View file

@ -0,0 +1,755 @@
// The MIT License (MIT)
// Copyright (c) 2015 Spring, Inc.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// - Based on https://github.com/oguzbilgic/fpd, which has the following license:
// """
// The MIT License (MIT)
// Copyright (c) 2013 Oguz Bilgic
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do so,
// subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
// FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
// IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// """
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// Decimal implements an arbitrary precision fixed-point decimal.
//
// To use as part of a struct:
//
// type Struct struct {
// Number Decimal
// }
//
// The zero-value of a Decimal is 0, as you would expect.
//
// The best way to create a new Decimal is to use decimal.NewFromString, ex:
//
// n, err := decimal.NewFromString("-123.4567")
// n.String() // output: "-123.4567"
//
// NOTE: this can "only" represent numbers with a maximum of 2^31 digits
// after the decimal point.
import (
"database/sql/driver"
"fmt"
"math"
"math/big"
"strconv"
"strings"
)
// DivisionPrecision is the number of decimal places in the result when it
// doesn't divide exactly.
//
// Example:
//
// d1 := decimal.NewFromFloat(2).Div(decimal.NewFromFloat(3)
// d1.String() // output: "0.6667"
// d2 := decimal.NewFromFloat(2).Div(decimal.NewFromFloat(30000)
// d2.String() // output: "0.0001"
// d3 := decimal.NewFromFloat(20000).Div(decimal.NewFromFloat(3)
// d3.String() // output: "6666.6666666666666667"
// decimal.DivisionPrecision = 3
// d4 := decimal.NewFromFloat(2).Div(decimal.NewFromFloat(3)
// d4.String() // output: "0.6667"
//
const (
MaxFractionDigits = 30
DivIncreasePrecision = 4
)
// ZeroDecimal is zero constant, to make computations faster.
var ZeroDecimal = NewDecimalFromInt(0, 1)
var zeroInt = big.NewInt(0)
var oneInt = big.NewInt(1)
var fiveInt = big.NewInt(5)
var tenInt = big.NewInt(10)
// Decimal represents a fixed-point decimal. It is immutable.
// number = value * 10 ^ exp
type Decimal struct {
value *big.Int
// this must be an int32, because we cast it to float64 during
// calculations. If exp is 64 bit, we might lose precision.
// If we cared about being able to represent every possible decimal, we
// could make exp a *big.Int but it would hurt performance and numbers
// like that are unrealistic.
exp int32
fracDigits int32 // Number of fractional digits for string result.
}
// ConvertToDecimal converts interface to decimal.
func ConvertToDecimal(value interface{}) (Decimal, error) {
switch v := value.(type) {
case int8:
return NewDecimalFromInt(int64(v), 0), nil
case int16:
return NewDecimalFromInt(int64(v), 0), nil
case int32:
return NewDecimalFromInt(int64(v), 0), nil
case int64:
return NewDecimalFromInt(int64(v), 0), nil
case int:
return NewDecimalFromInt(int64(v), 0), nil
case uint8:
return NewDecimalFromUint(uint64(v), 0), nil
case uint16:
return NewDecimalFromUint(uint64(v), 0), nil
case uint32:
return NewDecimalFromUint(uint64(v), 0), nil
case uint64:
return NewDecimalFromUint(uint64(v), 0), nil
case uint:
return NewDecimalFromUint(uint64(v), 0), nil
case float32:
return NewDecimalFromFloat(float64(v)), nil
case float64:
return NewDecimalFromFloat(float64(v)), nil
case string:
return ParseDecimal(v)
case Decimal:
return v, nil
case Hex:
return NewDecimalFromInt(int64(v.Value), 0), nil
case Bit:
return NewDecimalFromUint(uint64(v.Value), 0), nil
case Enum:
return NewDecimalFromUint(uint64(v.Value), 0), nil
case Set:
return NewDecimalFromUint(uint64(v.Value), 0), nil
default:
return Decimal{}, fmt.Errorf("can't convert %v to decimal", value)
}
}
// NewDecimalFromInt returns a new fixed-point decimal, value * 10 ^ exp.
func NewDecimalFromInt(value int64, exp int32) Decimal {
return Decimal{
value: big.NewInt(value),
exp: exp,
fracDigits: fracDigitsDefault(exp),
}
}
// NewDecimalFromUint returns a new fixed-point decimal, value * 10 ^ exp.
func NewDecimalFromUint(value uint64, exp int32) Decimal {
return Decimal{
value: big.NewInt(0).SetUint64(value),
exp: exp,
fracDigits: fracDigitsDefault(exp),
}
}
// ParseDecimal returns a new Decimal from a string representation.
//
// Example:
//
// d, err := ParseDecimal("-123.45")
// d2, err := ParseDecimal(".0001")
//
func ParseDecimal(value string) (Decimal, error) {
var intString string
var exp = int32(0)
n := strings.IndexAny(value, "eE")
if n > 0 {
// It is scientific notation, like 3.14e10
expInt, err := strconv.Atoi(value[n+1:])
if err != nil {
return Decimal{}, fmt.Errorf("can't convert %s to decimal, incorrect exponent", value)
}
value = value[0:n]
exp = int32(expInt)
}
parts := strings.Split(value, ".")
if len(parts) == 1 {
// There is no decimal point, we can just parse the original string as
// an int.
intString = value
} else if len(parts) == 2 {
intString = parts[0] + parts[1]
expInt := -len(parts[1])
exp += int32(expInt)
} else {
return Decimal{}, fmt.Errorf("can't convert %s to decimal: too many .s", value)
}
dValue := new(big.Int)
_, ok := dValue.SetString(intString, 10)
if !ok {
return Decimal{}, fmt.Errorf("can't convert %s to decimal", value)
}
val := Decimal{
value: dValue,
exp: exp,
fracDigits: fracDigitsDefault(exp),
}
if exp < -MaxFractionDigits {
val = val.rescale(-MaxFractionDigits)
}
return val, nil
}
// NewDecimalFromFloat converts a float64 to Decimal.
//
// Example:
//
// NewDecimalFromFloat(123.45678901234567).String() // output: "123.4567890123456"
// NewDecimalFromFloat(.00000000000000001).String() // output: "0.00000000000000001"
//
// NOTE: this will panic on NaN, +/-inf.
func NewDecimalFromFloat(value float64) Decimal {
floor := math.Floor(value)
// fast path, where float is an int.
if floor == value && !math.IsInf(value, 0) {
return NewDecimalFromInt(int64(value), 0)
}
str := strconv.FormatFloat(value, 'f', -1, 64)
dec, err := ParseDecimal(str)
if err != nil {
panic(err)
}
return dec
}
// NewDecimalFromFloatWithExponent converts a float64 to Decimal, with an arbitrary
// number of fractional digits.
//
// Example:
//
// NewDecimalFromFloatWithExponent(123.456, -2).String() // output: "123.46"
//
func NewDecimalFromFloatWithExponent(value float64, exp int32) Decimal {
mul := math.Pow(10, -float64(exp))
floatValue := value * mul
if math.IsNaN(floatValue) || math.IsInf(floatValue, 0) {
panic(fmt.Sprintf("Cannot create a Decimal from %v", floatValue))
}
dValue := big.NewInt(round(floatValue))
return Decimal{
value: dValue,
exp: exp,
fracDigits: fracDigitsDefault(exp),
}
}
// rescale returns a rescaled version of the decimal. Returned
// decimal may be less precise if the given exponent is bigger
// than the initial exponent of the Decimal.
// NOTE: this will truncate, NOT round
//
// Example:
//
// d := New(12345, -4)
// d2 := d.rescale(-1)
// d3 := d2.rescale(-4)
// println(d1)
// println(d2)
// println(d3)
//
// Output:
//
// 1.2345
// 1.2
// 1.2000
//
func (d Decimal) rescale(exp int32) Decimal {
d.ensureInitialized()
if exp < -MaxFractionDigits-1 {
// Limit the number of digits but we can not call Round here because it is called by Round.
// Limit it to MaxFractionDigits + 1 to make sure the final result is correct.
exp = -MaxFractionDigits - 1
}
// Must convert exps to float64 before - to prevent overflow.
diff := math.Abs(float64(exp) - float64(d.exp))
value := new(big.Int).Set(d.value)
expScale := new(big.Int).Exp(tenInt, big.NewInt(int64(diff)), nil)
if exp > d.exp {
value = value.Quo(value, expScale)
} else if exp < d.exp {
value = value.Mul(value, expScale)
}
return Decimal{
value: value,
exp: exp,
fracDigits: d.fracDigits,
}
}
// Abs returns the absolute value of the decimal.
func (d Decimal) Abs() Decimal {
d.ensureInitialized()
d2Value := new(big.Int).Abs(d.value)
return Decimal{
value: d2Value,
exp: d.exp,
fracDigits: d.fracDigits,
}
}
// Add returns d + d2.
func (d Decimal) Add(d2 Decimal) Decimal {
baseExp := min(d.exp, d2.exp)
rd := d.rescale(baseExp)
rd2 := d2.rescale(baseExp)
d3Value := new(big.Int).Add(rd.value, rd2.value)
return Decimal{
value: d3Value,
exp: baseExp,
fracDigits: fracDigitsPlus(d.fracDigits, d2.fracDigits),
}
}
// Sub returns d - d2.
func (d Decimal) Sub(d2 Decimal) Decimal {
baseExp := min(d.exp, d2.exp)
rd := d.rescale(baseExp)
rd2 := d2.rescale(baseExp)
d3Value := new(big.Int).Sub(rd.value, rd2.value)
return Decimal{
value: d3Value,
exp: baseExp,
fracDigits: fracDigitsPlus(d.fracDigits, d2.fracDigits),
}
}
// Mul returns d * d2.
func (d Decimal) Mul(d2 Decimal) Decimal {
d.ensureInitialized()
d2.ensureInitialized()
expInt64 := int64(d.exp) + int64(d2.exp)
if expInt64 > math.MaxInt32 || expInt64 < math.MinInt32 {
// It is better to panic than to give incorrect results, as
// decimals are usually used for money.
panic(fmt.Sprintf("exponent %v overflows an int32!", expInt64))
}
d3Value := new(big.Int).Mul(d.value, d2.value)
val := Decimal{
value: d3Value,
exp: int32(expInt64),
fracDigits: fracDigitsMul(d.fracDigits, d2.fracDigits),
}
if val.exp < -(MaxFractionDigits) {
val = val.Round(MaxFractionDigits)
}
return val
}
// Div returns d / d2. If it doesn't divide exactly, the result will have
// DivisionPrecision digits after the decimal point.
func (d Decimal) Div(d2 Decimal) Decimal {
// Division is hard, use Rat to do it.
ratNum := d.Rat()
ratDenom := d2.Rat()
quoRat := big.NewRat(0, 1).Quo(ratNum, ratDenom)
// Converting from Rat to Decimal inefficiently for now.
ret, err := ParseDecimal(quoRat.FloatString(MaxFractionDigits + 1))
if err != nil {
panic(err) // This should never happen.
}
// To pass test "2 / 3 * 3 < 2" -> "1".
ret = ret.Truncate(MaxFractionDigits)
ret.fracDigits = fracDigitsDiv(d.fracDigits)
return ret
}
// Cmp compares the numbers represented by d and d2, and returns:
//
// -1 if d < d2
// 0 if d == d2
// +1 if d > d2
//
func (d Decimal) Cmp(d2 Decimal) int {
baseExp := min(d.exp, d2.exp)
rd := d.rescale(baseExp)
rd2 := d2.rescale(baseExp)
return rd.value.Cmp(rd2.value)
}
// Equals returns whether the numbers represented by d and d2 are equal.
func (d Decimal) Equals(d2 Decimal) bool {
return d.Cmp(d2) == 0
}
// Exponent returns the exponent, or scale component of the decimal.
func (d Decimal) Exponent() int32 {
return d.exp
}
// FracDigits returns the number of fractional digits of the decimal.
func (d Decimal) FracDigits() int32 {
return d.fracDigits
}
// IntPart returns the integer component of the decimal.
func (d Decimal) IntPart() int64 {
scaledD := d.rescale(0)
return scaledD.value.Int64()
}
// Rat returns a rational number representation of the decimal.
func (d Decimal) Rat() *big.Rat {
d.ensureInitialized()
if d.exp <= 0 {
// It must negate after casting to prevent int32 overflow.
denom := new(big.Int).Exp(tenInt, big.NewInt(-int64(d.exp)), nil)
return new(big.Rat).SetFrac(d.value, denom)
}
mul := new(big.Int).Exp(tenInt, big.NewInt(int64(d.exp)), nil)
num := new(big.Int).Mul(d.value, mul)
return new(big.Rat).SetFrac(num, oneInt)
}
// Float64 returns the nearest float64 value for d and a bool indicating
// whether f represents d exactly.
// For more details, see the documentation for big.Rat.Float64.
func (d Decimal) Float64() (f float64, exact bool) {
return d.Rat().Float64()
}
// String returns the string representation of the decimal
// with the fixed point.
//
// Example:
//
// d := New(-12345, -3)
// println(d.String())
//
// Output:
//
// -12.345
//
func (d Decimal) String() string {
return d.StringFixed(d.fracDigits)
}
// StringFixed returns a rounded fixed-point string with places digits after
// the decimal point.
//
// Example:
//
// NewFromFloat(0).StringFixed(2) // output: "0.00"
// NewFromFloat(0).StringFixed(0) // output: "0"
// NewFromFloat(5.45).StringFixed(0) // output: "5"
// NewFromFloat(5.45).StringFixed(1) // output: "5.5"
// NewFromFloat(5.45).StringFixed(2) // output: "5.45"
// NewFromFloat(5.45).StringFixed(3) // output: "5.450"
// NewFromFloat(545).StringFixed(-1) // output: "550"
//
func (d Decimal) StringFixed(places int32) string {
rounded := d.Round(places)
return rounded.string(false)
}
// Round rounds the decimal to places decimal places.
// If places < 0, it will round the integer part to the nearest 10^(-places).
//
// Example:
//
// NewFromFloat(5.45).Round(1).String() // output: "5.5"
// NewFromFloat(545).Round(-1).String() // output: "550"
//
func (d Decimal) Round(places int32) Decimal {
// Truncate to places + 1.
ret := d.rescale(-places - 1)
// Add sign(d) * 0.5.
if ret.value.Sign() < 0 {
ret.value.Sub(ret.value, fiveInt)
} else {
ret.value.Add(ret.value, fiveInt)
}
// Floor for positive numbers, Ceil for negative numbers.
_, m := ret.value.DivMod(ret.value, tenInt, new(big.Int))
ret.exp++
if ret.value.Sign() < 0 && m.Cmp(zeroInt) != 0 {
ret.value.Add(ret.value, oneInt)
}
ret.fracDigits = places
return ret
}
// Floor returns the nearest integer value less than or equal to d.
func (d Decimal) Floor() Decimal {
d.ensureInitialized()
exp := big.NewInt(10)
// It must negate after casting to prevent int32 overflow.
exp.Exp(exp, big.NewInt(-int64(d.exp)), nil)
z := new(big.Int).Div(d.value, exp)
return Decimal{value: z, exp: 0}
}
// Ceil returns the nearest integer value greater than or equal to d.
func (d Decimal) Ceil() Decimal {
d.ensureInitialized()
exp := big.NewInt(10)
// It must negate after casting to prevent int32 overflow.
exp.Exp(exp, big.NewInt(-int64(d.exp)), nil)
z, m := new(big.Int).DivMod(d.value, exp, new(big.Int))
if m.Cmp(zeroInt) != 0 {
z.Add(z, oneInt)
}
return Decimal{value: z, exp: 0}
}
// Truncate truncates off digits from the number, without rounding.
//
// NOTE: precision is the last digit that will not be truncated (must be >= 0).
//
// Example:
//
// decimal.NewFromString("123.456").Truncate(2).String() // "123.45"
//
func (d Decimal) Truncate(precision int32) Decimal {
d.ensureInitialized()
if precision >= 0 && -precision > d.exp {
d = d.rescale(-precision)
}
d.fracDigits = precision
return d
}
// UnmarshalJSON implements the json.Unmarshaler interface.
func (d *Decimal) UnmarshalJSON(decimalBytes []byte) error {
str, err := unquoteIfQuoted(decimalBytes)
if err != nil {
return fmt.Errorf("Error decoding string '%s': %s", decimalBytes, err)
}
decimal, err := ParseDecimal(str)
*d = decimal
if err != nil {
return fmt.Errorf("Error decoding string '%s': %s", str, err)
}
return nil
}
// MarshalJSON implements the json.Marshaler interface.
func (d Decimal) MarshalJSON() ([]byte, error) {
str := "\"" + d.String() + "\""
return []byte(str), nil
}
// Scan implements the sql.Scanner interface for database deserialization.
func (d *Decimal) Scan(value interface{}) error {
str, err := unquoteIfQuoted(value)
if err != nil {
return err
}
*d, err = ParseDecimal(str)
return err
}
// Value implements the driver.Valuer interface for database serialization.
func (d Decimal) Value() (driver.Value, error) {
return d.String(), nil
}
// BigIntValue returns the *bit.Int value member of decimal.
func (d Decimal) BigIntValue() *big.Int {
return d.value
}
// UnmarshalText implements the encoding.TextUnmarshaler interface for XML
// deserialization.
func (d *Decimal) UnmarshalText(text []byte) error {
str := string(text)
dec, err := ParseDecimal(str)
*d = dec
if err != nil {
return fmt.Errorf("Error decoding string '%s': %s", str, err)
}
return nil
}
// MarshalText implements the encoding.TextMarshaler interface for XML
// serialization.
func (d Decimal) MarshalText() (text []byte, err error) {
return []byte(d.String()), nil
}
// StringScaled first scales the decimal then calls .String() on it.
// NOTE: buggy, unintuitive, and DEPRECATED! Use StringFixed instead.
func (d Decimal) StringScaled(exp int32) string {
return d.rescale(exp).String()
}
func (d Decimal) string(trimTrailingZeros bool) string {
if d.exp >= 0 {
return d.rescale(0).value.String()
}
abs := new(big.Int).Abs(d.value)
str := abs.String()
var intPart, fractionalPart string
// this cast to int will cause bugs if d.exp == INT_MIN
// and you are on a 32-bit machine. Won't fix this super-edge case.
dExpInt := int(d.exp)
if len(str) > -dExpInt {
intPart = str[:len(str)+dExpInt]
fractionalPart = str[len(str)+dExpInt:]
} else {
intPart = "0"
num0s := -dExpInt - len(str)
fractionalPart = strings.Repeat("0", num0s) + str
}
if trimTrailingZeros {
i := len(fractionalPart) - 1
for ; i >= 0; i-- {
if fractionalPart[i] != '0' {
break
}
}
fractionalPart = fractionalPart[:i+1]
}
number := intPart
if len(fractionalPart) > 0 {
number += "." + fractionalPart
}
if d.value.Sign() < 0 {
return "-" + number
}
return number
}
func (d *Decimal) ensureInitialized() {
if d.value == nil {
d.value = new(big.Int)
}
}
func min(x, y int32) int32 {
if x >= y {
return y
}
return x
}
func max(x, y int32) int32 {
if x >= y {
return x
}
return y
}
func round(n float64) int64 {
if n < 0 {
return int64(n - 0.5)
}
return int64(n + 0.5)
}
func unquoteIfQuoted(value interface{}) (string, error) {
bytes, ok := value.([]byte)
if !ok {
return "", fmt.Errorf("Could not convert value '%+v' to byte array",
value)
}
// If the amount is quoted, strip the quotes.
if len(bytes) > 2 && bytes[0] == '"' && bytes[len(bytes)-1] == '"' {
bytes = bytes[1 : len(bytes)-1]
}
return string(bytes), nil
}
func fracDigitsDefault(exp int32) int32 {
if exp < 0 {
return min(MaxFractionDigits, -exp)
}
return 0
}
func fracDigitsPlus(x, y int32) int32 {
return max(x, y)
}
func fracDigitsDiv(x int32) int32 {
return min(x+DivIncreasePrecision, MaxFractionDigits)
}
func fracDigitsMul(a, b int32) int32 {
return min(MaxFractionDigits, a+b)
}

62
vendor/github.com/pingcap/tidb/mysql/enum.go generated vendored Normal file
View file

@ -0,0 +1,62 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
import (
"strconv"
"strings"
"github.com/juju/errors"
)
// Enum is for MySQL enum type.
type Enum struct {
Name string
Value uint64
}
// String implements fmt.Stringer interface.
func (e Enum) String() string {
return e.Name
}
// ToNumber changes enum index to float64 for numeric operation.
func (e Enum) ToNumber() float64 {
return float64(e.Value)
}
// ParseEnumName creates a Enum with item name.
func ParseEnumName(elems []string, name string) (Enum, error) {
for i, n := range elems {
if strings.EqualFold(n, name) {
return Enum{Name: n, Value: uint64(i) + 1}, nil
}
}
// name doesn't exist, maybe an integer?
if num, err := strconv.ParseUint(name, 0, 64); err == nil {
return ParseEnumValue(elems, num)
}
return Enum{}, errors.Errorf("item %s is not in enum %v", name, elems)
}
// ParseEnumValue creates a Enum with special number.
func ParseEnumValue(elems []string, number uint64) (Enum, error) {
if number == 0 || number > uint64(len(elems)) {
return Enum{}, errors.Errorf("number %d overflow enum boundary [1, %d]", number, len(elems))
}
return Enum{Name: elems[number-1], Value: number}, nil
}

885
vendor/github.com/pingcap/tidb/mysql/errcode.go generated vendored Normal file
View file

@ -0,0 +1,885 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// MySQL error code.
// This value is numeric. It is not portable to other database systems.
const (
ErrErrorFirst uint16 = 1000
ErrHashchk = 1000
ErrNisamchk = 1001
ErrNo = 1002
ErrYes = 1003
ErrCantCreateFile = 1004
ErrCantCreateTable = 1005
ErrCantCreateDb = 1006
ErrDbCreateExists = 1007
ErrDbDropExists = 1008
ErrDbDropDelete = 1009
ErrDbDropRmdir = 1010
ErrCantDeleteFile = 1011
ErrCantFindSystemRec = 1012
ErrCantGetStat = 1013
ErrCantGetWd = 1014
ErrCantLock = 1015
ErrCantOpenFile = 1016
ErrFileNotFound = 1017
ErrCantReadDir = 1018
ErrCantSetWd = 1019
ErrCheckread = 1020
ErrDiskFull = 1021
ErrDupKey = 1022
ErrErrorOnClose = 1023
ErrErrorOnRead = 1024
ErrErrorOnRename = 1025
ErrErrorOnWrite = 1026
ErrFileUsed = 1027
ErrFilsortAbort = 1028
ErrFormNotFound = 1029
ErrGetErrno = 1030
ErrIllegalHa = 1031
ErrKeyNotFound = 1032
ErrNotFormFile = 1033
ErrNotKeyfile = 1034
ErrOldKeyfile = 1035
ErrOpenAsReadonly = 1036
ErrOutofmemory = 1037
ErrOutOfSortmemory = 1038
ErrUnexpectedEOF = 1039
ErrConCount = 1040
ErrOutOfResources = 1041
ErrBadHost = 1042
ErrHandshake = 1043
ErrDbaccessDenied = 1044
ErrAccessDenied = 1045
ErrNoDb = 1046
ErrUnknownCom = 1047
ErrBadNull = 1048
ErrBadDb = 1049
ErrTableExists = 1050
ErrBadTable = 1051
ErrNonUniq = 1052
ErrServerShutdown = 1053
ErrBadField = 1054
ErrWrongFieldWithGroup = 1055
ErrWrongGroupField = 1056
ErrWrongSumSelect = 1057
ErrWrongValueCount = 1058
ErrTooLongIdent = 1059
ErrDupFieldname = 1060
ErrDupKeyname = 1061
ErrDupEntry = 1062
ErrWrongFieldSpec = 1063
ErrParse = 1064
ErrEmptyQuery = 1065
ErrNonuniqTable = 1066
ErrInvalidDefault = 1067
ErrMultiplePriKey = 1068
ErrTooManyKeys = 1069
ErrTooManyKeyParts = 1070
ErrTooLongKey = 1071
ErrKeyColumnDoesNotExits = 1072
ErrBlobUsedAsKey = 1073
ErrTooBigFieldlength = 1074
ErrWrongAutoKey = 1075
ErrReady = 1076
ErrNormalShutdown = 1077
ErrGotSignal = 1078
ErrShutdownComplete = 1079
ErrForcingClose = 1080
ErrIpsock = 1081
ErrNoSuchIndex = 1082
ErrWrongFieldTerminators = 1083
ErrBlobsAndNoTerminated = 1084
ErrTextfileNotReadable = 1085
ErrFileExists = 1086
ErrLoadInfo = 1087
ErrAlterInfo = 1088
ErrWrongSubKey = 1089
ErrCantRemoveAllFields = 1090
ErrCantDropFieldOrKey = 1091
ErrInsertInfo = 1092
ErrUpdateTableUsed = 1093
ErrNoSuchThread = 1094
ErrKillDenied = 1095
ErrNoTablesUsed = 1096
ErrTooBigSet = 1097
ErrNoUniqueLogfile = 1098
ErrTableNotLockedForWrite = 1099
ErrTableNotLocked = 1100
ErrBlobCantHaveDefault = 1101
ErrWrongDbName = 1102
ErrWrongTableName = 1103
ErrTooBigSelect = 1104
ErrUnknown = 1105
ErrUnknownProcedure = 1106
ErrWrongParamcountToProcedure = 1107
ErrWrongParametersToProcedure = 1108
ErrUnknownTable = 1109
ErrFieldSpecifiedTwice = 1110
ErrInvalidGroupFuncUse = 1111
ErrUnsupportedExtension = 1112
ErrTableMustHaveColumns = 1113
ErrRecordFileFull = 1114
ErrUnknownCharacterSet = 1115
ErrTooManyTables = 1116
ErrTooManyFields = 1117
ErrTooBigRowsize = 1118
ErrStackOverrun = 1119
ErrWrongOuterJoin = 1120
ErrNullColumnInIndex = 1121
ErrCantFindUdf = 1122
ErrCantInitializeUdf = 1123
ErrUdfNoPaths = 1124
ErrUdfExists = 1125
ErrCantOpenLibrary = 1126
ErrCantFindDlEntry = 1127
ErrFunctionNotDefined = 1128
ErrHostIsBlocked = 1129
ErrHostNotPrivileged = 1130
ErrPasswordAnonymousUser = 1131
ErrPasswordNotAllowed = 1132
ErrPasswordNoMatch = 1133
ErrUpdateInfo = 1134
ErrCantCreateThread = 1135
ErrWrongValueCountOnRow = 1136
ErrCantReopenTable = 1137
ErrInvalidUseOfNull = 1138
ErrRegexp = 1139
ErrMixOfGroupFuncAndFields = 1140
ErrNonexistingGrant = 1141
ErrTableaccessDenied = 1142
ErrColumnaccessDenied = 1143
ErrIllegalGrantForTable = 1144
ErrGrantWrongHostOrUser = 1145
ErrNoSuchTable = 1146
ErrNonexistingTableGrant = 1147
ErrNotAllowedCommand = 1148
ErrSyntax = 1149
ErrDelayedCantChangeLock = 1150
ErrTooManyDelayedThreads = 1151
ErrAbortingConnection = 1152
ErrNetPacketTooLarge = 1153
ErrNetReadErrorFromPipe = 1154
ErrNetFcntl = 1155
ErrNetPacketsOutOfOrder = 1156
ErrNetUncompress = 1157
ErrNetRead = 1158
ErrNetReadInterrupted = 1159
ErrNetErrorOnWrite = 1160
ErrNetWriteInterrupted = 1161
ErrTooLongString = 1162
ErrTableCantHandleBlob = 1163
ErrTableCantHandleAutoIncrement = 1164
ErrDelayedInsertTableLocked = 1165
ErrWrongColumnName = 1166
ErrWrongKeyColumn = 1167
ErrWrongMrgTable = 1168
ErrDupUnique = 1169
ErrBlobKeyWithoutLength = 1170
ErrPrimaryCantHaveNull = 1171
ErrTooManyRows = 1172
ErrRequiresPrimaryKey = 1173
ErrNoRaidCompiled = 1174
ErrUpdateWithoutKeyInSafeMode = 1175
ErrKeyDoesNotExits = 1176
ErrCheckNoSuchTable = 1177
ErrCheckNotImplemented = 1178
ErrCantDoThisDuringAnTransaction = 1179
ErrErrorDuringCommit = 1180
ErrErrorDuringRollback = 1181
ErrErrorDuringFlushLogs = 1182
ErrErrorDuringCheckpoint = 1183
ErrNewAbortingConnection = 1184
ErrDumpNotImplemented = 1185
ErrFlushMasterBinlogClosed = 1186
ErrIndexRebuild = 1187
ErrMaster = 1188
ErrMasterNetRead = 1189
ErrMasterNetWrite = 1190
ErrFtMatchingKeyNotFound = 1191
ErrLockOrActiveTransaction = 1192
ErrUnknownSystemVariable = 1193
ErrCrashedOnUsage = 1194
ErrCrashedOnRepair = 1195
ErrWarningNotCompleteRollback = 1196
ErrTransCacheFull = 1197
ErrSlaveMustStop = 1198
ErrSlaveNotRunning = 1199
ErrBadSlave = 1200
ErrMasterInfo = 1201
ErrSlaveThread = 1202
ErrTooManyUserConnections = 1203
ErrSetConstantsOnly = 1204
ErrLockWaitTimeout = 1205
ErrLockTableFull = 1206
ErrReadOnlyTransaction = 1207
ErrDropDbWithReadLock = 1208
ErrCreateDbWithReadLock = 1209
ErrWrongArguments = 1210
ErrNoPermissionToCreateUser = 1211
ErrUnionTablesInDifferentDir = 1212
ErrLockDeadlock = 1213
ErrTableCantHandleFt = 1214
ErrCannotAddForeign = 1215
ErrNoReferencedRow = 1216
ErrRowIsReferenced = 1217
ErrConnectToMaster = 1218
ErrQueryOnMaster = 1219
ErrErrorWhenExecutingCommand = 1220
ErrWrongUsage = 1221
ErrWrongNumberOfColumnsInSelect = 1222
ErrCantUpdateWithReadlock = 1223
ErrMixingNotAllowed = 1224
ErrDupArgument = 1225
ErrUserLimitReached = 1226
ErrSpecificAccessDenied = 1227
ErrLocalVariable = 1228
ErrGlobalVariable = 1229
ErrNoDefault = 1230
ErrWrongValueForVar = 1231
ErrWrongTypeForVar = 1232
ErrVarCantBeRead = 1233
ErrCantUseOptionHere = 1234
ErrNotSupportedYet = 1235
ErrMasterFatalErrorReadingBinlog = 1236
ErrSlaveIgnoredTable = 1237
ErrIncorrectGlobalLocalVar = 1238
ErrWrongFkDef = 1239
ErrKeyRefDoNotMatchTableRef = 1240
ErrOperandColumns = 1241
ErrSubqueryNo1Row = 1242
ErrUnknownStmtHandler = 1243
ErrCorruptHelpDb = 1244
ErrCyclicReference = 1245
ErrAutoConvert = 1246
ErrIllegalReference = 1247
ErrDerivedMustHaveAlias = 1248
ErrSelectReduced = 1249
ErrTablenameNotAllowedHere = 1250
ErrNotSupportedAuthMode = 1251
ErrSpatialCantHaveNull = 1252
ErrCollationCharsetMismatch = 1253
ErrSlaveWasRunning = 1254
ErrSlaveWasNotRunning = 1255
ErrTooBigForUncompress = 1256
ErrZlibZMem = 1257
ErrZlibZBuf = 1258
ErrZlibZData = 1259
ErrCutValueGroupConcat = 1260
ErrWarnTooFewRecords = 1261
ErrWarnTooManyRecords = 1262
ErrWarnNullToNotnull = 1263
ErrWarnDataOutOfRange = 1264
WarnDataTruncated = 1265
ErrWarnUsingOtherHandler = 1266
ErrCantAggregate2collations = 1267
ErrDropUser = 1268
ErrRevokeGrants = 1269
ErrCantAggregate3collations = 1270
ErrCantAggregateNcollations = 1271
ErrVariableIsNotStruct = 1272
ErrUnknownCollation = 1273
ErrSlaveIgnoredSslParams = 1274
ErrServerIsInSecureAuthMode = 1275
ErrWarnFieldResolved = 1276
ErrBadSlaveUntilCond = 1277
ErrMissingSkipSlave = 1278
ErrUntilCondIgnored = 1279
ErrWrongNameForIndex = 1280
ErrWrongNameForCatalog = 1281
ErrWarnQcResize = 1282
ErrBadFtColumn = 1283
ErrUnknownKeyCache = 1284
ErrWarnHostnameWontWork = 1285
ErrUnknownStorageEngine = 1286
ErrWarnDeprecatedSyntax = 1287
ErrNonUpdatableTable = 1288
ErrFeatureDisabled = 1289
ErrOptionPreventsStatement = 1290
ErrDuplicatedValueInType = 1291
ErrTruncatedWrongValue = 1292
ErrTooMuchAutoTimestampCols = 1293
ErrInvalidOnUpdate = 1294
ErrUnsupportedPs = 1295
ErrGetErrmsg = 1296
ErrGetTemporaryErrmsg = 1297
ErrUnknownTimeZone = 1298
ErrWarnInvalidTimestamp = 1299
ErrInvalidCharacterString = 1300
ErrWarnAllowedPacketOverflowed = 1301
ErrConflictingDeclarations = 1302
ErrSpNoRecursiveCreate = 1303
ErrSpAlreadyExists = 1304
ErrSpDoesNotExist = 1305
ErrSpDropFailed = 1306
ErrSpStoreFailed = 1307
ErrSpLilabelMismatch = 1308
ErrSpLabelRedefine = 1309
ErrSpLabelMismatch = 1310
ErrSpUninitVar = 1311
ErrSpBadselect = 1312
ErrSpBadreturn = 1313
ErrSpBadstatement = 1314
ErrUpdateLogDeprecatedIgnored = 1315
ErrUpdateLogDeprecatedTranslated = 1316
ErrQueryInterrupted = 1317
ErrSpWrongNoOfArgs = 1318
ErrSpCondMismatch = 1319
ErrSpNoreturn = 1320
ErrSpNoreturnend = 1321
ErrSpBadCursorQuery = 1322
ErrSpBadCursorSelect = 1323
ErrSpCursorMismatch = 1324
ErrSpCursorAlreadyOpen = 1325
ErrSpCursorNotOpen = 1326
ErrSpUndeclaredVar = 1327
ErrSpWrongNoOfFetchArgs = 1328
ErrSpFetchNoData = 1329
ErrSpDupParam = 1330
ErrSpDupVar = 1331
ErrSpDupCond = 1332
ErrSpDupCurs = 1333
ErrSpCantAlter = 1334
ErrSpSubselectNyi = 1335
ErrStmtNotAllowedInSfOrTrg = 1336
ErrSpVarcondAfterCurshndlr = 1337
ErrSpCursorAfterHandler = 1338
ErrSpCaseNotFound = 1339
ErrFparserTooBigFile = 1340
ErrFparserBadHeader = 1341
ErrFparserEOFInComment = 1342
ErrFparserErrorInParameter = 1343
ErrFparserEOFInUnknownParameter = 1344
ErrViewNoExplain = 1345
ErrFrmUnknownType = 1346
ErrWrongObject = 1347
ErrNonupdateableColumn = 1348
ErrViewSelectDerived = 1349
ErrViewSelectClause = 1350
ErrViewSelectVariable = 1351
ErrViewSelectTmptable = 1352
ErrViewWrongList = 1353
ErrWarnViewMerge = 1354
ErrWarnViewWithoutKey = 1355
ErrViewInvalid = 1356
ErrSpNoDropSp = 1357
ErrSpGotoInHndlr = 1358
ErrTrgAlreadyExists = 1359
ErrTrgDoesNotExist = 1360
ErrTrgOnViewOrTempTable = 1361
ErrTrgCantChangeRow = 1362
ErrTrgNoSuchRowInTrg = 1363
ErrNoDefaultForField = 1364
ErrDivisionByZero = 1365
ErrTruncatedWrongValueForField = 1366
ErrIllegalValueForType = 1367
ErrViewNonupdCheck = 1368
ErrViewCheckFailed = 1369
ErrProcaccessDenied = 1370
ErrRelayLogFail = 1371
ErrPasswdLength = 1372
ErrUnknownTargetBinlog = 1373
ErrIoErrLogIndexRead = 1374
ErrBinlogPurgeProhibited = 1375
ErrFseekFail = 1376
ErrBinlogPurgeFatalErr = 1377
ErrLogInUse = 1378
ErrLogPurgeUnknownErr = 1379
ErrRelayLogInit = 1380
ErrNoBinaryLogging = 1381
ErrReservedSyntax = 1382
ErrWsasFailed = 1383
ErrDiffGroupsProc = 1384
ErrNoGroupForProc = 1385
ErrOrderWithProc = 1386
ErrLoggingProhibitChangingOf = 1387
ErrNoFileMapping = 1388
ErrWrongMagic = 1389
ErrPsManyParam = 1390
ErrKeyPart0 = 1391
ErrViewChecksum = 1392
ErrViewMultiupdate = 1393
ErrViewNoInsertFieldList = 1394
ErrViewDeleteMergeView = 1395
ErrCannotUser = 1396
ErrXaerNota = 1397
ErrXaerInval = 1398
ErrXaerRmfail = 1399
ErrXaerOutside = 1400
ErrXaerRmerr = 1401
ErrXaRbrollback = 1402
ErrNonexistingProcGrant = 1403
ErrProcAutoGrantFail = 1404
ErrProcAutoRevokeFail = 1405
ErrDataTooLong = 1406
ErrSpBadSQLstate = 1407
ErrStartup = 1408
ErrLoadFromFixedSizeRowsToVar = 1409
ErrCantCreateUserWithGrant = 1410
ErrWrongValueForType = 1411
ErrTableDefChanged = 1412
ErrSpDupHandler = 1413
ErrSpNotVarArg = 1414
ErrSpNoRetset = 1415
ErrCantCreateGeometryObject = 1416
ErrFailedRoutineBreakBinlog = 1417
ErrBinlogUnsafeRoutine = 1418
ErrBinlogCreateRoutineNeedSuper = 1419
ErrExecStmtWithOpenCursor = 1420
ErrStmtHasNoOpenCursor = 1421
ErrCommitNotAllowedInSfOrTrg = 1422
ErrNoDefaultForViewField = 1423
ErrSpNoRecursion = 1424
ErrTooBigScale = 1425
ErrTooBigPrecision = 1426
ErrMBiggerThanD = 1427
ErrWrongLockOfSystemTable = 1428
ErrConnectToForeignDataSource = 1429
ErrQueryOnForeignDataSource = 1430
ErrForeignDataSourceDoesntExist = 1431
ErrForeignDataStringInvalidCantCreate = 1432
ErrForeignDataStringInvalid = 1433
ErrCantCreateFederatedTable = 1434
ErrTrgInWrongSchema = 1435
ErrStackOverrunNeedMore = 1436
ErrTooLongBody = 1437
ErrWarnCantDropDefaultKeycache = 1438
ErrTooBigDisplaywidth = 1439
ErrXaerDupid = 1440
ErrDatetimeFunctionOverflow = 1441
ErrCantUpdateUsedTableInSfOrTrg = 1442
ErrViewPreventUpdate = 1443
ErrPsNoRecursion = 1444
ErrSpCantSetAutocommit = 1445
ErrMalformedDefiner = 1446
ErrViewFrmNoUser = 1447
ErrViewOtherUser = 1448
ErrNoSuchUser = 1449
ErrForbidSchemaChange = 1450
ErrRowIsReferenced2 = 1451
ErrNoReferencedRow2 = 1452
ErrSpBadVarShadow = 1453
ErrTrgNoDefiner = 1454
ErrOldFileFormat = 1455
ErrSpRecursionLimit = 1456
ErrSpProcTableCorrupt = 1457
ErrSpWrongName = 1458
ErrTableNeedsUpgrade = 1459
ErrSpNoAggregate = 1460
ErrMaxPreparedStmtCountReached = 1461
ErrViewRecursive = 1462
ErrNonGroupingFieldUsed = 1463
ErrTableCantHandleSpkeys = 1464
ErrNoTriggersOnSystemSchema = 1465
ErrRemovedSpaces = 1466
ErrAutoincReadFailed = 1467
ErrUsername = 1468
ErrHostname = 1469
ErrWrongStringLength = 1470
ErrNonInsertableTable = 1471
ErrAdminWrongMrgTable = 1472
ErrTooHighLevelOfNestingForSelect = 1473
ErrNameBecomesEmpty = 1474
ErrAmbiguousFieldTerm = 1475
ErrForeignServerExists = 1476
ErrForeignServerDoesntExist = 1477
ErrIllegalHaCreateOption = 1478
ErrPartitionRequiresValues = 1479
ErrPartitionWrongValues = 1480
ErrPartitionMaxvalue = 1481
ErrPartitionSubpartition = 1482
ErrPartitionSubpartMix = 1483
ErrPartitionWrongNoPart = 1484
ErrPartitionWrongNoSubpart = 1485
ErrWrongExprInPartitionFunc = 1486
ErrNoConstExprInRangeOrList = 1487
ErrFieldNotFoundPart = 1488
ErrListOfFieldsOnlyInHash = 1489
ErrInconsistentPartitionInfo = 1490
ErrPartitionFuncNotAllowed = 1491
ErrPartitionsMustBeDefined = 1492
ErrRangeNotIncreasing = 1493
ErrInconsistentTypeOfFunctions = 1494
ErrMultipleDefConstInListPart = 1495
ErrPartitionEntry = 1496
ErrMixHandler = 1497
ErrPartitionNotDefined = 1498
ErrTooManyPartitions = 1499
ErrSubpartition = 1500
ErrCantCreateHandlerFile = 1501
ErrBlobFieldInPartFunc = 1502
ErrUniqueKeyNeedAllFieldsInPf = 1503
ErrNoParts = 1504
ErrPartitionMgmtOnNonpartitioned = 1505
ErrForeignKeyOnPartitioned = 1506
ErrDropPartitionNonExistent = 1507
ErrDropLastPartition = 1508
ErrCoalesceOnlyOnHashPartition = 1509
ErrReorgHashOnlyOnSameNo = 1510
ErrReorgNoParam = 1511
ErrOnlyOnRangeListPartition = 1512
ErrAddPartitionSubpart = 1513
ErrAddPartitionNoNewPartition = 1514
ErrCoalescePartitionNoPartition = 1515
ErrReorgPartitionNotExist = 1516
ErrSameNamePartition = 1517
ErrNoBinlog = 1518
ErrConsecutiveReorgPartitions = 1519
ErrReorgOutsideRange = 1520
ErrPartitionFunctionFailure = 1521
ErrPartState = 1522
ErrLimitedPartRange = 1523
ErrPluginIsNotLoaded = 1524
ErrWrongValue = 1525
ErrNoPartitionForGivenValue = 1526
ErrFilegroupOptionOnlyOnce = 1527
ErrCreateFilegroupFailed = 1528
ErrDropFilegroupFailed = 1529
ErrTablespaceAutoExtend = 1530
ErrWrongSizeNumber = 1531
ErrSizeOverflow = 1532
ErrAlterFilegroupFailed = 1533
ErrBinlogRowLoggingFailed = 1534
ErrBinlogRowWrongTableDef = 1535
ErrBinlogRowRbrToSbr = 1536
ErrEventAlreadyExists = 1537
ErrEventStoreFailed = 1538
ErrEventDoesNotExist = 1539
ErrEventCantAlter = 1540
ErrEventDropFailed = 1541
ErrEventIntervalNotPositiveOrTooBig = 1542
ErrEventEndsBeforeStarts = 1543
ErrEventExecTimeInThePast = 1544
ErrEventOpenTableFailed = 1545
ErrEventNeitherMExprNorMAt = 1546
ErrObsoleteColCountDoesntMatchCorrupted = 1547
ErrObsoleteCannotLoadFromTable = 1548
ErrEventCannotDelete = 1549
ErrEventCompile = 1550
ErrEventSameName = 1551
ErrEventDataTooLong = 1552
ErrDropIndexFk = 1553
ErrWarnDeprecatedSyntaxWithVer = 1554
ErrCantWriteLockLogTable = 1555
ErrCantLockLogTable = 1556
ErrForeignDuplicateKeyOldUnused = 1557
ErrColCountDoesntMatchPleaseUpdate = 1558
ErrTempTablePreventsSwitchOutOfRbr = 1559
ErrStoredFunctionPreventsSwitchBinlogFormat = 1560
ErrNdbCantSwitchBinlogFormat = 1561
ErrPartitionNoTemporary = 1562
ErrPartitionConstDomain = 1563
ErrPartitionFunctionIsNotAllowed = 1564
ErrDdlLog = 1565
ErrNullInValuesLessThan = 1566
ErrWrongPartitionName = 1567
ErrCantChangeTxCharacteristics = 1568
ErrDupEntryAutoincrementCase = 1569
ErrEventModifyQueue = 1570
ErrEventSetVar = 1571
ErrPartitionMerge = 1572
ErrCantActivateLog = 1573
ErrRbrNotAvailable = 1574
ErrBase64Decode = 1575
ErrEventRecursionForbidden = 1576
ErrEventsDb = 1577
ErrOnlyIntegersAllowed = 1578
ErrUnsuportedLogEngine = 1579
ErrBadLogStatement = 1580
ErrCantRenameLogTable = 1581
ErrWrongParamcountToNativeFct = 1582
ErrWrongParametersToNativeFct = 1583
ErrWrongParametersToStoredFct = 1584
ErrNativeFctNameCollision = 1585
ErrDupEntryWithKeyName = 1586
ErrBinlogPurgeEmfile = 1587
ErrEventCannotCreateInThePast = 1588
ErrEventCannotAlterInThePast = 1589
ErrSlaveIncident = 1590
ErrNoPartitionForGivenValueSilent = 1591
ErrBinlogUnsafeStatement = 1592
ErrSlaveFatal = 1593
ErrSlaveRelayLogReadFailure = 1594
ErrSlaveRelayLogWriteFailure = 1595
ErrSlaveCreateEventFailure = 1596
ErrSlaveMasterComFailure = 1597
ErrBinlogLoggingImpossible = 1598
ErrViewNoCreationCtx = 1599
ErrViewInvalidCreationCtx = 1600
ErrSrInvalidCreationCtx = 1601
ErrTrgCorruptedFile = 1602
ErrTrgNoCreationCtx = 1603
ErrTrgInvalidCreationCtx = 1604
ErrEventInvalidCreationCtx = 1605
ErrTrgCantOpenTable = 1606
ErrCantCreateSroutine = 1607
ErrNeverUsed = 1608
ErrNoFormatDescriptionEventBeforeBinlogStatement = 1609
ErrSlaveCorruptEvent = 1610
ErrLoadDataInvalidColumn = 1611
ErrLogPurgeNoFile = 1612
ErrXaRbtimeout = 1613
ErrXaRbdeadlock = 1614
ErrNeedReprepare = 1615
ErrDelayedNotSupported = 1616
WarnNoMasterInfo = 1617
WarnOptionIgnored = 1618
WarnPluginDeleteBuiltin = 1619
WarnPluginBusy = 1620
ErrVariableIsReadonly = 1621
ErrWarnEngineTransactionRollback = 1622
ErrSlaveHeartbeatFailure = 1623
ErrSlaveHeartbeatValueOutOfRange = 1624
ErrNdbReplicationSchema = 1625
ErrConflictFnParse = 1626
ErrExceptionsWrite = 1627
ErrTooLongTableComment = 1628
ErrTooLongFieldComment = 1629
ErrFuncInexistentNameCollision = 1630
ErrDatabaseName = 1631
ErrTableName = 1632
ErrPartitionName = 1633
ErrSubpartitionName = 1634
ErrTemporaryName = 1635
ErrRenamedName = 1636
ErrTooManyConcurrentTrxs = 1637
WarnNonASCIISeparatorNotImplemented = 1638
ErrDebugSyncTimeout = 1639
ErrDebugSyncHitLimit = 1640
ErrDupSignalSet = 1641
ErrSignalWarn = 1642
ErrSignalNotFound = 1643
ErrSignalException = 1644
ErrResignalWithoutActiveHandler = 1645
ErrSignalBadConditionType = 1646
WarnCondItemTruncated = 1647
ErrCondItemTooLong = 1648
ErrUnknownLocale = 1649
ErrSlaveIgnoreServerIds = 1650
ErrQueryCacheDisabled = 1651
ErrSameNamePartitionField = 1652
ErrPartitionColumnList = 1653
ErrWrongTypeColumnValue = 1654
ErrTooManyPartitionFuncFields = 1655
ErrMaxvalueInValuesIn = 1656
ErrTooManyValues = 1657
ErrRowSinglePartitionField = 1658
ErrFieldTypeNotAllowedAsPartitionField = 1659
ErrPartitionFieldsTooLong = 1660
ErrBinlogRowEngineAndStmtEngine = 1661
ErrBinlogRowModeAndStmtEngine = 1662
ErrBinlogUnsafeAndStmtEngine = 1663
ErrBinlogRowInjectionAndStmtEngine = 1664
ErrBinlogStmtModeAndRowEngine = 1665
ErrBinlogRowInjectionAndStmtMode = 1666
ErrBinlogMultipleEnginesAndSelfLoggingEngine = 1667
ErrBinlogUnsafeLimit = 1668
ErrBinlogUnsafeInsertDelayed = 1669
ErrBinlogUnsafeSystemTable = 1670
ErrBinlogUnsafeAutoincColumns = 1671
ErrBinlogUnsafeUdf = 1672
ErrBinlogUnsafeSystemVariable = 1673
ErrBinlogUnsafeSystemFunction = 1674
ErrBinlogUnsafeNontransAfterTrans = 1675
ErrMessageAndStatement = 1676
ErrSlaveConversionFailed = 1677
ErrSlaveCantCreateConversion = 1678
ErrInsideTransactionPreventsSwitchBinlogFormat = 1679
ErrPathLength = 1680
ErrWarnDeprecatedSyntaxNoReplacement = 1681
ErrWrongNativeTableStructure = 1682
ErrWrongPerfschemaUsage = 1683
ErrWarnISSkippedTable = 1684
ErrInsideTransactionPreventsSwitchBinlogDirect = 1685
ErrStoredFunctionPreventsSwitchBinlogDirect = 1686
ErrSpatialMustHaveGeomCol = 1687
ErrTooLongIndexComment = 1688
ErrLockAborted = 1689
ErrDataOutOfRange = 1690
ErrWrongSpvarTypeInLimit = 1691
ErrBinlogUnsafeMultipleEnginesAndSelfLoggingEngine = 1692
ErrBinlogUnsafeMixedStatement = 1693
ErrInsideTransactionPreventsSwitchSQLLogBin = 1694
ErrStoredFunctionPreventsSwitchSQLLogBin = 1695
ErrFailedReadFromParFile = 1696
ErrValuesIsNotIntType = 1697
ErrAccessDeniedNoPassword = 1698
ErrSetPasswordAuthPlugin = 1699
ErrGrantPluginUserExists = 1700
ErrTruncateIllegalFk = 1701
ErrPluginIsPermanent = 1702
ErrSlaveHeartbeatValueOutOfRangeMin = 1703
ErrSlaveHeartbeatValueOutOfRangeMax = 1704
ErrStmtCacheFull = 1705
ErrMultiUpdateKeyConflict = 1706
ErrTableNeedsRebuild = 1707
WarnOptionBelowLimit = 1708
ErrIndexColumnTooLong = 1709
ErrErrorInTriggerBody = 1710
ErrErrorInUnknownTriggerBody = 1711
ErrIndexCorrupt = 1712
ErrUndoRecordTooBig = 1713
ErrBinlogUnsafeInsertIgnoreSelect = 1714
ErrBinlogUnsafeInsertSelectUpdate = 1715
ErrBinlogUnsafeReplaceSelect = 1716
ErrBinlogUnsafeCreateIgnoreSelect = 1717
ErrBinlogUnsafeCreateReplaceSelect = 1718
ErrBinlogUnsafeUpdateIgnore = 1719
ErrPluginNoUninstall = 1720
ErrPluginNoInstall = 1721
ErrBinlogUnsafeWriteAutoincSelect = 1722
ErrBinlogUnsafeCreateSelectAutoinc = 1723
ErrBinlogUnsafeInsertTwoKeys = 1724
ErrTableInFkCheck = 1725
ErrUnsupportedEngine = 1726
ErrBinlogUnsafeAutoincNotFirst = 1727
ErrCannotLoadFromTableV2 = 1728
ErrMasterDelayValueOutOfRange = 1729
ErrOnlyFdAndRbrEventsAllowedInBinlogStatement = 1730
ErrPartitionExchangeDifferentOption = 1731
ErrPartitionExchangePartTable = 1732
ErrPartitionExchangeTempTable = 1733
ErrPartitionInsteadOfSubpartition = 1734
ErrUnknownPartition = 1735
ErrTablesDifferentMetadata = 1736
ErrRowDoesNotMatchPartition = 1737
ErrBinlogCacheSizeGreaterThanMax = 1738
ErrWarnIndexNotApplicable = 1739
ErrPartitionExchangeForeignKey = 1740
ErrNoSuchKeyValue = 1741
ErrRplInfoDataTooLong = 1742
ErrNetworkReadEventChecksumFailure = 1743
ErrBinlogReadEventChecksumFailure = 1744
ErrBinlogStmtCacheSizeGreaterThanMax = 1745
ErrCantUpdateTableInCreateTableSelect = 1746
ErrPartitionClauseOnNonpartitioned = 1747
ErrRowDoesNotMatchGivenPartitionSet = 1748
ErrNoSuchPartitionunused = 1749
ErrChangeRplInfoRepositoryFailure = 1750
ErrWarningNotCompleteRollbackWithCreatedTempTable = 1751
ErrWarningNotCompleteRollbackWithDroppedTempTable = 1752
ErrMtsFeatureIsNotSupported = 1753
ErrMtsUpdatedDbsGreaterMax = 1754
ErrMtsCantParallel = 1755
ErrMtsInconsistentData = 1756
ErrFulltextNotSupportedWithPartitioning = 1757
ErrDaInvalidConditionNumber = 1758
ErrInsecurePlainText = 1759
ErrInsecureChangeMaster = 1760
ErrForeignDuplicateKeyWithChildInfo = 1761
ErrForeignDuplicateKeyWithoutChildInfo = 1762
ErrSQLthreadWithSecureSlave = 1763
ErrTableHasNoFt = 1764
ErrVariableNotSettableInSfOrTrigger = 1765
ErrVariableNotSettableInTransaction = 1766
ErrGtidNextIsNotInGtidNextList = 1767
ErrCantChangeGtidNextInTransactionWhenGtidNextListIsNull = 1768
ErrSetStatementCannotInvokeFunction = 1769
ErrGtidNextCantBeAutomaticIfGtidNextListIsNonNull = 1770
ErrSkippingLoggedTransaction = 1771
ErrMalformedGtidSetSpecification = 1772
ErrMalformedGtidSetEncoding = 1773
ErrMalformedGtidSpecification = 1774
ErrGnoExhausted = 1775
ErrBadSlaveAutoPosition = 1776
ErrAutoPositionRequiresGtidModeOn = 1777
ErrCantDoImplicitCommitInTrxWhenGtidNextIsSet = 1778
ErrGtidMode2Or3RequiresEnforceGtidConsistencyOn = 1779
ErrGtidModeRequiresBinlog = 1780
ErrCantSetGtidNextToGtidWhenGtidModeIsOff = 1781
ErrCantSetGtidNextToAnonymousWhenGtidModeIsOn = 1782
ErrCantSetGtidNextListToNonNullWhenGtidModeIsOff = 1783
ErrFoundGtidEventWhenGtidModeIsOff = 1784
ErrGtidUnsafeNonTransactionalTable = 1785
ErrGtidUnsafeCreateSelect = 1786
ErrGtidUnsafeCreateDropTemporaryTableInTransaction = 1787
ErrGtidModeCanOnlyChangeOneStepAtATime = 1788
ErrMasterHasPurgedRequiredGtids = 1789
ErrCantSetGtidNextWhenOwningGtid = 1790
ErrUnknownExplainFormat = 1791
ErrCantExecuteInReadOnlyTransaction = 1792
ErrTooLongTablePartitionComment = 1793
ErrSlaveConfiguration = 1794
ErrInnodbFtLimit = 1795
ErrInnodbNoFtTempTable = 1796
ErrInnodbFtWrongDocidColumn = 1797
ErrInnodbFtWrongDocidIndex = 1798
ErrInnodbOnlineLogTooBig = 1799
ErrUnknownAlterAlgorithm = 1800
ErrUnknownAlterLock = 1801
ErrMtsChangeMasterCantRunWithGaps = 1802
ErrMtsRecoveryFailure = 1803
ErrMtsResetWorkers = 1804
ErrColCountDoesntMatchCorruptedV2 = 1805
ErrSlaveSilentRetryTransaction = 1806
ErrDiscardFkChecksRunning = 1807
ErrTableSchemaMismatch = 1808
ErrTableInSystemTablespace = 1809
ErrIoRead = 1810
ErrIoWrite = 1811
ErrTablespaceMissing = 1812
ErrTablespaceExists = 1813
ErrTablespaceDiscarded = 1814
ErrInternal = 1815
ErrInnodbImport = 1816
ErrInnodbIndexCorrupt = 1817
ErrInvalidYearColumnLength = 1818
ErrNotValidPassword = 1819
ErrMustChangePassword = 1820
ErrFkNoIndexChild = 1821
ErrFkNoIndexParent = 1822
ErrFkFailAddSystem = 1823
ErrFkCannotOpenParent = 1824
ErrFkIncorrectOption = 1825
ErrFkDupName = 1826
ErrPasswordFormat = 1827
ErrFkColumnCannotDrop = 1828
ErrFkColumnCannotDropChild = 1829
ErrFkColumnNotNull = 1830
ErrDupIndex = 1831
ErrFkColumnCannotChange = 1832
ErrFkColumnCannotChangeChild = 1833
ErrFkCannotDeleteParent = 1834
ErrMalformedPacket = 1835
ErrReadOnlyMode = 1836
ErrGtidNextTypeUndefinedGroup = 1837
ErrVariableNotSettableInSp = 1838
ErrCantSetGtidPurgedWhenGtidModeIsOff = 1839
ErrCantSetGtidPurgedWhenGtidExecutedIsNotEmpty = 1840
ErrCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty = 1841
ErrGtidPurgedWasChanged = 1842
ErrGtidExecutedWasChanged = 1843
ErrBinlogStmtModeAndNoReplTables = 1844
ErrAlterOperationNotSupported = 1845
ErrAlterOperationNotSupportedReason = 1846
ErrAlterOperationNotSupportedReasonCopy = 1847
ErrAlterOperationNotSupportedReasonPartition = 1848
ErrAlterOperationNotSupportedReasonFkRename = 1849
ErrAlterOperationNotSupportedReasonColumnType = 1850
ErrAlterOperationNotSupportedReasonFkCheck = 1851
ErrAlterOperationNotSupportedReasonIgnore = 1852
ErrAlterOperationNotSupportedReasonNopk = 1853
ErrAlterOperationNotSupportedReasonAutoinc = 1854
ErrAlterOperationNotSupportedReasonHiddenFts = 1855
ErrAlterOperationNotSupportedReasonChangeFts = 1856
ErrAlterOperationNotSupportedReasonFts = 1857
ErrSQLSlaveSkipCounterNotSettableInGtidMode = 1858
ErrDupUnknownInIndex = 1859
ErrIdentCausesTooLongPath = 1860
ErrAlterOperationNotSupportedReasonNotNull = 1861
ErrMustChangePasswordLogin = 1862
ErrRowInWrongPartition = 1863
ErrErrorLast = 1863
)

882
vendor/github.com/pingcap/tidb/mysql/errname.go generated vendored Normal file
View file

@ -0,0 +1,882 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// MySQLErrName maps error code to MySQL error messages.
var MySQLErrName = map[uint16]string{
ErrHashchk: "hashchk",
ErrNisamchk: "isamchk",
ErrNo: "NO",
ErrYes: "YES",
ErrCantCreateFile: "Can't create file '%-.200s' (errno: %d - %s)",
ErrCantCreateTable: "Can't create table '%-.200s' (errno: %d)",
ErrCantCreateDb: "Can't create database '%-.192s' (errno: %d)",
ErrDbCreateExists: "Can't create database '%-.192s'; database exists",
ErrDbDropExists: "Can't drop database '%-.192s'; database doesn't exist",
ErrDbDropDelete: "Error dropping database (can't delete '%-.192s', errno: %d)",
ErrDbDropRmdir: "Error dropping database (can't rmdir '%-.192s', errno: %d)",
ErrCantDeleteFile: "Error on delete of '%-.192s' (errno: %d - %s)",
ErrCantFindSystemRec: "Can't read record in system table",
ErrCantGetStat: "Can't get status of '%-.200s' (errno: %d - %s)",
ErrCantGetWd: "Can't get working directory (errno: %d - %s)",
ErrCantLock: "Can't lock file (errno: %d - %s)",
ErrCantOpenFile: "Can't open file: '%-.200s' (errno: %d - %s)",
ErrFileNotFound: "Can't find file: '%-.200s' (errno: %d - %s)",
ErrCantReadDir: "Can't read dir of '%-.192s' (errno: %d - %s)",
ErrCantSetWd: "Can't change dir to '%-.192s' (errno: %d - %s)",
ErrCheckread: "Record has changed since last read in table '%-.192s'",
ErrDiskFull: "Disk full (%s); waiting for someone to free some space... (errno: %d - %s)",
ErrDupKey: "Can't write; duplicate key in table '%-.192s'",
ErrErrorOnClose: "Error on close of '%-.192s' (errno: %d - %s)",
ErrErrorOnRead: "Error reading file '%-.200s' (errno: %d - %s)",
ErrErrorOnRename: "Error on rename of '%-.210s' to '%-.210s' (errno: %d - %s)",
ErrErrorOnWrite: "Error writing file '%-.200s' (errno: %d - %s)",
ErrFileUsed: "'%-.192s' is locked against change",
ErrFilsortAbort: "Sort aborted",
ErrFormNotFound: "View '%-.192s' doesn't exist for '%-.192s'",
ErrGetErrno: "Got error %d from storage engine",
ErrIllegalHa: "Table storage engine for '%-.192s' doesn't have this option",
ErrKeyNotFound: "Can't find record in '%-.192s'",
ErrNotFormFile: "Incorrect information in file: '%-.200s'",
ErrNotKeyfile: "Incorrect key file for table '%-.200s'; try to repair it",
ErrOldKeyfile: "Old key file for table '%-.192s'; repair it!",
ErrOpenAsReadonly: "Table '%-.192s' is read only",
ErrOutofmemory: "Out of memory; restart server and try again (needed %d bytes)",
ErrOutOfSortmemory: "Out of sort memory, consider increasing server sort buffer size",
ErrUnexpectedEOF: "Unexpected EOF found when reading file '%-.192s' (errno: %d - %s)",
ErrConCount: "Too many connections",
ErrOutOfResources: "Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space",
ErrBadHost: "Can't get hostname for your address",
ErrHandshake: "Bad handshake",
ErrDbaccessDenied: "Access denied for user '%-.48s'@'%-.64s' to database '%-.192s'",
ErrAccessDenied: "Access denied for user '%-.48s'@'%-.64s' (using password: %s)",
ErrNoDb: "No database selected",
ErrUnknownCom: "Unknown command",
ErrBadNull: "Column '%-.192s' cannot be null",
ErrBadDb: "Unknown database '%-.192s'",
ErrTableExists: "Table '%-.192s' already exists",
ErrBadTable: "Unknown table '%-.100s'",
ErrNonUniq: "Column '%-.192s' in %-.192s is ambiguous",
ErrServerShutdown: "Server shutdown in progress",
ErrBadField: "Unknown column '%-.192s' in '%-.192s'",
ErrWrongFieldWithGroup: "'%-.192s' isn't in GROUP BY",
ErrWrongGroupField: "Can't group on '%-.192s'",
ErrWrongSumSelect: "Statement has sum functions and columns in same statement",
ErrWrongValueCount: "Column count doesn't match value count",
ErrTooLongIdent: "Identifier name '%-.100s' is too long",
ErrDupFieldname: "Duplicate column name '%-.192s'",
ErrDupKeyname: "Duplicate key name '%-.192s'",
ErrDupEntry: "Duplicate entry '%-.192s' for key %d",
ErrWrongFieldSpec: "Incorrect column specifier for column '%-.192s'",
ErrParse: "%s near '%-.80s' at line %d",
ErrEmptyQuery: "Query was empty",
ErrNonuniqTable: "Not unique table/alias: '%-.192s'",
ErrInvalidDefault: "Invalid default value for '%-.192s'",
ErrMultiplePriKey: "Multiple primary key defined",
ErrTooManyKeys: "Too many keys specified; max %d keys allowed",
ErrTooManyKeyParts: "Too many key parts specified; max %d parts allowed",
ErrTooLongKey: "Specified key was too long; max key length is %d bytes",
ErrKeyColumnDoesNotExits: "Key column '%-.192s' doesn't exist in table",
ErrBlobUsedAsKey: "BLOB column '%-.192s' can't be used in key specification with the used table type",
ErrTooBigFieldlength: "Column length too big for column '%-.192s' (max = %lu); use BLOB or TEXT instead",
ErrWrongAutoKey: "Incorrect table definition; there can be only one auto column and it must be defined as a key",
ErrReady: "%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d",
ErrNormalShutdown: "%s: Normal shutdown\n",
ErrGotSignal: "%s: Got signal %d. Aborting!\n",
ErrShutdownComplete: "%s: Shutdown complete\n",
ErrForcingClose: "%s: Forcing close of thread %ld user: '%-.48s'\n",
ErrIpsock: "Can't create IP socket",
ErrNoSuchIndex: "Table '%-.192s' has no index like the one used in CREATE INDEX; recreate the table",
ErrWrongFieldTerminators: "Field separator argument is not what is expected; check the manual",
ErrBlobsAndNoTerminated: "You can't use fixed rowlength with BLOBs; please use 'fields terminated by'",
ErrTextfileNotReadable: "The file '%-.128s' must be in the database directory or be readable by all",
ErrFileExists: "File '%-.200s' already exists",
ErrLoadInfo: "Records: %ld Deleted: %ld Skipped: %ld Warnings: %ld",
ErrAlterInfo: "Records: %ld Duplicates: %ld",
ErrWrongSubKey: "Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys",
ErrCantRemoveAllFields: "You can't delete all columns with ALTER TABLE; use DROP TABLE instead",
ErrCantDropFieldOrKey: "Can't DROP '%-.192s'; check that column/key exists",
ErrInsertInfo: "Records: %ld Duplicates: %ld Warnings: %ld",
ErrUpdateTableUsed: "You can't specify target table '%-.192s' for update in FROM clause",
ErrNoSuchThread: "Unknown thread id: %lu",
ErrKillDenied: "You are not owner of thread %lu",
ErrNoTablesUsed: "No tables used",
ErrTooBigSet: "Too many strings for column %-.192s and SET",
ErrNoUniqueLogfile: "Can't generate a unique log-filename %-.200s.(1-999)\n",
ErrTableNotLockedForWrite: "Table '%-.192s' was locked with a READ lock and can't be updated",
ErrTableNotLocked: "Table '%-.192s' was not locked with LOCK TABLES",
ErrBlobCantHaveDefault: "BLOB/TEXT column '%-.192s' can't have a default value",
ErrWrongDbName: "Incorrect database name '%-.100s'",
ErrWrongTableName: "Incorrect table name '%-.100s'",
ErrTooBigSelect: "The SELECT would examine more than MAXJOINSIZE rows; check your WHERE and use SET SQLBIGSELECTS=1 or SET MAXJOINSIZE=# if the SELECT is okay",
ErrUnknown: "Unknown error",
ErrUnknownProcedure: "Unknown procedure '%-.192s'",
ErrWrongParamcountToProcedure: "Incorrect parameter count to procedure '%-.192s'",
ErrWrongParametersToProcedure: "Incorrect parameters to procedure '%-.192s'",
ErrUnknownTable: "Unknown table '%-.192s' in %-.32s",
ErrFieldSpecifiedTwice: "Column '%-.192s' specified twice",
ErrInvalidGroupFuncUse: "Invalid use of group function",
ErrUnsupportedExtension: "Table '%-.192s' uses an extension that doesn't exist in this MySQL version",
ErrTableMustHaveColumns: "A table must have at least 1 column",
ErrRecordFileFull: "The table '%-.192s' is full",
ErrUnknownCharacterSet: "Unknown character set: '%-.64s'",
ErrTooManyTables: "Too many tables; MySQL can only use %d tables in a join",
ErrTooManyFields: "Too many columns",
ErrTooBigRowsize: "Row size too large. The maximum row size for the used table type, not counting BLOBs, is %ld. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs",
ErrStackOverrun: "Thread stack overrun: Used: %ld of a %ld stack. Use 'mysqld --threadStack=#' to specify a bigger stack if needed",
ErrWrongOuterJoin: "Cross dependency found in OUTER JOIN; examine your ON conditions",
ErrNullColumnInIndex: "Table handler doesn't support NULL in given index. Please change column '%-.192s' to be NOT NULL or use another handler",
ErrCantFindUdf: "Can't load function '%-.192s'",
ErrCantInitializeUdf: "Can't initialize function '%-.192s'; %-.80s",
ErrUdfNoPaths: "No paths allowed for shared library",
ErrUdfExists: "Function '%-.192s' already exists",
ErrCantOpenLibrary: "Can't open shared library '%-.192s' (errno: %d %-.128s)",
ErrCantFindDlEntry: "Can't find symbol '%-.128s' in library",
ErrFunctionNotDefined: "Function '%-.192s' is not defined",
ErrHostIsBlocked: "Host '%-.64s' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'",
ErrHostNotPrivileged: "Host '%-.64s' is not allowed to connect to this MySQL server",
ErrPasswordAnonymousUser: "You are using MySQL as an anonymous user and anonymous users are not allowed to change passwords",
ErrPasswordNotAllowed: "You must have privileges to update tables in the mysql database to be able to change passwords for others",
ErrPasswordNoMatch: "Can't find any matching row in the user table",
ErrUpdateInfo: "Rows matched: %ld Changed: %ld Warnings: %ld",
ErrCantCreateThread: "Can't create a new thread (errno %d); if you are not out of available memory, you can consult the manual for a possible OS-dependent bug",
ErrWrongValueCountOnRow: "Column count doesn't match value count at row %ld",
ErrCantReopenTable: "Can't reopen table: '%-.192s'",
ErrInvalidUseOfNull: "Invalid use of NULL value",
ErrRegexp: "Got error '%-.64s' from regexp",
ErrMixOfGroupFuncAndFields: "Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause",
ErrNonexistingGrant: "There is no such grant defined for user '%-.48s' on host '%-.64s'",
ErrTableaccessDenied: "%-.128s command denied to user '%-.48s'@'%-.64s' for table '%-.64s'",
ErrColumnaccessDenied: "%-.16s command denied to user '%-.48s'@'%-.64s' for column '%-.192s' in table '%-.192s'",
ErrIllegalGrantForTable: "Illegal GRANT/REVOKE command; please consult the manual to see which privileges can be used",
ErrGrantWrongHostOrUser: "The host or user argument to GRANT is too long",
ErrNoSuchTable: "Table '%-.192s.%-.192s' doesn't exist",
ErrNonexistingTableGrant: "There is no such grant defined for user '%-.48s' on host '%-.64s' on table '%-.192s'",
ErrNotAllowedCommand: "The used command is not allowed with this MySQL version",
ErrSyntax: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use",
ErrDelayedCantChangeLock: "Delayed insert thread couldn't get requested lock for table %-.192s",
ErrTooManyDelayedThreads: "Too many delayed threads in use",
ErrAbortingConnection: "Aborted connection %ld to db: '%-.192s' user: '%-.48s' (%-.64s)",
ErrNetPacketTooLarge: "Got a packet bigger than 'maxAllowedPacket' bytes",
ErrNetReadErrorFromPipe: "Got a read error from the connection pipe",
ErrNetFcntl: "Got an error from fcntl()",
ErrNetPacketsOutOfOrder: "Got packets out of order",
ErrNetUncompress: "Couldn't uncompress communication packet",
ErrNetRead: "Got an error reading communication packets",
ErrNetReadInterrupted: "Got timeout reading communication packets",
ErrNetErrorOnWrite: "Got an error writing communication packets",
ErrNetWriteInterrupted: "Got timeout writing communication packets",
ErrTooLongString: "Result string is longer than 'maxAllowedPacket' bytes",
ErrTableCantHandleBlob: "The used table type doesn't support BLOB/TEXT columns",
ErrTableCantHandleAutoIncrement: "The used table type doesn't support AUTOINCREMENT columns",
ErrDelayedInsertTableLocked: "INSERT DELAYED can't be used with table '%-.192s' because it is locked with LOCK TABLES",
ErrWrongColumnName: "Incorrect column name '%-.100s'",
ErrWrongKeyColumn: "The used storage engine can't index column '%-.192s'",
ErrWrongMrgTable: "Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist",
ErrDupUnique: "Can't write, because of unique constraint, to table '%-.192s'",
ErrBlobKeyWithoutLength: "BLOB/TEXT column '%-.192s' used in key specification without a key length",
ErrPrimaryCantHaveNull: "All parts of a PRIMARY KEY must be NOT NULL; if you need NULL in a key, use UNIQUE instead",
ErrTooManyRows: "Result consisted of more than one row",
ErrRequiresPrimaryKey: "This table type requires a primary key",
ErrNoRaidCompiled: "This version of MySQL is not compiled with RAID support",
ErrUpdateWithoutKeyInSafeMode: "You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column",
ErrKeyDoesNotExits: "Key '%-.192s' doesn't exist in table '%-.192s'",
ErrCheckNoSuchTable: "Can't open table",
ErrCheckNotImplemented: "The storage engine for the table doesn't support %s",
ErrCantDoThisDuringAnTransaction: "You are not allowed to execute this command in a transaction",
ErrErrorDuringCommit: "Got error %d during COMMIT",
ErrErrorDuringRollback: "Got error %d during ROLLBACK",
ErrErrorDuringFlushLogs: "Got error %d during FLUSHLOGS",
ErrErrorDuringCheckpoint: "Got error %d during CHECKPOINT",
ErrNewAbortingConnection: "Aborted connection %ld to db: '%-.192s' user: '%-.48s' host: '%-.64s' (%-.64s)",
ErrDumpNotImplemented: "The storage engine for the table does not support binary table dump",
ErrFlushMasterBinlogClosed: "Binlog closed, cannot RESET MASTER",
ErrIndexRebuild: "Failed rebuilding the index of dumped table '%-.192s'",
ErrMaster: "Error from master: '%-.64s'",
ErrMasterNetRead: "Net error reading from master",
ErrMasterNetWrite: "Net error writing to master",
ErrFtMatchingKeyNotFound: "Can't find FULLTEXT index matching the column list",
ErrLockOrActiveTransaction: "Can't execute the given command because you have active locked tables or an active transaction",
ErrUnknownSystemVariable: "Unknown system variable '%-.64s'",
ErrCrashedOnUsage: "Table '%-.192s' is marked as crashed and should be repaired",
ErrCrashedOnRepair: "Table '%-.192s' is marked as crashed and last (automatic?) repair failed",
ErrWarningNotCompleteRollback: "Some non-transactional changed tables couldn't be rolled back",
ErrTransCacheFull: "Multi-statement transaction required more than 'maxBinlogCacheSize' bytes of storage; increase this mysqld variable and try again",
ErrSlaveMustStop: "This operation cannot be performed with a running slave; run STOP SLAVE first",
ErrSlaveNotRunning: "This operation requires a running slave; configure slave and do START SLAVE",
ErrBadSlave: "The server is not configured as slave; fix in config file or with CHANGE MASTER TO",
ErrMasterInfo: "Could not initialize master info structure; more error messages can be found in the MySQL error log",
ErrSlaveThread: "Could not create slave thread; check system resources",
ErrTooManyUserConnections: "User %-.64s already has more than 'maxUserConnections' active connections",
ErrSetConstantsOnly: "You may only use constant expressions with SET",
ErrLockWaitTimeout: "Lock wait timeout exceeded; try restarting transaction",
ErrLockTableFull: "The total number of locks exceeds the lock table size",
ErrReadOnlyTransaction: "Update locks cannot be acquired during a READ UNCOMMITTED transaction",
ErrDropDbWithReadLock: "DROP DATABASE not allowed while thread is holding global read lock",
ErrCreateDbWithReadLock: "CREATE DATABASE not allowed while thread is holding global read lock",
ErrWrongArguments: "Incorrect arguments to %s",
ErrNoPermissionToCreateUser: "'%-.48s'@'%-.64s' is not allowed to create new users",
ErrUnionTablesInDifferentDir: "Incorrect table definition; all MERGE tables must be in the same database",
ErrLockDeadlock: "Deadlock found when trying to get lock; try restarting transaction",
ErrTableCantHandleFt: "The used table type doesn't support FULLTEXT indexes",
ErrCannotAddForeign: "Cannot add foreign key constraint",
ErrNoReferencedRow: "Cannot add or update a child row: a foreign key constraint fails",
ErrRowIsReferenced: "Cannot delete or update a parent row: a foreign key constraint fails",
ErrConnectToMaster: "Error connecting to master: %-.128s",
ErrQueryOnMaster: "Error running query on master: %-.128s",
ErrErrorWhenExecutingCommand: "Error when executing command %s: %-.128s",
ErrWrongUsage: "Incorrect usage of %s and %s",
ErrWrongNumberOfColumnsInSelect: "The used SELECT statements have a different number of columns",
ErrCantUpdateWithReadlock: "Can't execute the query because you have a conflicting read lock",
ErrMixingNotAllowed: "Mixing of transactional and non-transactional tables is disabled",
ErrDupArgument: "Option '%s' used twice in statement",
ErrUserLimitReached: "User '%-.64s' has exceeded the '%s' resource (current value: %ld)",
ErrSpecificAccessDenied: "Access denied; you need (at least one of) the %-.128s privilege(s) for this operation",
ErrLocalVariable: "Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL",
ErrGlobalVariable: "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL",
ErrNoDefault: "Variable '%-.64s' doesn't have a default value",
ErrWrongValueForVar: "Variable '%-.64s' can't be set to the value of '%-.200s'",
ErrWrongTypeForVar: "Incorrect argument type to variable '%-.64s'",
ErrVarCantBeRead: "Variable '%-.64s' can only be set, not read",
ErrCantUseOptionHere: "Incorrect usage/placement of '%s'",
ErrNotSupportedYet: "This version of MySQL doesn't yet support '%s'",
ErrMasterFatalErrorReadingBinlog: "Got fatal error %d from master when reading data from binary log: '%-.320s'",
ErrSlaveIgnoredTable: "Slave SQL thread ignored the query because of replicate-*-table rules",
ErrIncorrectGlobalLocalVar: "Variable '%-.192s' is a %s variable",
ErrWrongFkDef: "Incorrect foreign key definition for '%-.192s': %s",
ErrKeyRefDoNotMatchTableRef: "Key reference and table reference don't match",
ErrOperandColumns: "Operand should contain %d column(s)",
ErrSubqueryNo1Row: "Subquery returns more than 1 row",
ErrUnknownStmtHandler: "Unknown prepared statement handler (%.*s) given to %s",
ErrCorruptHelpDb: "Help database is corrupt or does not exist",
ErrCyclicReference: "Cyclic reference on subqueries",
ErrAutoConvert: "Converting column '%s' from %s to %s",
ErrIllegalReference: "Reference '%-.64s' not supported (%s)",
ErrDerivedMustHaveAlias: "Every derived table must have its own alias",
ErrSelectReduced: "Select %u was reduced during optimization",
ErrTablenameNotAllowedHere: "Table '%-.192s' from one of the SELECTs cannot be used in %-.32s",
ErrNotSupportedAuthMode: "Client does not support authentication protocol requested by server; consider upgrading MySQL client",
ErrSpatialCantHaveNull: "All parts of a SPATIAL index must be NOT NULL",
ErrCollationCharsetMismatch: "COLLATION '%s' is not valid for CHARACTER SET '%s'",
ErrSlaveWasRunning: "Slave is already running",
ErrSlaveWasNotRunning: "Slave already has been stopped",
ErrTooBigForUncompress: "Uncompressed data size too large; the maximum size is %d (probably, length of uncompressed data was corrupted)",
ErrZlibZMem: "ZLIB: Not enough memory",
ErrZlibZBuf: "ZLIB: Not enough room in the output buffer (probably, length of uncompressed data was corrupted)",
ErrZlibZData: "ZLIB: Input data corrupted",
ErrCutValueGroupConcat: "Row %u was cut by GROUPCONCAT()",
ErrWarnTooFewRecords: "Row %ld doesn't contain data for all columns",
ErrWarnTooManyRecords: "Row %ld was truncated; it contained more data than there were input columns",
ErrWarnNullToNotnull: "Column set to default value; NULL supplied to NOT NULL column '%s' at row %ld",
ErrWarnDataOutOfRange: "Out of range value for column '%s' at row %ld",
WarnDataTruncated: "Data truncated for column '%s' at row %ld",
ErrWarnUsingOtherHandler: "Using storage engine %s for table '%s'",
ErrCantAggregate2collations: "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'",
ErrDropUser: "Cannot drop one or more of the requested users",
ErrRevokeGrants: "Can't revoke all privileges for one or more of the requested users",
ErrCantAggregate3collations: "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'",
ErrCantAggregateNcollations: "Illegal mix of collations for operation '%s'",
ErrVariableIsNotStruct: "Variable '%-.64s' is not a variable component (can't be used as XXXX.variableName)",
ErrUnknownCollation: "Unknown collation: '%-.64s'",
ErrSlaveIgnoredSslParams: "SSL parameters in CHANGE MASTER are ignored because this MySQL slave was compiled without SSL support; they can be used later if MySQL slave with SSL is started",
ErrServerIsInSecureAuthMode: "Server is running in --secure-auth mode, but '%s'@'%s' has a password in the old format; please change the password to the new format",
ErrWarnFieldResolved: "Field or reference '%-.192s%s%-.192s%s%-.192s' of SELECT #%d was resolved in SELECT #%d",
ErrBadSlaveUntilCond: "Incorrect parameter or combination of parameters for START SLAVE UNTIL",
ErrMissingSkipSlave: "It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart",
ErrUntilCondIgnored: "SQL thread is not to be started so UNTIL options are ignored",
ErrWrongNameForIndex: "Incorrect index name '%-.100s'",
ErrWrongNameForCatalog: "Incorrect catalog name '%-.100s'",
ErrWarnQcResize: "Query cache failed to set size %lu; new query cache size is %lu",
ErrBadFtColumn: "Column '%-.192s' cannot be part of FULLTEXT index",
ErrUnknownKeyCache: "Unknown key cache '%-.100s'",
ErrWarnHostnameWontWork: "MySQL is started in --skip-name-resolve mode; you must restart it without this switch for this grant to work",
ErrUnknownStorageEngine: "Unknown storage engine '%s'",
ErrWarnDeprecatedSyntax: "'%s' is deprecated and will be removed in a future release. Please use %s instead",
ErrNonUpdatableTable: "The target table %-.100s of the %s is not updatable",
ErrFeatureDisabled: "The '%s' feature is disabled; you need MySQL built with '%s' to have it working",
ErrOptionPreventsStatement: "The MySQL server is running with the %s option so it cannot execute this statement",
ErrDuplicatedValueInType: "Column '%-.100s' has duplicated value '%-.64s' in %s",
ErrTruncatedWrongValue: "Truncated incorrect %-.32s value: '%-.128s'",
ErrTooMuchAutoTimestampCols: "Incorrect table definition; there can be only one TIMESTAMP column with CURRENTTIMESTAMP in DEFAULT or ON UPDATE clause",
ErrInvalidOnUpdate: "Invalid ON UPDATE clause for '%-.192s' column",
ErrUnsupportedPs: "This command is not supported in the prepared statement protocol yet",
ErrGetErrmsg: "Got error %d '%-.100s' from %s",
ErrGetTemporaryErrmsg: "Got temporary error %d '%-.100s' from %s",
ErrUnknownTimeZone: "Unknown or incorrect time zone: '%-.64s'",
ErrWarnInvalidTimestamp: "Invalid TIMESTAMP value in column '%s' at row %ld",
ErrInvalidCharacterString: "Invalid %s character string: '%.64s'",
ErrWarnAllowedPacketOverflowed: "Result of %s() was larger than maxAllowedPacket (%ld) - truncated",
ErrConflictingDeclarations: "Conflicting declarations: '%s%s' and '%s%s'",
ErrSpNoRecursiveCreate: "Can't create a %s from within another stored routine",
ErrSpAlreadyExists: "%s %s already exists",
ErrSpDoesNotExist: "%s %s does not exist",
ErrSpDropFailed: "Failed to DROP %s %s",
ErrSpStoreFailed: "Failed to CREATE %s %s",
ErrSpLilabelMismatch: "%s with no matching label: %s",
ErrSpLabelRedefine: "Redefining label %s",
ErrSpLabelMismatch: "End-label %s without match",
ErrSpUninitVar: "Referring to uninitialized variable %s",
ErrSpBadselect: "PROCEDURE %s can't return a result set in the given context",
ErrSpBadreturn: "RETURN is only allowed in a FUNCTION",
ErrSpBadstatement: "%s is not allowed in stored procedures",
ErrUpdateLogDeprecatedIgnored: "The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been ignored.",
ErrUpdateLogDeprecatedTranslated: "The update log is deprecated and replaced by the binary log; SET SQLLOGUPDATE has been translated to SET SQLLOGBIN.",
ErrQueryInterrupted: "Query execution was interrupted",
ErrSpWrongNoOfArgs: "Incorrect number of arguments for %s %s; expected %u, got %u",
ErrSpCondMismatch: "Undefined CONDITION: %s",
ErrSpNoreturn: "No RETURN found in FUNCTION %s",
ErrSpNoreturnend: "FUNCTION %s ended without RETURN",
ErrSpBadCursorQuery: "Cursor statement must be a SELECT",
ErrSpBadCursorSelect: "Cursor SELECT must not have INTO",
ErrSpCursorMismatch: "Undefined CURSOR: %s",
ErrSpCursorAlreadyOpen: "Cursor is already open",
ErrSpCursorNotOpen: "Cursor is not open",
ErrSpUndeclaredVar: "Undeclared variable: %s",
ErrSpWrongNoOfFetchArgs: "Incorrect number of FETCH variables",
ErrSpFetchNoData: "No data - zero rows fetched, selected, or processed",
ErrSpDupParam: "Duplicate parameter: %s",
ErrSpDupVar: "Duplicate variable: %s",
ErrSpDupCond: "Duplicate condition: %s",
ErrSpDupCurs: "Duplicate cursor: %s",
ErrSpCantAlter: "Failed to ALTER %s %s",
ErrSpSubselectNyi: "Subquery value not supported",
ErrStmtNotAllowedInSfOrTrg: "%s is not allowed in stored function or trigger",
ErrSpVarcondAfterCurshndlr: "Variable or condition declaration after cursor or handler declaration",
ErrSpCursorAfterHandler: "Cursor declaration after handler declaration",
ErrSpCaseNotFound: "Case not found for CASE statement",
ErrFparserTooBigFile: "Configuration file '%-.192s' is too big",
ErrFparserBadHeader: "Malformed file type header in file '%-.192s'",
ErrFparserEOFInComment: "Unexpected end of file while parsing comment '%-.200s'",
ErrFparserErrorInParameter: "Error while parsing parameter '%-.192s' (line: '%-.192s')",
ErrFparserEOFInUnknownParameter: "Unexpected end of file while skipping unknown parameter '%-.192s'",
ErrViewNoExplain: "EXPLAIN/SHOW can not be issued; lacking privileges for underlying table",
ErrFrmUnknownType: "File '%-.192s' has unknown type '%-.64s' in its header",
ErrWrongObject: "'%-.192s.%-.192s' is not %s",
ErrNonupdateableColumn: "Column '%-.192s' is not updatable",
ErrViewSelectDerived: "View's SELECT contains a subquery in the FROM clause",
ErrViewSelectClause: "View's SELECT contains a '%s' clause",
ErrViewSelectVariable: "View's SELECT contains a variable or parameter",
ErrViewSelectTmptable: "View's SELECT refers to a temporary table '%-.192s'",
ErrViewWrongList: "View's SELECT and view's field list have different column counts",
ErrWarnViewMerge: "View merge algorithm can't be used here for now (assumed undefined algorithm)",
ErrWarnViewWithoutKey: "View being updated does not have complete key of underlying table in it",
ErrViewInvalid: "View '%-.192s.%-.192s' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them",
ErrSpNoDropSp: "Can't drop or alter a %s from within another stored routine",
ErrSpGotoInHndlr: "GOTO is not allowed in a stored procedure handler",
ErrTrgAlreadyExists: "Trigger already exists",
ErrTrgDoesNotExist: "Trigger does not exist",
ErrTrgOnViewOrTempTable: "Trigger's '%-.192s' is view or temporary table",
ErrTrgCantChangeRow: "Updating of %s row is not allowed in %strigger",
ErrTrgNoSuchRowInTrg: "There is no %s row in %s trigger",
ErrNoDefaultForField: "Field '%-.192s' doesn't have a default value",
ErrDivisionByZero: "Division by 0",
ErrTruncatedWrongValueForField: "Incorrect %-.32s value: '%-.128s' for column '%.192s' at row %ld",
ErrIllegalValueForType: "Illegal %s '%-.192s' value found during parsing",
ErrViewNonupdCheck: "CHECK OPTION on non-updatable view '%-.192s.%-.192s'",
ErrViewCheckFailed: "CHECK OPTION failed '%-.192s.%-.192s'",
ErrProcaccessDenied: "%-.16s command denied to user '%-.48s'@'%-.64s' for routine '%-.192s'",
ErrRelayLogFail: "Failed purging old relay logs: %s",
ErrPasswdLength: "Password hash should be a %d-digit hexadecimal number",
ErrUnknownTargetBinlog: "Target log not found in binlog index",
ErrIoErrLogIndexRead: "I/O error reading log index file",
ErrBinlogPurgeProhibited: "Server configuration does not permit binlog purge",
ErrFseekFail: "Failed on fseek()",
ErrBinlogPurgeFatalErr: "Fatal error during log purge",
ErrLogInUse: "A purgeable log is in use, will not purge",
ErrLogPurgeUnknownErr: "Unknown error during log purge",
ErrRelayLogInit: "Failed initializing relay log position: %s",
ErrNoBinaryLogging: "You are not using binary logging",
ErrReservedSyntax: "The '%-.64s' syntax is reserved for purposes internal to the MySQL server",
ErrWsasFailed: "WSAStartup Failed",
ErrDiffGroupsProc: "Can't handle procedures with different groups yet",
ErrNoGroupForProc: "Select must have a group with this procedure",
ErrOrderWithProc: "Can't use ORDER clause with this procedure",
ErrLoggingProhibitChangingOf: "Binary logging and replication forbid changing the global server %s",
ErrNoFileMapping: "Can't map file: %-.200s, errno: %d",
ErrWrongMagic: "Wrong magic in %-.64s",
ErrPsManyParam: "Prepared statement contains too many placeholders",
ErrKeyPart0: "Key part '%-.192s' length cannot be 0",
ErrViewChecksum: "View text checksum failed",
ErrViewMultiupdate: "Can not modify more than one base table through a join view '%-.192s.%-.192s'",
ErrViewNoInsertFieldList: "Can not insert into join view '%-.192s.%-.192s' without fields list",
ErrViewDeleteMergeView: "Can not delete from join view '%-.192s.%-.192s'",
ErrCannotUser: "Operation %s failed for %.256s",
ErrXaerNota: "XAERNOTA: Unknown XID",
ErrXaerInval: "XAERINVAL: Invalid arguments (or unsupported command)",
ErrXaerRmfail: "XAERRMFAIL: The command cannot be executed when global transaction is in the %.64s state",
ErrXaerOutside: "XAEROUTSIDE: Some work is done outside global transaction",
ErrXaerRmerr: "XAERRMERR: Fatal error occurred in the transaction branch - check your data for consistency",
ErrXaRbrollback: "XARBROLLBACK: Transaction branch was rolled back",
ErrNonexistingProcGrant: "There is no such grant defined for user '%-.48s' on host '%-.64s' on routine '%-.192s'",
ErrProcAutoGrantFail: "Failed to grant EXECUTE and ALTER ROUTINE privileges",
ErrProcAutoRevokeFail: "Failed to revoke all privileges to dropped routine",
ErrDataTooLong: "Data too long for column '%s' at row %ld",
ErrSpBadSQLstate: "Bad SQLSTATE: '%s'",
ErrStartup: "%s: ready for connections.\nVersion: '%s' socket: '%s' port: %d %s",
ErrLoadFromFixedSizeRowsToVar: "Can't load value from file with fixed size rows to variable",
ErrCantCreateUserWithGrant: "You are not allowed to create a user with GRANT",
ErrWrongValueForType: "Incorrect %-.32s value: '%-.128s' for function %-.32s",
ErrTableDefChanged: "Table definition has changed, please retry transaction",
ErrSpDupHandler: "Duplicate handler declared in the same block",
ErrSpNotVarArg: "OUT or INOUT argument %d for routine %s is not a variable or NEW pseudo-variable in BEFORE trigger",
ErrSpNoRetset: "Not allowed to return a result set from a %s",
ErrCantCreateGeometryObject: "Cannot get geometry object from data you send to the GEOMETRY field",
ErrFailedRoutineBreakBinlog: "A routine failed and has neither NO SQL nor READS SQL DATA in its declaration and binary logging is enabled; if non-transactional tables were updated, the binary log will miss their changes",
ErrBinlogUnsafeRoutine: "This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)",
ErrBinlogCreateRoutineNeedSuper: "You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe logBinTrustFunctionCreators variable)",
ErrExecStmtWithOpenCursor: "You can't execute a prepared statement which has an open cursor associated with it. Reset the statement to re-execute it.",
ErrStmtHasNoOpenCursor: "The statement (%lu) has no open cursor.",
ErrCommitNotAllowedInSfOrTrg: "Explicit or implicit commit is not allowed in stored function or trigger.",
ErrNoDefaultForViewField: "Field of view '%-.192s.%-.192s' underlying table doesn't have a default value",
ErrSpNoRecursion: "Recursive stored functions and triggers are not allowed.",
ErrTooBigScale: "Too big scale %d specified for column '%-.192s'. Maximum is %lu.",
ErrTooBigPrecision: "Too big precision %d specified for column '%-.192s'. Maximum is %lu.",
ErrMBiggerThanD: "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.192s').",
ErrWrongLockOfSystemTable: "You can't combine write-locking of system tables with other tables or lock types",
ErrConnectToForeignDataSource: "Unable to connect to foreign data source: %.64s",
ErrQueryOnForeignDataSource: "There was a problem processing the query on the foreign data source. Data source : %-.64s",
ErrForeignDataSourceDoesntExist: "The foreign data source you are trying to reference does not exist. Data source : %-.64s",
ErrForeignDataStringInvalidCantCreate: "Can't create federated table. The data source connection string '%-.64s' is not in the correct format",
ErrForeignDataStringInvalid: "The data source connection string '%-.64s' is not in the correct format",
ErrCantCreateFederatedTable: "Can't create federated table. Foreign data src : %-.64s",
ErrTrgInWrongSchema: "Trigger in wrong schema",
ErrStackOverrunNeedMore: "Thread stack overrun: %ld bytes used of a %ld byte stack, and %ld bytes needed. Use 'mysqld --threadStack=#' to specify a bigger stack.",
ErrTooLongBody: "Routine body for '%-.100s' is too long",
ErrWarnCantDropDefaultKeycache: "Cannot drop default keycache",
ErrTooBigDisplaywidth: "Display width out of range for column '%-.192s' (max = %lu)",
ErrXaerDupid: "XAERDUPID: The XID already exists",
ErrDatetimeFunctionOverflow: "Datetime function: %-.32s field overflow",
ErrCantUpdateUsedTableInSfOrTrg: "Can't update table '%-.192s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.",
ErrViewPreventUpdate: "The definition of table '%-.192s' prevents operation %.192s on table '%-.192s'.",
ErrPsNoRecursion: "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner",
ErrSpCantSetAutocommit: "Not allowed to set autocommit from a stored function or trigger",
ErrMalformedDefiner: "Definer is not fully qualified",
ErrViewFrmNoUser: "View '%-.192s'.'%-.192s' has no definer information (old table format). Current user is used as definer. Please recreate the view!",
ErrViewOtherUser: "You need the SUPER privilege for creation view with '%-.192s'@'%-.192s' definer",
ErrNoSuchUser: "The user specified as a definer ('%-.64s'@'%-.64s') does not exist",
ErrForbidSchemaChange: "Changing schema from '%-.192s' to '%-.192s' is not allowed.",
ErrRowIsReferenced2: "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)",
ErrNoReferencedRow2: "Cannot add or update a child row: a foreign key constraint fails (%.192s)",
ErrSpBadVarShadow: "Variable '%-.64s' must be quoted with `...`, or renamed",
ErrTrgNoDefiner: "No definer attribute for trigger '%-.192s'.'%-.192s'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.",
ErrOldFileFormat: "'%-.192s' has an old format, you should re-create the '%s' object(s)",
ErrSpRecursionLimit: "Recursive limit %d (as set by the maxSpRecursionDepth variable) was exceeded for routine %.192s",
ErrSpProcTableCorrupt: "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data (internal code %d)",
ErrSpWrongName: "Incorrect routine name '%-.192s'",
ErrTableNeedsUpgrade: "Table upgrade required. Please do \"REPAIR TABLE `%-.32s`\"",
ErrSpNoAggregate: "AGGREGATE is not supported for stored functions",
ErrMaxPreparedStmtCountReached: "Can't create more than maxPreparedStmtCount statements (current value: %lu)",
ErrViewRecursive: "`%-.192s`.`%-.192s` contains view recursion",
ErrNonGroupingFieldUsed: "Non-grouping field '%-.192s' is used in %-.64s clause",
ErrTableCantHandleSpkeys: "The used table type doesn't support SPATIAL indexes",
ErrNoTriggersOnSystemSchema: "Triggers can not be created on system tables",
ErrRemovedSpaces: "Leading spaces are removed from name '%s'",
ErrAutoincReadFailed: "Failed to read auto-increment value from storage engine",
ErrUsername: "user name",
ErrHostname: "host name",
ErrWrongStringLength: "String '%-.70s' is too long for %s (should be no longer than %d)",
ErrNonInsertableTable: "The target table %-.100s of the %s is not insertable-into",
ErrAdminWrongMrgTable: "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist",
ErrTooHighLevelOfNestingForSelect: "Too high level of nesting for select",
ErrNameBecomesEmpty: "Name '%-.64s' has become ''",
ErrAmbiguousFieldTerm: "First character of the FIELDS TERMINATED string is ambiguous; please use non-optional and non-empty FIELDS ENCLOSED BY",
ErrForeignServerExists: "The foreign server, %s, you are trying to create already exists.",
ErrForeignServerDoesntExist: "The foreign server name you are trying to reference does not exist. Data source : %-.64s",
ErrIllegalHaCreateOption: "Table storage engine '%-.64s' does not support the create option '%.64s'",
ErrPartitionRequiresValues: "Syntax : %-.64s PARTITIONING requires definition of VALUES %-.64s for each partition",
ErrPartitionWrongValues: "Only %-.64s PARTITIONING can use VALUES %-.64s in partition definition",
ErrPartitionMaxvalue: "MAXVALUE can only be used in last partition definition",
ErrPartitionSubpartition: "Subpartitions can only be hash partitions and by key",
ErrPartitionSubpartMix: "Must define subpartitions on all partitions if on one partition",
ErrPartitionWrongNoPart: "Wrong number of partitions defined, mismatch with previous setting",
ErrPartitionWrongNoSubpart: "Wrong number of subpartitions defined, mismatch with previous setting",
ErrWrongExprInPartitionFunc: "Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed",
ErrNoConstExprInRangeOrList: "Expression in RANGE/LIST VALUES must be constant",
ErrFieldNotFoundPart: "Field in list of fields for partition function not found in table",
ErrListOfFieldsOnlyInHash: "List of fields is only allowed in KEY partitions",
ErrInconsistentPartitionInfo: "The partition info in the frm file is not consistent with what can be written into the frm file",
ErrPartitionFuncNotAllowed: "The %-.192s function returns the wrong type",
ErrPartitionsMustBeDefined: "For %-.64s partitions each partition must be defined",
ErrRangeNotIncreasing: "VALUES LESS THAN value must be strictly increasing for each partition",
ErrInconsistentTypeOfFunctions: "VALUES value must be of same type as partition function",
ErrMultipleDefConstInListPart: "Multiple definition of same constant in list partitioning",
ErrPartitionEntry: "Partitioning can not be used stand-alone in query",
ErrMixHandler: "The mix of handlers in the partitions is not allowed in this version of MySQL",
ErrPartitionNotDefined: "For the partitioned engine it is necessary to define all %-.64s",
ErrTooManyPartitions: "Too many partitions (including subpartitions) were defined",
ErrSubpartition: "It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning",
ErrCantCreateHandlerFile: "Failed to create specific handler file",
ErrBlobFieldInPartFunc: "A BLOB field is not allowed in partition function",
ErrUniqueKeyNeedAllFieldsInPf: "A %-.192s must include all columns in the table's partitioning function",
ErrNoParts: "Number of %-.64s = 0 is not an allowed value",
ErrPartitionMgmtOnNonpartitioned: "Partition management on a not partitioned table is not possible",
ErrForeignKeyOnPartitioned: "Foreign key clause is not yet supported in conjunction with partitioning",
ErrDropPartitionNonExistent: "Error in list of partitions to %-.64s",
ErrDropLastPartition: "Cannot remove all partitions, use DROP TABLE instead",
ErrCoalesceOnlyOnHashPartition: "COALESCE PARTITION can only be used on HASH/KEY partitions",
ErrReorgHashOnlyOnSameNo: "REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers",
ErrReorgNoParam: "REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs",
ErrOnlyOnRangeListPartition: "%-.64s PARTITION can only be used on RANGE/LIST partitions",
ErrAddPartitionSubpart: "Trying to Add partition(s) with wrong number of subpartitions",
ErrAddPartitionNoNewPartition: "At least one partition must be added",
ErrCoalescePartitionNoPartition: "At least one partition must be coalesced",
ErrReorgPartitionNotExist: "More partitions to reorganize than there are partitions",
ErrSameNamePartition: "Duplicate partition name %-.192s",
ErrNoBinlog: "It is not allowed to shut off binlog on this command",
ErrConsecutiveReorgPartitions: "When reorganizing a set of partitions they must be in consecutive order",
ErrReorgOutsideRange: "Reorganize of range partitions cannot change total ranges except for last partition where it can extend the range",
ErrPartitionFunctionFailure: "Partition function not supported in this version for this handler",
ErrPartState: "Partition state cannot be defined from CREATE/ALTER TABLE",
ErrLimitedPartRange: "The %-.64s handler only supports 32 bit integers in VALUES",
ErrPluginIsNotLoaded: "Plugin '%-.192s' is not loaded",
ErrWrongValue: "Incorrect %-.32s value: '%-.128s'",
ErrNoPartitionForGivenValue: "Table has no partition for value %-.64s",
ErrFilegroupOptionOnlyOnce: "It is not allowed to specify %s more than once",
ErrCreateFilegroupFailed: "Failed to create %s",
ErrDropFilegroupFailed: "Failed to drop %s",
ErrTablespaceAutoExtend: "The handler doesn't support autoextend of tablespaces",
ErrWrongSizeNumber: "A size parameter was incorrectly specified, either number or on the form 10M",
ErrSizeOverflow: "The size number was correct but we don't allow the digit part to be more than 2 billion",
ErrAlterFilegroupFailed: "Failed to alter: %s",
ErrBinlogRowLoggingFailed: "Writing one row to the row-based binary log failed",
ErrBinlogRowWrongTableDef: "Table definition on master and slave does not match: %s",
ErrBinlogRowRbrToSbr: "Slave running with --log-slave-updates must use row-based binary logging to be able to replicate row-based binary log events",
ErrEventAlreadyExists: "Event '%-.192s' already exists",
ErrEventStoreFailed: "Failed to store event %s. Error code %d from storage engine.",
ErrEventDoesNotExist: "Unknown event '%-.192s'",
ErrEventCantAlter: "Failed to alter event '%-.192s'",
ErrEventDropFailed: "Failed to drop %s",
ErrEventIntervalNotPositiveOrTooBig: "INTERVAL is either not positive or too big",
ErrEventEndsBeforeStarts: "ENDS is either invalid or before STARTS",
ErrEventExecTimeInThePast: "Event execution time is in the past. Event has been disabled",
ErrEventOpenTableFailed: "Failed to open mysql.event",
ErrEventNeitherMExprNorMAt: "No datetime expression provided",
ErrObsoleteColCountDoesntMatchCorrupted: "Column count of mysql.%s is wrong. Expected %d, found %d. The table is probably corrupted",
ErrObsoleteCannotLoadFromTable: "Cannot load from mysql.%s. The table is probably corrupted",
ErrEventCannotDelete: "Failed to delete the event from mysql.event",
ErrEventCompile: "Error during compilation of event's body",
ErrEventSameName: "Same old and new event name",
ErrEventDataTooLong: "Data for column '%s' too long",
ErrDropIndexFk: "Cannot drop index '%-.192s': needed in a foreign key constraint",
ErrWarnDeprecatedSyntaxWithVer: "The syntax '%s' is deprecated and will be removed in MySQL %s. Please use %s instead",
ErrCantWriteLockLogTable: "You can't write-lock a log table. Only read access is possible",
ErrCantLockLogTable: "You can't use locks with log tables.",
ErrForeignDuplicateKeyOldUnused: "Upholding foreign key constraints for table '%.192s', entry '%-.192s', key %d would lead to a duplicate entry",
ErrColCountDoesntMatchPleaseUpdate: "Column count of mysql.%s is wrong. Expected %d, found %d. Created with MySQL %d, now running %d. Please use mysqlUpgrade to fix this error.",
ErrTempTablePreventsSwitchOutOfRbr: "Cannot switch out of the row-based binary log format when the session has open temporary tables",
ErrStoredFunctionPreventsSwitchBinlogFormat: "Cannot change the binary logging format inside a stored function or trigger",
ErrNdbCantSwitchBinlogFormat: "The NDB cluster engine does not support changing the binlog format on the fly yet",
ErrPartitionNoTemporary: "Cannot create temporary table with partitions",
ErrPartitionConstDomain: "Partition constant is out of partition function domain",
ErrPartitionFunctionIsNotAllowed: "This partition function is not allowed",
ErrDdlLog: "Error in DDL log",
ErrNullInValuesLessThan: "Not allowed to use NULL value in VALUES LESS THAN",
ErrWrongPartitionName: "Incorrect partition name",
ErrCantChangeTxCharacteristics: "Transaction characteristics can't be changed while a transaction is in progress",
ErrDupEntryAutoincrementCase: "ALTER TABLE causes autoIncrement resequencing, resulting in duplicate entry '%-.192s' for key '%-.192s'",
ErrEventModifyQueue: "Internal scheduler error %d",
ErrEventSetVar: "Error during starting/stopping of the scheduler. Error code %u",
ErrPartitionMerge: "Engine cannot be used in partitioned tables",
ErrCantActivateLog: "Cannot activate '%-.64s' log",
ErrRbrNotAvailable: "The server was not built with row-based replication",
ErrBase64Decode: "Decoding of base64 string failed",
ErrEventRecursionForbidden: "Recursion of EVENT DDL statements is forbidden when body is present",
ErrEventsDb: "Cannot proceed because system tables used by Event Scheduler were found damaged at server start",
ErrOnlyIntegersAllowed: "Only integers allowed as number here",
ErrUnsuportedLogEngine: "This storage engine cannot be used for log tables\"",
ErrBadLogStatement: "You cannot '%s' a log table if logging is enabled",
ErrCantRenameLogTable: "Cannot rename '%s'. When logging enabled, rename to/from log table must rename two tables: the log table to an archive table and another table back to '%s'",
ErrWrongParamcountToNativeFct: "Incorrect parameter count in the call to native function '%-.192s'",
ErrWrongParametersToNativeFct: "Incorrect parameters in the call to native function '%-.192s'",
ErrWrongParametersToStoredFct: "Incorrect parameters in the call to stored function '%-.192s'",
ErrNativeFctNameCollision: "This function '%-.192s' has the same name as a native function",
ErrDupEntryWithKeyName: "Duplicate entry '%-.64s' for key '%-.192s'",
ErrBinlogPurgeEmfile: "Too many files opened, please execute the command again",
ErrEventCannotCreateInThePast: "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was dropped immediately after creation.",
ErrEventCannotAlterInThePast: "Event execution time is in the past and ON COMPLETION NOT PRESERVE is set. The event was not changed. Specify a time in the future.",
ErrSlaveIncident: "The incident %s occured on the master. Message: %-.64s",
ErrNoPartitionForGivenValueSilent: "Table has no partition for some existing values",
ErrBinlogUnsafeStatement: "Unsafe statement written to the binary log using statement format since BINLOGFORMAT = STATEMENT. %s",
ErrSlaveFatal: "Fatal : %s",
ErrSlaveRelayLogReadFailure: "Relay log read failure: %s",
ErrSlaveRelayLogWriteFailure: "Relay log write failure: %s",
ErrSlaveCreateEventFailure: "Failed to create %s",
ErrSlaveMasterComFailure: "Master command %s failed: %s",
ErrBinlogLoggingImpossible: "Binary logging not possible. Message: %s",
ErrViewNoCreationCtx: "View `%-.64s`.`%-.64s` has no creation context",
ErrViewInvalidCreationCtx: "Creation context of view `%-.64s`.`%-.64s' is invalid",
ErrSrInvalidCreationCtx: "Creation context of stored routine `%-.64s`.`%-.64s` is invalid",
ErrTrgCorruptedFile: "Corrupted TRG file for table `%-.64s`.`%-.64s`",
ErrTrgNoCreationCtx: "Triggers for table `%-.64s`.`%-.64s` have no creation context",
ErrTrgInvalidCreationCtx: "Trigger creation context of table `%-.64s`.`%-.64s` is invalid",
ErrEventInvalidCreationCtx: "Creation context of event `%-.64s`.`%-.64s` is invalid",
ErrTrgCantOpenTable: "Cannot open table for trigger `%-.64s`.`%-.64s`",
ErrCantCreateSroutine: "Cannot create stored routine `%-.64s`. Check warnings",
ErrNeverUsed: "Ambiguous slave modes combination. %s",
ErrNoFormatDescriptionEventBeforeBinlogStatement: "The BINLOG statement of type `%s` was not preceded by a format description BINLOG statement.",
ErrSlaveCorruptEvent: "Corrupted replication event was detected",
ErrLoadDataInvalidColumn: "Invalid column reference (%-.64s) in LOAD DATA",
ErrLogPurgeNoFile: "Being purged log %s was not found",
ErrXaRbtimeout: "XARBTIMEOUT: Transaction branch was rolled back: took too long",
ErrXaRbdeadlock: "XARBDEADLOCK: Transaction branch was rolled back: deadlock was detected",
ErrNeedReprepare: "Prepared statement needs to be re-prepared",
ErrDelayedNotSupported: "DELAYED option not supported for table '%-.192s'",
WarnNoMasterInfo: "The master info structure does not exist",
WarnOptionIgnored: "<%-.64s> option ignored",
WarnPluginDeleteBuiltin: "Built-in plugins cannot be deleted",
WarnPluginBusy: "Plugin is busy and will be uninstalled on shutdown",
ErrVariableIsReadonly: "%s variable '%s' is read-only. Use SET %s to assign the value",
ErrWarnEngineTransactionRollback: "Storage engine %s does not support rollback for this statement. Transaction rolled back and must be restarted",
ErrSlaveHeartbeatFailure: "Unexpected master's heartbeat data: %s",
ErrSlaveHeartbeatValueOutOfRange: "The requested value for the heartbeat period is either negative or exceeds the maximum allowed (%s seconds).",
ErrNdbReplicationSchema: "Bad schema for mysql.ndbReplication table. Message: %-.64s",
ErrConflictFnParse: "Error in parsing conflict function. Message: %-.64s",
ErrExceptionsWrite: "Write to exceptions table failed. Message: %-.128s\"",
ErrTooLongTableComment: "Comment for table '%-.64s' is too long (max = %lu)",
ErrTooLongFieldComment: "Comment for field '%-.64s' is too long (max = %lu)",
ErrFuncInexistentNameCollision: "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual",
ErrDatabaseName: "Database",
ErrTableName: "Table",
ErrPartitionName: "Partition",
ErrSubpartitionName: "Subpartition",
ErrTemporaryName: "Temporary",
ErrRenamedName: "Renamed",
ErrTooManyConcurrentTrxs: "Too many active concurrent transactions",
WarnNonASCIISeparatorNotImplemented: "Non-ASCII separator arguments are not fully supported",
ErrDebugSyncTimeout: "debug sync point wait timed out",
ErrDebugSyncHitLimit: "debug sync point hit limit reached",
ErrDupSignalSet: "Duplicate condition information item '%s'",
ErrSignalWarn: "Unhandled user-defined warning condition",
ErrSignalNotFound: "Unhandled user-defined not found condition",
ErrSignalException: "Unhandled user-defined exception condition",
ErrResignalWithoutActiveHandler: "RESIGNAL when handler not active",
ErrSignalBadConditionType: "SIGNAL/RESIGNAL can only use a CONDITION defined with SQLSTATE",
WarnCondItemTruncated: "Data truncated for condition item '%s'",
ErrCondItemTooLong: "Data too long for condition item '%s'",
ErrUnknownLocale: "Unknown locale: '%-.64s'",
ErrSlaveIgnoreServerIds: "The requested server id %d clashes with the slave startup option --replicate-same-server-id",
ErrQueryCacheDisabled: "Query cache is disabled; restart the server with queryCacheType=1 to enable it",
ErrSameNamePartitionField: "Duplicate partition field name '%-.192s'",
ErrPartitionColumnList: "Inconsistency in usage of column lists for partitioning",
ErrWrongTypeColumnValue: "Partition column values of incorrect type",
ErrTooManyPartitionFuncFields: "Too many fields in '%-.192s'",
ErrMaxvalueInValuesIn: "Cannot use MAXVALUE as value in VALUES IN",
ErrTooManyValues: "Cannot have more than one value for this type of %-.64s partitioning",
ErrRowSinglePartitionField: "Row expressions in VALUES IN only allowed for multi-field column partitioning",
ErrFieldTypeNotAllowedAsPartitionField: "Field '%-.192s' is of a not allowed type for this type of partitioning",
ErrPartitionFieldsTooLong: "The total length of the partitioning fields is too large",
ErrBinlogRowEngineAndStmtEngine: "Cannot execute statement: impossible to write to binary log since both row-incapable engines and statement-incapable engines are involved.",
ErrBinlogRowModeAndStmtEngine: "Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = ROW and at least one table uses a storage engine limited to statement-based logging.",
ErrBinlogUnsafeAndStmtEngine: "Cannot execute statement: impossible to write to binary log since statement is unsafe, storage engine is limited to statement-based logging, and BINLOGFORMAT = MIXED. %s",
ErrBinlogRowInjectionAndStmtEngine: "Cannot execute statement: impossible to write to binary log since statement is in row format and at least one table uses a storage engine limited to statement-based logging.",
ErrBinlogStmtModeAndRowEngine: "Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.%s",
ErrBinlogRowInjectionAndStmtMode: "Cannot execute statement: impossible to write to binary log since statement is in row format and BINLOGFORMAT = STATEMENT.",
ErrBinlogMultipleEnginesAndSelfLoggingEngine: "Cannot execute statement: impossible to write to binary log since more than one engine is involved and at least one engine is self-logging.",
ErrBinlogUnsafeLimit: "The statement is unsafe because it uses a LIMIT clause. This is unsafe because the set of rows included cannot be predicted.",
ErrBinlogUnsafeInsertDelayed: "The statement is unsafe because it uses INSERT DELAYED. This is unsafe because the times when rows are inserted cannot be predicted.",
ErrBinlogUnsafeSystemTable: "The statement is unsafe because it uses the general log, slow query log, or performanceSchema table(s). This is unsafe because system tables may differ on slaves.",
ErrBinlogUnsafeAutoincColumns: "Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTOINCREMENT column. Inserted values cannot be logged correctly.",
ErrBinlogUnsafeUdf: "Statement is unsafe because it uses a UDF which may not return the same value on the slave.",
ErrBinlogUnsafeSystemVariable: "Statement is unsafe because it uses a system variable that may have a different value on the slave.",
ErrBinlogUnsafeSystemFunction: "Statement is unsafe because it uses a system function that may return a different value on the slave.",
ErrBinlogUnsafeNontransAfterTrans: "Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.",
ErrMessageAndStatement: "%s Statement: %s",
ErrSlaveConversionFailed: "Column %d of table '%-.192s.%-.192s' cannot be converted from type '%-.32s' to type '%-.32s'",
ErrSlaveCantCreateConversion: "Can't create conversion table for table '%-.192s.%-.192s'",
ErrInsideTransactionPreventsSwitchBinlogFormat: "Cannot modify @@session.binlogFormat inside a transaction",
ErrPathLength: "The path specified for %.64s is too long.",
ErrWarnDeprecatedSyntaxNoReplacement: "'%s' is deprecated and will be removed in a future release.",
ErrWrongNativeTableStructure: "Native table '%-.64s'.'%-.64s' has the wrong structure",
ErrWrongPerfschemaUsage: "Invalid performanceSchema usage.",
ErrWarnISSkippedTable: "Table '%s'.'%s' was skipped since its definition is being modified by concurrent DDL statement",
ErrInsideTransactionPreventsSwitchBinlogDirect: "Cannot modify @@session.binlogDirectNonTransactionalUpdates inside a transaction",
ErrStoredFunctionPreventsSwitchBinlogDirect: "Cannot change the binlog direct flag inside a stored function or trigger",
ErrSpatialMustHaveGeomCol: "A SPATIAL index may only contain a geometrical type column",
ErrTooLongIndexComment: "Comment for index '%-.64s' is too long (max = %lu)",
ErrLockAborted: "Wait on a lock was aborted due to a pending exclusive lock",
ErrDataOutOfRange: "%s value is out of range in '%s'",
ErrWrongSpvarTypeInLimit: "A variable of a non-integer based type in LIMIT clause",
ErrBinlogUnsafeMultipleEnginesAndSelfLoggingEngine: "Mixing self-logging and non-self-logging engines in a statement is unsafe.",
ErrBinlogUnsafeMixedStatement: "Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.",
ErrInsideTransactionPreventsSwitchSQLLogBin: "Cannot modify @@session.sqlLogBin inside a transaction",
ErrStoredFunctionPreventsSwitchSQLLogBin: "Cannot change the sqlLogBin inside a stored function or trigger",
ErrFailedReadFromParFile: "Failed to read from the .par file",
ErrValuesIsNotIntType: "VALUES value for partition '%-.64s' must have type INT",
ErrAccessDeniedNoPassword: "Access denied for user '%-.48s'@'%-.64s'",
ErrSetPasswordAuthPlugin: "SET PASSWORD has no significance for users authenticating via plugins",
ErrGrantPluginUserExists: "GRANT with IDENTIFIED WITH is illegal because the user %-.*s already exists",
ErrTruncateIllegalFk: "Cannot truncate a table referenced in a foreign key constraint (%.192s)",
ErrPluginIsPermanent: "Plugin '%s' is forcePlusPermanent and can not be unloaded",
ErrSlaveHeartbeatValueOutOfRangeMin: "The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.",
ErrSlaveHeartbeatValueOutOfRangeMax: "The requested value for the heartbeat period exceeds the value of `slaveNetTimeout' seconds. A sensible value for the period should be less than the timeout.",
ErrStmtCacheFull: "Multi-row statements required more than 'maxBinlogStmtCacheSize' bytes of storage; increase this mysqld variable and try again",
ErrMultiUpdateKeyConflict: "Primary key/partition key update is not allowed since the table is updated both as '%-.192s' and '%-.192s'.",
ErrTableNeedsRebuild: "Table rebuild required. Please do \"ALTER TABLE `%-.32s` FORCE\" or dump/reload to fix it!",
WarnOptionBelowLimit: "The value of '%s' should be no less than the value of '%s'",
ErrIndexColumnTooLong: "Index column size too large. The maximum column size is %lu bytes.",
ErrErrorInTriggerBody: "Trigger '%-.64s' has an error in its body: '%-.256s'",
ErrErrorInUnknownTriggerBody: "Unknown trigger has an error in its body: '%-.256s'",
ErrIndexCorrupt: "Index %s is corrupted",
ErrUndoRecordTooBig: "Undo log record is too big.",
ErrBinlogUnsafeInsertIgnoreSelect: "INSERT IGNORE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeInsertSelectUpdate: "INSERT... SELECT... ON DUPLICATE KEY UPDATE is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are updated. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeReplaceSelect: "REPLACE... SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeCreateIgnoreSelect: "CREATE... IGNORE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeCreateReplaceSelect: "CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeUpdateIgnore: "UPDATE IGNORE is unsafe because the order in which rows are updated determines which (if any) rows are ignored. This order cannot be predicted and may differ on master and the slave.",
ErrPluginNoUninstall: "Plugin '%s' is marked as not dynamically uninstallable. You have to stop the server to uninstall it.",
ErrPluginNoInstall: "Plugin '%s' is marked as not dynamically installable. You have to stop the server to install it.",
ErrBinlogUnsafeWriteAutoincSelect: "Statements writing to a table with an auto-increment column after selecting from another table are unsafe because the order in which rows are retrieved determines what (if any) rows will be written. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeCreateSelectAutoinc: "CREATE TABLE... SELECT... on a table with an auto-increment column is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are inserted. This order cannot be predicted and may differ on master and the slave.",
ErrBinlogUnsafeInsertTwoKeys: "INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe",
ErrTableInFkCheck: "Table is being used in foreign key check.",
ErrUnsupportedEngine: "Storage engine '%s' does not support system tables. [%s.%s]",
ErrBinlogUnsafeAutoincNotFirst: "INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.",
ErrCannotLoadFromTableV2: "Cannot load from %s.%s. The table is probably corrupted",
ErrMasterDelayValueOutOfRange: "The requested value %u for the master delay exceeds the maximum %u",
ErrOnlyFdAndRbrEventsAllowedInBinlogStatement: "Only FormatDescriptionLogEvent and row events are allowed in BINLOG statements (but %s was provided)",
ErrPartitionExchangeDifferentOption: "Non matching attribute '%-.64s' between partition and table",
ErrPartitionExchangePartTable: "Table to exchange with partition is partitioned: '%-.64s'",
ErrPartitionExchangeTempTable: "Table to exchange with partition is temporary: '%-.64s'",
ErrPartitionInsteadOfSubpartition: "Subpartitioned table, use subpartition instead of partition",
ErrUnknownPartition: "Unknown partition '%-.64s' in table '%-.64s'",
ErrTablesDifferentMetadata: "Tables have different definitions",
ErrRowDoesNotMatchPartition: "Found a row that does not match the partition",
ErrBinlogCacheSizeGreaterThanMax: "Option binlogCacheSize (%lu) is greater than maxBinlogCacheSize (%lu); setting binlogCacheSize equal to maxBinlogCacheSize.",
ErrWarnIndexNotApplicable: "Cannot use %-.64s access on index '%-.64s' due to type or collation conversion on field '%-.64s'",
ErrPartitionExchangeForeignKey: "Table to exchange with partition has foreign key references: '%-.64s'",
ErrNoSuchKeyValue: "Key value '%-.192s' was not found in table '%-.192s.%-.192s'",
ErrRplInfoDataTooLong: "Data for column '%s' too long",
ErrNetworkReadEventChecksumFailure: "Replication event checksum verification failed while reading from network.",
ErrBinlogReadEventChecksumFailure: "Replication event checksum verification failed while reading from a log file.",
ErrBinlogStmtCacheSizeGreaterThanMax: "Option binlogStmtCacheSize (%lu) is greater than maxBinlogStmtCacheSize (%lu); setting binlogStmtCacheSize equal to maxBinlogStmtCacheSize.",
ErrCantUpdateTableInCreateTableSelect: "Can't update table '%-.192s' while '%-.192s' is being created.",
ErrPartitionClauseOnNonpartitioned: "PARTITION () clause on non partitioned table",
ErrRowDoesNotMatchGivenPartitionSet: "Found a row not matching the given partition set",
ErrNoSuchPartitionunused: "partition '%-.64s' doesn't exist",
ErrChangeRplInfoRepositoryFailure: "Failure while changing the type of replication repository: %s.",
ErrWarningNotCompleteRollbackWithCreatedTempTable: "The creation of some temporary tables could not be rolled back.",
ErrWarningNotCompleteRollbackWithDroppedTempTable: "Some temporary tables were dropped, but these operations could not be rolled back.",
ErrMtsFeatureIsNotSupported: "%s is not supported in multi-threaded slave mode. %s",
ErrMtsUpdatedDbsGreaterMax: "The number of modified databases exceeds the maximum %d; the database names will not be included in the replication event metadata.",
ErrMtsCantParallel: "Cannot execute the current event group in the parallel mode. Encountered event %s, relay-log name %s, position %s which prevents execution of this event group in parallel mode. Reason: %s.",
ErrMtsInconsistentData: "%s",
ErrFulltextNotSupportedWithPartitioning: "FULLTEXT index is not supported for partitioned tables.",
ErrDaInvalidConditionNumber: "Invalid condition number",
ErrInsecurePlainText: "Sending passwords in plain text without SSL/TLS is extremely insecure.",
ErrInsecureChangeMaster: "Storing MySQL user name or password information in the master.info repository is not secure and is therefore not recommended. Please see the MySQL Manual for more about this issue and possible alternatives.",
ErrForeignDuplicateKeyWithChildInfo: "Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in table '%.192s', key '%.192s'",
ErrForeignDuplicateKeyWithoutChildInfo: "Foreign key constraint for table '%.192s', record '%-.192s' would lead to a duplicate entry in a child table",
ErrSQLthreadWithSecureSlave: "Setting authentication options is not possible when only the Slave SQL Thread is being started.",
ErrTableHasNoFt: "The table does not have FULLTEXT index to support this query",
ErrVariableNotSettableInSfOrTrigger: "The system variable %.200s cannot be set in stored functions or triggers.",
ErrVariableNotSettableInTransaction: "The system variable %.200s cannot be set when there is an ongoing transaction.",
ErrGtidNextIsNotInGtidNextList: "The system variable @@SESSION.GTIDNEXT has the value %.200s, which is not listed in @@SESSION.GTIDNEXTLIST.",
ErrCantChangeGtidNextInTransactionWhenGtidNextListIsNull: "When @@SESSION.GTIDNEXTLIST == NULL, the system variable @@SESSION.GTIDNEXT cannot change inside a transaction.",
ErrSetStatementCannotInvokeFunction: "The statement 'SET %.200s' cannot invoke a stored function.",
ErrGtidNextCantBeAutomaticIfGtidNextListIsNonNull: "The system variable @@SESSION.GTIDNEXT cannot be 'AUTOMATIC' when @@SESSION.GTIDNEXTLIST is non-NULL.",
ErrSkippingLoggedTransaction: "Skipping transaction %.200s because it has already been executed and logged.",
ErrMalformedGtidSetSpecification: "Malformed GTID set specification '%.200s'.",
ErrMalformedGtidSetEncoding: "Malformed GTID set encoding.",
ErrMalformedGtidSpecification: "Malformed GTID specification '%.200s'.",
ErrGnoExhausted: "Impossible to generate Global Transaction Identifier: the integer component reached the maximal value. Restart the server with a new serverUuid.",
ErrBadSlaveAutoPosition: "Parameters MASTERLOGFILE, MASTERLOGPOS, RELAYLOGFILE and RELAYLOGPOS cannot be set when MASTERAUTOPOSITION is active.",
ErrAutoPositionRequiresGtidModeOn: "CHANGE MASTER TO MASTERAUTOPOSITION = 1 can only be executed when @@GLOBAL.GTIDMODE = ON.",
ErrCantDoImplicitCommitInTrxWhenGtidNextIsSet: "Cannot execute statements with implicit commit inside a transaction when @@SESSION.GTIDNEXT != AUTOMATIC or @@SESSION.GTIDNEXTLIST != NULL.",
ErrGtidMode2Or3RequiresEnforceGtidConsistencyOn: "@@GLOBAL.GTIDMODE = ON or UPGRADESTEP2 requires @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.",
ErrGtidModeRequiresBinlog: "@@GLOBAL.GTIDMODE = ON or UPGRADESTEP1 or UPGRADESTEP2 requires --log-bin and --log-slave-updates.",
ErrCantSetGtidNextToGtidWhenGtidModeIsOff: "@@SESSION.GTIDNEXT cannot be set to UUID:NUMBER when @@GLOBAL.GTIDMODE = OFF.",
ErrCantSetGtidNextToAnonymousWhenGtidModeIsOn: "@@SESSION.GTIDNEXT cannot be set to ANONYMOUS when @@GLOBAL.GTIDMODE = ON.",
ErrCantSetGtidNextListToNonNullWhenGtidModeIsOff: "@@SESSION.GTIDNEXTLIST cannot be set to a non-NULL value when @@GLOBAL.GTIDMODE = OFF.",
ErrFoundGtidEventWhenGtidModeIsOff: "Found a GtidLogEvent or PreviousGtidsLogEvent when @@GLOBAL.GTIDMODE = OFF.",
ErrGtidUnsafeNonTransactionalTable: "When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, updates to non-transactional tables can only be done in either autocommitted statements or single-statement transactions, and never in the same statement as updates to transactional tables.",
ErrGtidUnsafeCreateSelect: "CREATE TABLE ... SELECT is forbidden when @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1.",
ErrGtidUnsafeCreateDropTemporaryTableInTransaction: "When @@GLOBAL.ENFORCEGTIDCONSISTENCY = 1, the statements CREATE TEMPORARY TABLE and DROP TEMPORARY TABLE can be executed in a non-transactional context only, and require that AUTOCOMMIT = 1.",
ErrGtidModeCanOnlyChangeOneStepAtATime: "The value of @@GLOBAL.GTIDMODE can only change one step at a time: OFF <-> UPGRADESTEP1 <-> UPGRADESTEP2 <-> ON. Also note that this value must be stepped up or down simultaneously on all servers; see the Manual for instructions.",
ErrMasterHasPurgedRequiredGtids: "The slave is connecting using CHANGE MASTER TO MASTERAUTOPOSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.",
ErrCantSetGtidNextWhenOwningGtid: "@@SESSION.GTIDNEXT cannot be changed by a client that owns a GTID. The client owns %s. Ownership is released on COMMIT or ROLLBACK.",
ErrUnknownExplainFormat: "Unknown EXPLAIN format name: '%s'",
ErrCantExecuteInReadOnlyTransaction: "Cannot execute statement in a READ ONLY transaction.",
ErrTooLongTablePartitionComment: "Comment for table partition '%-.64s' is too long (max = %lu)",
ErrSlaveConfiguration: "Slave is not configured or failed to initialize properly. You must at least set --server-id to enable either a master or a slave. Additional error messages can be found in the MySQL error log.",
ErrInnodbFtLimit: "InnoDB presently supports one FULLTEXT index creation at a time",
ErrInnodbNoFtTempTable: "Cannot create FULLTEXT index on temporary InnoDB table",
ErrInnodbFtWrongDocidColumn: "Column '%-.192s' is of wrong type for an InnoDB FULLTEXT index",
ErrInnodbFtWrongDocidIndex: "Index '%-.192s' is of wrong type for an InnoDB FULLTEXT index",
ErrInnodbOnlineLogTooBig: "Creating index '%-.192s' required more than 'innodbOnlineAlterLogMaxSize' bytes of modification log. Please try again.",
ErrUnknownAlterAlgorithm: "Unknown ALGORITHM '%s'",
ErrUnknownAlterLock: "Unknown LOCK type '%s'",
ErrMtsChangeMasterCantRunWithGaps: "CHANGE MASTER cannot be executed when the slave was stopped with an error or killed in MTS mode. Consider using RESET SLAVE or START SLAVE UNTIL.",
ErrMtsRecoveryFailure: "Cannot recover after SLAVE errored out in parallel execution mode. Additional error messages can be found in the MySQL error log.",
ErrMtsResetWorkers: "Cannot clean up worker info tables. Additional error messages can be found in the MySQL error log.",
ErrColCountDoesntMatchCorruptedV2: "Column count of %s.%s is wrong. Expected %d, found %d. The table is probably corrupted",
ErrSlaveSilentRetryTransaction: "Slave must silently retry current transaction",
ErrDiscardFkChecksRunning: "There is a foreign key check running on table '%-.192s'. Cannot discard the table.",
ErrTableSchemaMismatch: "Schema mismatch (%s)",
ErrTableInSystemTablespace: "Table '%-.192s' in system tablespace",
ErrIoRead: "IO Read : (%lu, %s) %s",
ErrIoWrite: "IO Write : (%lu, %s) %s",
ErrTablespaceMissing: "Tablespace is missing for table '%-.192s'",
ErrTablespaceExists: "Tablespace for table '%-.192s' exists. Please DISCARD the tablespace before IMPORT.",
ErrTablespaceDiscarded: "Tablespace has been discarded for table '%-.192s'",
ErrInternal: "Internal : %s",
ErrInnodbImport: "ALTER TABLE '%-.192s' IMPORT TABLESPACE failed with error %lu : '%s'",
ErrInnodbIndexCorrupt: "Index corrupt: %s",
ErrInvalidYearColumnLength: "YEAR(%lu) column type is deprecated. Creating YEAR(4) column instead.",
ErrNotValidPassword: "Your password does not satisfy the current policy requirements",
ErrMustChangePassword: "You must SET PASSWORD before executing this statement",
ErrFkNoIndexChild: "Failed to add the foreign key constaint. Missing index for constraint '%s' in the foreign table '%s'",
ErrFkNoIndexParent: "Failed to add the foreign key constaint. Missing index for constraint '%s' in the referenced table '%s'",
ErrFkFailAddSystem: "Failed to add the foreign key constraint '%s' to system tables",
ErrFkCannotOpenParent: "Failed to open the referenced table '%s'",
ErrFkIncorrectOption: "Failed to add the foreign key constraint on table '%s'. Incorrect options in FOREIGN KEY constraint '%s'",
ErrFkDupName: "Duplicate foreign key constraint name '%s'",
ErrPasswordFormat: "The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function.",
ErrFkColumnCannotDrop: "Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s'",
ErrFkColumnCannotDropChild: "Cannot drop column '%-.192s': needed in a foreign key constraint '%-.192s' of table '%-.192s'",
ErrFkColumnNotNull: "Column '%-.192s' cannot be NOT NULL: needed in a foreign key constraint '%-.192s' SET NULL",
ErrDupIndex: "Duplicate index '%-.64s' defined on the table '%-.64s.%-.64s'. This is deprecated and will be disallowed in a future release.",
ErrFkColumnCannotChange: "Cannot change column '%-.192s': used in a foreign key constraint '%-.192s'",
ErrFkColumnCannotChangeChild: "Cannot change column '%-.192s': used in a foreign key constraint '%-.192s' of table '%-.192s'",
ErrFkCannotDeleteParent: "Cannot delete rows from table which is parent in a foreign key constraint '%-.192s' of table '%-.192s'",
ErrMalformedPacket: "Malformed communication packet.",
ErrReadOnlyMode: "Running in read-only mode",
ErrGtidNextTypeUndefinedGroup: "When @@SESSION.GTIDNEXT is set to a GTID, you must explicitly set it again after a COMMIT or ROLLBACK. If you see this error message in the slave SQL thread, it means that a table in the current transaction is transactional on the master and non-transactional on the slave. In a client connection, it means that you executed SET @@SESSION.GTIDNEXT before a transaction and forgot to set @@SESSION.GTIDNEXT to a different identifier or to 'AUTOMATIC' after COMMIT or ROLLBACK. Current @@SESSION.GTIDNEXT is '%s'.",
ErrVariableNotSettableInSp: "The system variable %.200s cannot be set in stored procedures.",
ErrCantSetGtidPurgedWhenGtidModeIsOff: "@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDMODE = ON.",
ErrCantSetGtidPurgedWhenGtidExecutedIsNotEmpty: "@@GLOBAL.GTIDPURGED can only be set when @@GLOBAL.GTIDEXECUTED is empty.",
ErrCantSetGtidPurgedWhenOwnedGtidsIsNotEmpty: "@@GLOBAL.GTIDPURGED can only be set when there are no ongoing transactions (not even in other clients).",
ErrGtidPurgedWasChanged: "@@GLOBAL.GTIDPURGED was changed from '%s' to '%s'.",
ErrGtidExecutedWasChanged: "@@GLOBAL.GTIDEXECUTED was changed from '%s' to '%s'.",
ErrBinlogStmtModeAndNoReplTables: "Cannot execute statement: impossible to write to binary log since BINLOGFORMAT = STATEMENT, and both replicated and non replicated tables are written to.",
ErrAlterOperationNotSupported: "%s is not supported for this operation. Try %s.",
ErrAlterOperationNotSupportedReason: "%s is not supported. Reason: %s. Try %s.",
ErrAlterOperationNotSupportedReasonCopy: "COPY algorithm requires a lock",
ErrAlterOperationNotSupportedReasonPartition: "Partition specific operations do not yet support LOCK/ALGORITHM",
ErrAlterOperationNotSupportedReasonFkRename: "Columns participating in a foreign key are renamed",
ErrAlterOperationNotSupportedReasonColumnType: "Cannot change column type INPLACE",
ErrAlterOperationNotSupportedReasonFkCheck: "Adding foreign keys needs foreignKeyChecks=OFF",
ErrAlterOperationNotSupportedReasonIgnore: "Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows",
ErrAlterOperationNotSupportedReasonNopk: "Dropping a primary key is not allowed without also adding a new primary key",
ErrAlterOperationNotSupportedReasonAutoinc: "Adding an auto-increment column requires a lock",
ErrAlterOperationNotSupportedReasonHiddenFts: "Cannot replace hidden FTSDOCID with a user-visible one",
ErrAlterOperationNotSupportedReasonChangeFts: "Cannot drop or rename FTSDOCID",
ErrAlterOperationNotSupportedReasonFts: "Fulltext index creation requires a lock",
ErrSQLSlaveSkipCounterNotSettableInGtidMode: "sqlSlaveSkipCounter can not be set when the server is running with @@GLOBAL.GTIDMODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction",
ErrDupUnknownInIndex: "Duplicate entry for key '%-.192s'",
ErrIdentCausesTooLongPath: "Long database name and identifier for object resulted in path length exceeding %d characters. Path: '%s'.",
ErrAlterOperationNotSupportedReasonNotNull: "cannot silently convert NULL values, as required in this SQLMODE",
ErrMustChangePasswordLogin: "Your password has expired. To log in you must change it using a client that supports expired passwords.",
ErrRowInWrongPartition: "Found a row in wrong partition %s",
}

71
vendor/github.com/pingcap/tidb/mysql/error.go generated vendored Normal file
View file

@ -0,0 +1,71 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
import (
"errors"
"fmt"
)
// Portable analogs of some common call errors.
var (
ErrBadConn = errors.New("connection was bad")
ErrMalformPacket = errors.New("Malform packet error")
)
// SQLError records an error information, from executing SQL.
type SQLError struct {
Code uint16
Message string
State string
}
// Error prints errors, with a formatted string.
func (e *SQLError) Error() string {
return fmt.Sprintf("ERROR %d (%s): %s", e.Code, e.State, e.Message)
}
// NewErr generates a SQL error, with an error code and default format specifier defined in MySQLErrName.
func NewErr(errCode uint16, args ...interface{}) *SQLError {
e := &SQLError{Code: errCode}
if s, ok := MySQLState[errCode]; ok {
e.State = s
} else {
e.State = DefaultMySQLState
}
if format, ok := MySQLErrName[errCode]; ok {
e.Message = fmt.Sprintf(format, args...)
} else {
e.Message = fmt.Sprint(args...)
}
return e
}
// NewErrf creates a SQL error, with an error code and a format specifier
func NewErrf(errCode uint16, format string, args ...interface{}) *SQLError {
e := &SQLError{Code: errCode}
if s, ok := MySQLState[errCode]; ok {
e.State = s
} else {
e.State = DefaultMySQLState
}
e.Message = fmt.Sprintf(format, args...)
return e
}

92
vendor/github.com/pingcap/tidb/mysql/fsp.go generated vendored Normal file
View file

@ -0,0 +1,92 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
import (
"math"
"strconv"
"strings"
"github.com/juju/errors"
)
const (
// UnspecifiedFsp is the unspecified fractional seconds part.
UnspecifiedFsp int = -1
// MaxFsp is the maximum digit of fractional seconds part.
MaxFsp int = 6
// MinFsp is the minimum digit of fractional seconds part.
MinFsp int = 0
// DefaultFsp is the default digit of fractional seconds part.
// MySQL use 0 as the default Fsp.
DefaultFsp int = 0
)
func checkFsp(fsp int) (int, error) {
if fsp == UnspecifiedFsp {
return DefaultFsp, nil
}
if fsp < MinFsp || fsp > MaxFsp {
return DefaultFsp, errors.Errorf("Invalid fsp %d", fsp)
}
return fsp, nil
}
func parseFrac(s string, fsp int) (int, error) {
if len(s) == 0 {
return 0, nil
}
var err error
fsp, err = checkFsp(fsp)
if err != nil {
return 0, errors.Trace(err)
}
// Use float to calculate frac, e.g, "123" -> "0.123"
if !strings.HasPrefix(s, ".") && !strings.HasPrefix(s, "0.") {
s = "0." + s
}
frac, err := strconv.ParseFloat(s, 64)
if err != nil {
return 0, errors.Trace(err)
}
// round frac to the nearest value with FSP
var round float64
pow := math.Pow(10, float64(fsp))
digit := pow * frac
_, div := math.Modf(digit)
if div >= 0.5 {
round = math.Ceil(digit)
} else {
round = math.Floor(digit)
}
// Get the final frac, with 6 digit number
// 0.1236 round 3 -> 124 -> 123000
// 0.0312 round 2 -> 3 -> 30000
return int(round * math.Pow10(MaxFsp-fsp)), nil
}
// alignFrac is used to generate alignment frac, like `100` -> `100000`
func alignFrac(s string, fsp int) string {
sl := len(s)
if sl < fsp {
return s + strings.Repeat("0", fsp-sl)
}
return s
}

85
vendor/github.com/pingcap/tidb/mysql/hex.go generated vendored Normal file
View file

@ -0,0 +1,85 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
import (
"encoding/hex"
"fmt"
"strconv"
"strings"
"github.com/juju/errors"
)
// Hex is for mysql hexadecimal literal type.
type Hex struct {
// Value holds numeric value for hexadecimal literal.
Value int64
}
// String implements fmt.Stringer interface.
func (h Hex) String() string {
s := fmt.Sprintf("%X", h.Value)
if len(s)%2 != 0 {
return "0x0" + s
}
return "0x" + s
}
// ToNumber changes hexadecimal type to float64 for numeric operation.
// MySQL treats hexadecimal literal as double type.
func (h Hex) ToNumber() float64 {
return float64(h.Value)
}
// ToString returns the string representation for hexadecimal literal.
func (h Hex) ToString() string {
s := fmt.Sprintf("%x", h.Value)
if len(s)%2 != 0 {
s = "0" + s
}
// should never error.
b, _ := hex.DecodeString(s)
return string(b)
}
// ParseHex parses hexadecimal literal string.
// The string format can be X'val', x'val' or 0xval.
// val must in (0...9, a...z, A...Z).
func ParseHex(s string) (Hex, error) {
if len(s) == 0 {
return Hex{}, errors.Errorf("invalid empty string for parsing hexadecimal literal")
}
if s[0] == 'x' || s[0] == 'X' {
// format is x'val' or X'val'
s = strings.Trim(s[1:], "'")
if len(s)%2 != 0 {
return Hex{}, errors.Errorf("invalid hexadecimal format, must even numbers, but %d", len(s))
}
s = "0x" + s
} else if !strings.HasPrefix(s, "0x") {
// here means format is not x'val', X'val' or 0xval.
return Hex{}, errors.Errorf("invalid hexadecimal format %s", s)
}
n, err := strconv.ParseInt(s, 0, 64)
if err != nil {
return Hex{}, errors.Trace(err)
}
return Hex{Value: n}, nil
}

111
vendor/github.com/pingcap/tidb/mysql/set.go generated vendored Normal file
View file

@ -0,0 +1,111 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
import (
"strconv"
"strings"
"github.com/juju/errors"
)
var zeroSet = Set{Name: "", Value: 0}
// Set is for MySQL Set type.
type Set struct {
Name string
Value uint64
}
// String implements fmt.Stringer interface.
func (e Set) String() string {
return e.Name
}
// ToNumber changes Set to float64 for numeric operation.
func (e Set) ToNumber() float64 {
return float64(e.Value)
}
// ParseSetName creates a Set with name.
func ParseSetName(elems []string, name string) (Set, error) {
if len(name) == 0 {
return zeroSet, nil
}
seps := strings.Split(name, ",")
marked := make(map[string]struct{}, len(seps))
for _, s := range seps {
marked[strings.ToLower(s)] = struct{}{}
}
items := make([]string, 0, len(seps))
value := uint64(0)
for i, n := range elems {
key := strings.ToLower(n)
if _, ok := marked[key]; ok {
value |= (1 << uint64(i))
delete(marked, key)
items = append(items, key)
}
}
if len(marked) == 0 {
return Set{Name: strings.Join(items, ","), Value: value}, nil
}
// name doesn't exist, maybe an integer?
if num, err := strconv.ParseUint(name, 0, 64); err == nil {
return ParseSetValue(elems, num)
}
return Set{}, errors.Errorf("item %s is not in Set %v", name, elems)
}
var (
setIndexValue []uint64
setIndexInvertValue []uint64
)
func init() {
setIndexValue = make([]uint64, 64)
setIndexInvertValue = make([]uint64, 64)
for i := 0; i < 64; i++ {
setIndexValue[i] = 1 << uint64(i)
setIndexInvertValue[i] = ^setIndexValue[i]
}
}
// ParseSetValue creates a Set with special number.
func ParseSetValue(elems []string, number uint64) (Set, error) {
if number == 0 {
return zeroSet, nil
}
value := number
var items []string
for i := 0; i < len(elems); i++ {
if number&setIndexValue[i] > 0 {
items = append(items, elems[i])
number &= setIndexInvertValue[i]
}
}
if number != 0 {
return Set{}, errors.Errorf("invalid number %d for Set %v", number, elems)
}
return Set{Name: strings.Join(items, ","), Value: value}, nil
}

249
vendor/github.com/pingcap/tidb/mysql/state.go generated vendored Normal file
View file

@ -0,0 +1,249 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
const (
// DefaultMySQLState is default state of the mySQL
DefaultMySQLState = "HY000"
)
// MySQLState maps error code to MySQL SQLSTATE value.
// The values are taken from ANSI SQL and ODBC and are more standardized.
var MySQLState = map[uint16]string{
ErrDupKey: "23000",
ErrOutofmemory: "HY001",
ErrOutOfSortmemory: "HY001",
ErrConCount: "08004",
ErrBadHost: "08S01",
ErrHandshake: "08S01",
ErrDbaccessDenied: "42000",
ErrAccessDenied: "28000",
ErrNoDb: "3D000",
ErrUnknownCom: "08S01",
ErrBadNull: "23000",
ErrBadDb: "42000",
ErrTableExists: "42S01",
ErrBadTable: "42S02",
ErrNonUniq: "23000",
ErrServerShutdown: "08S01",
ErrBadField: "42S22",
ErrWrongFieldWithGroup: "42000",
ErrWrongSumSelect: "42000",
ErrWrongGroupField: "42000",
ErrWrongValueCount: "21S01",
ErrTooLongIdent: "42000",
ErrDupFieldname: "42S21",
ErrDupKeyname: "42000",
ErrDupEntry: "23000",
ErrWrongFieldSpec: "42000",
ErrParse: "42000",
ErrEmptyQuery: "42000",
ErrNonuniqTable: "42000",
ErrInvalidDefault: "42000",
ErrMultiplePriKey: "42000",
ErrTooManyKeys: "42000",
ErrTooManyKeyParts: "42000",
ErrTooLongKey: "42000",
ErrKeyColumnDoesNotExits: "42000",
ErrBlobUsedAsKey: "42000",
ErrTooBigFieldlength: "42000",
ErrWrongAutoKey: "42000",
ErrForcingClose: "08S01",
ErrIpsock: "08S01",
ErrNoSuchIndex: "42S12",
ErrWrongFieldTerminators: "42000",
ErrBlobsAndNoTerminated: "42000",
ErrCantRemoveAllFields: "42000",
ErrCantDropFieldOrKey: "42000",
ErrBlobCantHaveDefault: "42000",
ErrWrongDbName: "42000",
ErrWrongTableName: "42000",
ErrTooBigSelect: "42000",
ErrUnknownProcedure: "42000",
ErrWrongParamcountToProcedure: "42000",
ErrUnknownTable: "42S02",
ErrFieldSpecifiedTwice: "42000",
ErrUnsupportedExtension: "42000",
ErrTableMustHaveColumns: "42000",
ErrUnknownCharacterSet: "42000",
ErrTooBigRowsize: "42000",
ErrWrongOuterJoin: "42000",
ErrNullColumnInIndex: "42000",
ErrPasswordAnonymousUser: "42000",
ErrPasswordNotAllowed: "42000",
ErrPasswordNoMatch: "42000",
ErrWrongValueCountOnRow: "21S01",
ErrInvalidUseOfNull: "22004",
ErrRegexp: "42000",
ErrMixOfGroupFuncAndFields: "42000",
ErrNonexistingGrant: "42000",
ErrTableaccessDenied: "42000",
ErrColumnaccessDenied: "42000",
ErrIllegalGrantForTable: "42000",
ErrGrantWrongHostOrUser: "42000",
ErrNoSuchTable: "42S02",
ErrNonexistingTableGrant: "42000",
ErrNotAllowedCommand: "42000",
ErrSyntax: "42000",
ErrAbortingConnection: "08S01",
ErrNetPacketTooLarge: "08S01",
ErrNetReadErrorFromPipe: "08S01",
ErrNetFcntl: "08S01",
ErrNetPacketsOutOfOrder: "08S01",
ErrNetUncompress: "08S01",
ErrNetRead: "08S01",
ErrNetReadInterrupted: "08S01",
ErrNetErrorOnWrite: "08S01",
ErrNetWriteInterrupted: "08S01",
ErrTooLongString: "42000",
ErrTableCantHandleBlob: "42000",
ErrTableCantHandleAutoIncrement: "42000",
ErrWrongColumnName: "42000",
ErrWrongKeyColumn: "42000",
ErrDupUnique: "23000",
ErrBlobKeyWithoutLength: "42000",
ErrPrimaryCantHaveNull: "42000",
ErrTooManyRows: "42000",
ErrRequiresPrimaryKey: "42000",
ErrKeyDoesNotExits: "42000",
ErrCheckNoSuchTable: "42000",
ErrCheckNotImplemented: "42000",
ErrCantDoThisDuringAnTransaction: "25000",
ErrNewAbortingConnection: "08S01",
ErrMasterNetRead: "08S01",
ErrMasterNetWrite: "08S01",
ErrTooManyUserConnections: "42000",
ErrReadOnlyTransaction: "25000",
ErrNoPermissionToCreateUser: "42000",
ErrLockDeadlock: "40001",
ErrNoReferencedRow: "23000",
ErrRowIsReferenced: "23000",
ErrConnectToMaster: "08S01",
ErrWrongNumberOfColumnsInSelect: "21000",
ErrUserLimitReached: "42000",
ErrSpecificAccessDenied: "42000",
ErrNoDefault: "42000",
ErrWrongValueForVar: "42000",
ErrWrongTypeForVar: "42000",
ErrCantUseOptionHere: "42000",
ErrNotSupportedYet: "42000",
ErrWrongFkDef: "42000",
ErrOperandColumns: "21000",
ErrSubqueryNo1Row: "21000",
ErrIllegalReference: "42S22",
ErrDerivedMustHaveAlias: "42000",
ErrSelectReduced: "01000",
ErrTablenameNotAllowedHere: "42000",
ErrNotSupportedAuthMode: "08004",
ErrSpatialCantHaveNull: "42000",
ErrCollationCharsetMismatch: "42000",
ErrWarnTooFewRecords: "01000",
ErrWarnTooManyRecords: "01000",
ErrWarnNullToNotnull: "22004",
ErrWarnDataOutOfRange: "22003",
WarnDataTruncated: "01000",
ErrWrongNameForIndex: "42000",
ErrWrongNameForCatalog: "42000",
ErrUnknownStorageEngine: "42000",
ErrTruncatedWrongValue: "22007",
ErrSpNoRecursiveCreate: "2F003",
ErrSpAlreadyExists: "42000",
ErrSpDoesNotExist: "42000",
ErrSpLilabelMismatch: "42000",
ErrSpLabelRedefine: "42000",
ErrSpLabelMismatch: "42000",
ErrSpUninitVar: "01000",
ErrSpBadselect: "0A000",
ErrSpBadreturn: "42000",
ErrSpBadstatement: "0A000",
ErrUpdateLogDeprecatedIgnored: "42000",
ErrUpdateLogDeprecatedTranslated: "42000",
ErrQueryInterrupted: "70100",
ErrSpWrongNoOfArgs: "42000",
ErrSpCondMismatch: "42000",
ErrSpNoreturn: "42000",
ErrSpNoreturnend: "2F005",
ErrSpBadCursorQuery: "42000",
ErrSpBadCursorSelect: "42000",
ErrSpCursorMismatch: "42000",
ErrSpCursorAlreadyOpen: "24000",
ErrSpCursorNotOpen: "24000",
ErrSpUndeclaredVar: "42000",
ErrSpFetchNoData: "02000",
ErrSpDupParam: "42000",
ErrSpDupVar: "42000",
ErrSpDupCond: "42000",
ErrSpDupCurs: "42000",
ErrSpSubselectNyi: "0A000",
ErrStmtNotAllowedInSfOrTrg: "0A000",
ErrSpVarcondAfterCurshndlr: "42000",
ErrSpCursorAfterHandler: "42000",
ErrSpCaseNotFound: "20000",
ErrDivisionByZero: "22012",
ErrIllegalValueForType: "22007",
ErrProcaccessDenied: "42000",
ErrXaerNota: "XAE04",
ErrXaerInval: "XAE05",
ErrXaerRmfail: "XAE07",
ErrXaerOutside: "XAE09",
ErrXaerRmerr: "XAE03",
ErrXaRbrollback: "XA100",
ErrNonexistingProcGrant: "42000",
ErrDataTooLong: "22001",
ErrSpBadSQLstate: "42000",
ErrCantCreateUserWithGrant: "42000",
ErrSpDupHandler: "42000",
ErrSpNotVarArg: "42000",
ErrSpNoRetset: "0A000",
ErrCantCreateGeometryObject: "22003",
ErrTooBigScale: "42000",
ErrTooBigPrecision: "42000",
ErrMBiggerThanD: "42000",
ErrTooLongBody: "42000",
ErrTooBigDisplaywidth: "42000",
ErrXaerDupid: "XAE08",
ErrDatetimeFunctionOverflow: "22008",
ErrRowIsReferenced2: "23000",
ErrNoReferencedRow2: "23000",
ErrSpBadVarShadow: "42000",
ErrSpWrongName: "42000",
ErrSpNoAggregate: "42000",
ErrMaxPreparedStmtCountReached: "42000",
ErrNonGroupingFieldUsed: "42000",
ErrForeignDuplicateKeyOldUnused: "23000",
ErrCantChangeTxCharacteristics: "25001",
ErrWrongParamcountToNativeFct: "42000",
ErrWrongParametersToNativeFct: "42000",
ErrWrongParametersToStoredFct: "42000",
ErrDupEntryWithKeyName: "23000",
ErrXaRbtimeout: "XA106",
ErrXaRbdeadlock: "XA102",
ErrFuncInexistentNameCollision: "42000",
ErrDupSignalSet: "42000",
ErrSignalWarn: "01000",
ErrSignalNotFound: "02000",
ErrSignalException: "HY000",
ErrResignalWithoutActiveHandler: "0K000",
ErrSpatialMustHaveGeomCol: "42000",
ErrDataOutOfRange: "22003",
ErrAccessDeniedNoPassword: "28000",
ErrTruncateIllegalFk: "42000",
ErrDaInvalidConditionNumber: "35000",
ErrForeignDuplicateKeyWithChildInfo: "23000",
ErrForeignDuplicateKeyWithoutChildInfo: "23000",
ErrCantExecuteInReadOnlyTransaction: "25006",
ErrAlterOperationNotSupported: "0A000",
ErrAlterOperationNotSupportedReason: "0A000",
ErrDupUnknownInIndex: "23000",
}

1422
vendor/github.com/pingcap/tidb/mysql/time.go generated vendored Normal file

File diff suppressed because it is too large Load diff

144
vendor/github.com/pingcap/tidb/mysql/type.go generated vendored Normal file
View file

@ -0,0 +1,144 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// MySQL type informations.
const (
TypeDecimal byte = iota
TypeTiny
TypeShort
TypeLong
TypeFloat
TypeDouble
TypeNull
TypeTimestamp
TypeLonglong
TypeInt24
TypeDate
TypeDuration /* Original name was TypeTime, renamed to Duration to resolve the conflict with Go type Time.*/
TypeDatetime
TypeYear
TypeNewDate
TypeVarchar
TypeBit
)
// TypeUnspecified is an uninitialized type. TypeDecimal is not used in MySQL.
var TypeUnspecified = TypeDecimal
// MySQL type informations.
const (
TypeNewDecimal byte = iota + 0xf6
TypeEnum
TypeSet
TypeTinyBlob
TypeMediumBlob
TypeLongBlob
TypeBlob
TypeVarString
TypeString
TypeGeometry
)
// IsUninitializedType check if a type code is uninitialized.
// TypeDecimal is the old type code for decimal and not be used in the new mysql version.
func IsUninitializedType(tp byte) bool {
return tp == TypeDecimal
}
// Flag informations.
const (
NotNullFlag = 1 /* Field can't be NULL */
PriKeyFlag = 2 /* Field is part of a primary key */
UniqueKeyFlag = 4 /* Field is part of a unique key */
MultipleKeyFlag = 8 /* Field is part of a key */
BlobFlag = 16 /* Field is a blob */
UnsignedFlag = 32 /* Field is unsigned */
ZerofillFlag = 64 /* Field is zerofill */
BinaryFlag = 128 /* Field is binary */
EnumFlag = 256 /* Field is an enum */
AutoIncrementFlag = 512 /* Field is an auto increment field */
TimestampFlag = 1024 /* Field is a timestamp */
SetFlag = 2048 /* Field is a set */
NoDefaultValueFlag = 4096 /* Field doesn't have a default value */
OnUpdateNowFlag = 8192 /* Field is set to NOW on UPDATE */
NumFlag = 32768 /* Field is a num (for clients) */
PartKeyFlag = 16384 /* Intern: Part of some keys */
GroupFlag = 32768 /* Intern: Group field */
UniqueFlag = 65536 /* Intern: Used by sql_yacc */
BinCmpFlag = 131072 /* Intern: Used by sql_yacc */
)
// TypeInt24 bounds.
const (
MaxUint24 = 1<<24 - 1
MaxInt24 = 1<<23 - 1
MinInt24 = -1 << 23
)
// HasNotNullFlag checks if NotNullFlag is set.
func HasNotNullFlag(flag uint) bool {
return (flag & NotNullFlag) > 0
}
// HasNoDefaultValueFlag checks if NoDefaultValueFlag is set.
func HasNoDefaultValueFlag(flag uint) bool {
return (flag & NoDefaultValueFlag) > 0
}
// HasAutoIncrementFlag checks if AutoIncrementFlag is set.
func HasAutoIncrementFlag(flag uint) bool {
return (flag & AutoIncrementFlag) > 0
}
// HasUnsignedFlag checks if UnsignedFlag is set.
func HasUnsignedFlag(flag uint) bool {
return (flag & UnsignedFlag) > 0
}
// HasZerofillFlag checks if ZerofillFlag is set.
func HasZerofillFlag(flag uint) bool {
return (flag & ZerofillFlag) > 0
}
// HasBinaryFlag checks if BinaryFlag is set.
func HasBinaryFlag(flag uint) bool {
return (flag & BinaryFlag) > 0
}
// HasPriKeyFlag checks if PriKeyFlag is set.
func HasPriKeyFlag(flag uint) bool {
return (flag & PriKeyFlag) > 0
}
// HasUniKeyFlag checks if UniqueKeyFlag is set.
func HasUniKeyFlag(flag uint) bool {
return (flag & UniqueKeyFlag) > 0
}
// HasMultipleKeyFlag checks if MultipleKeyFlag is set.
func HasMultipleKeyFlag(flag uint) bool {
return (flag & MultipleKeyFlag) > 0
}
// HasTimestampFlag checks if HasTimestampFlag is set.
func HasTimestampFlag(flag uint) bool {
return (flag & TimestampFlag) > 0
}
// HasOnUpdateNowFlag checks if OnUpdateNowFlag is set.
func HasOnUpdateNowFlag(flag uint) bool {
return (flag & OnUpdateNowFlag) > 0
}

54
vendor/github.com/pingcap/tidb/mysql/util.go generated vendored Normal file
View file

@ -0,0 +1,54 @@
// Copyright 2015 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.
package mysql
// GetDefaultFieldLength is used for Interger Types, Flen is the display length.
// Call this when no Flen assigned in ddl.
// or column value is calculated from an expression.
// For example: "select count(*) from t;", the column type is int64 and Flen in ResultField will be 21.
// See: https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
func GetDefaultFieldLength(tp byte) int {
switch tp {
case TypeTiny:
return 4
case TypeShort:
return 6
case TypeInt24:
return 9
case TypeLong:
return 11
case TypeLonglong:
return 21
case TypeDecimal:
// See: https://dev.mysql.com/doc/refman/5.7/en/fixed-point-types.html
return 10
case TypeBit, TypeBlob:
return -1
default:
//TODO: add more types
return -1
}
}
// GetDefaultDecimal returns the default decimal length for column.
func GetDefaultDecimal(tp byte) int {
switch tp {
case TypeDecimal:
// See: https://dev.mysql.com/doc/refman/5.7/en/fixed-point-types.html
return 0
default:
//TODO: add more types
return -1
}
}