errors.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. package mysql
  2. import (
  3. "fmt"
  4. )
  5. // Error is a mymysql error.
  6. // If a function/method returns error you may check the returned error type via
  7. // a type assertion. If the type assertion succeeds you can retrieve the MySQL
  8. // error code as below.
  9. //
  10. // Example:
  11. // if val, ok := err.(*mysql.Error); ok {
  12. // fmt.Println(val.Code)
  13. // }
  14. type Error struct {
  15. Code uint16
  16. Msg []byte
  17. }
  18. func (err Error) Error() string {
  19. return fmt.Sprintf("Received #%d error from MySQL server: \"%s\"",
  20. err.Code, err.Msg)
  21. }
  22. // MySQL error codes.
  23. const (
  24. ER_HASHCHK = 1000
  25. ER_NISAMCHK = 1001
  26. ER_NO = 1002
  27. ER_YES = 1003
  28. ER_CANT_CREATE_FILE = 1004
  29. ER_CANT_CREATE_TABLE = 1005
  30. ER_CANT_CREATE_DB = 1006
  31. ER_DB_CREATE_EXISTS = 1007
  32. ER_DB_DROP_EXISTS = 1008
  33. ER_DB_DROP_DELETE = 1009
  34. ER_DB_DROP_RMDIR = 1010
  35. ER_CANT_DELETE_FILE = 1011
  36. ER_CANT_FIND_SYSTEM_REC = 1012
  37. ER_CANT_GET_STAT = 1013
  38. ER_CANT_GET_WD = 1014
  39. ER_CANT_LOCK = 1015
  40. ER_CANT_OPEN_FILE = 1016
  41. ER_FILE_NOT_FOUND = 1017
  42. ER_CANT_READ_DIR = 1018
  43. ER_CANT_SET_WD = 1019
  44. ER_CHECKREAD = 1020
  45. ER_DISK_FULL = 1021
  46. ER_DUP_KEY = 1022
  47. ER_ERROR_ON_CLOSE = 1023
  48. ER_ERROR_ON_READ = 1024
  49. ER_ERROR_ON_RENAME = 1025
  50. ER_ERROR_ON_WRITE = 1026
  51. ER_FILE_USED = 1027
  52. ER_FILSORT_ABORT = 1028
  53. ER_FORM_NOT_FOUND = 1029
  54. ER_GET_ERRNO = 1030
  55. ER_ILLEGAL_HA = 1031
  56. ER_KEY_NOT_FOUND = 1032
  57. ER_NOT_FORM_FILE = 1033
  58. ER_NOT_KEYFILE = 1034
  59. ER_OLD_KEYFILE = 1035
  60. ER_OPEN_AS_READONLY = 1036
  61. ER_OUTOFMEMORY = 1037
  62. ER_OUT_OF_SORTMEMORY = 1038
  63. ER_UNEXPECTED_EOF = 1039
  64. ER_CON_COUNT_ERROR = 1040
  65. ER_OUT_OF_RESOURCES = 1041
  66. ER_BAD_HOST_ERROR = 1042
  67. ER_HANDSHAKE_ERROR = 1043
  68. ER_DBACCESS_DENIED_ERROR = 1044
  69. ER_ACCESS_DENIED_ERROR = 1045
  70. ER_NO_DB_ERROR = 1046
  71. ER_UNKNOWN_COM_ERROR = 1047
  72. ER_BAD_NULL_ERROR = 1048
  73. ER_BAD_DB_ERROR = 1049
  74. ER_TABLE_EXISTS_ERROR = 1050
  75. ER_BAD_TABLE_ERROR = 1051
  76. ER_NON_UNIQ_ERROR = 1052
  77. ER_SERVER_SHUTDOWN = 1053
  78. ER_BAD_FIELD_ERROR = 1054
  79. ER_WRONG_FIELD_WITH_GROUP = 1055
  80. ER_WRONG_GROUP_FIELD = 1056
  81. ER_WRONG_SUM_SELECT = 1057
  82. ER_WRONG_VALUE_COUNT = 1058
  83. ER_TOO_LONG_IDENT = 1059
  84. ER_DUP_FIELDNAME = 1060
  85. ER_DUP_KEYNAME = 1061
  86. ER_DUP_ENTRY = 1062
  87. ER_WRONG_FIELD_SPEC = 1063
  88. ER_PARSE_ERROR = 1064
  89. ER_EMPTY_QUERY = 1065
  90. ER_NONUNIQ_TABLE = 1066
  91. ER_INVALID_DEFAULT = 1067
  92. ER_MULTIPLE_PRI_KEY = 1068
  93. ER_TOO_MANY_KEYS = 1069
  94. ER_TOO_MANY_KEY_PARTS = 1070
  95. ER_TOO_LONG_KEY = 1071
  96. ER_KEY_COLUMN_DOES_NOT_EXITS = 1072
  97. ER_BLOB_USED_AS_KEY = 1073
  98. ER_TOO_BIG_FIELDLENGTH = 1074
  99. ER_WRONG_AUTO_KEY = 1075
  100. ER_READY = 1076
  101. ER_NORMAL_SHUTDOWN = 1077
  102. ER_GOT_SIGNAL = 1078
  103. ER_SHUTDOWN_COMPLETE = 1079
  104. ER_FORCING_CLOSE = 1080
  105. ER_IPSOCK_ERROR = 1081
  106. ER_NO_SUCH_INDEX = 1082
  107. ER_WRONG_FIELD_TERMINATORS = 1083
  108. ER_BLOBS_AND_NO_TERMINATED = 1084
  109. ER_TEXTFILE_NOT_READABLE = 1085
  110. ER_FILE_EXISTS_ERROR = 1086
  111. ER_LOAD_INFO = 1087
  112. ER_ALTER_INFO = 1088
  113. ER_WRONG_SUB_KEY = 1089
  114. ER_CANT_REMOVE_ALL_FIELDS = 1090
  115. ER_CANT_DROP_FIELD_OR_KEY = 1091
  116. ER_INSERT_INFO = 1092
  117. ER_UPDATE_TABLE_USED = 1093
  118. ER_NO_SUCH_THREAD = 1094
  119. ER_KILL_DENIED_ERROR = 1095
  120. ER_NO_TABLES_USED = 1096
  121. ER_TOO_BIG_SET = 1097
  122. ER_NO_UNIQUE_LOGFILE = 1098
  123. ER_TABLE_NOT_LOCKED_FOR_WRITE = 1099
  124. ER_TABLE_NOT_LOCKED = 1100
  125. ER_BLOB_CANT_HAVE_DEFAULT = 1101
  126. ER_WRONG_DB_NAME = 1102
  127. ER_WRONG_TABLE_NAME = 1103
  128. ER_TOO_BIG_SELECT = 1104
  129. ER_UNKNOWN_ERROR = 1105
  130. ER_UNKNOWN_PROCEDURE = 1106
  131. ER_WRONG_PARAMCOUNT_TO_PROCEDURE = 1107
  132. ER_WRONG_PARAMETERS_TO_PROCEDURE = 1108
  133. ER_UNKNOWN_TABLE = 1109
  134. ER_FIELD_SPECIFIED_TWICE = 1110
  135. ER_INVALID_GROUP_FUNC_USE = 1111
  136. ER_UNSUPPORTED_EXTENSION = 1112
  137. ER_TABLE_MUST_HAVE_COLUMNS = 1113
  138. ER_RECORD_FILE_FULL = 1114
  139. ER_UNKNOWN_CHARACTER_SET = 1115
  140. ER_TOO_MANY_TABLES = 1116
  141. ER_TOO_MANY_FIELDS = 1117
  142. ER_TOO_BIG_ROWSIZE = 1118
  143. ER_STACK_OVERRUN = 1119
  144. ER_WRONG_OUTER_JOIN = 1120
  145. ER_NULL_COLUMN_IN_INDEX = 1121
  146. ER_CANT_FIND_UDF = 1122
  147. ER_CANT_INITIALIZE_UDF = 1123
  148. ER_UDF_NO_PATHS = 1124
  149. ER_UDF_EXISTS = 1125
  150. ER_CANT_OPEN_LIBRARY = 1126
  151. ER_CANT_FIND_DL_ENTRY = 1127
  152. ER_FUNCTION_NOT_DEFINED = 1128
  153. ER_HOST_IS_BLOCKED = 1129
  154. ER_HOST_NOT_PRIVILEGED = 1130
  155. ER_PASSWORD_ANONYMOUS_USER = 1131
  156. ER_PASSWORD_NOT_ALLOWED = 1132
  157. ER_PASSWORD_NO_MATCH = 1133
  158. ER_UPDATE_INFO = 1134
  159. ER_CANT_CREATE_THREAD = 1135
  160. ER_WRONG_VALUE_COUNT_ON_ROW = 1136
  161. ER_CANT_REOPEN_TABLE = 1137
  162. ER_INVALID_USE_OF_NULL = 1138
  163. ER_REGEXP_ERROR = 1139
  164. ER_MIX_OF_GROUP_FUNC_AND_FIELDS = 1140
  165. ER_NONEXISTING_GRANT = 1141
  166. ER_TABLEACCESS_DENIED_ERROR = 1142
  167. ER_COLUMNACCESS_DENIED_ERROR = 1143
  168. ER_ILLEGAL_GRANT_FOR_TABLE = 1144
  169. ER_GRANT_WRONG_HOST_OR_USER = 1145
  170. ER_NO_SUCH_TABLE = 1146
  171. ER_NONEXISTING_TABLE_GRANT = 1147
  172. ER_NOT_ALLOWED_COMMAND = 1148
  173. ER_SYNTAX_ERROR = 1149
  174. ER_DELAYED_CANT_CHANGE_LOCK = 1150
  175. ER_TOO_MANY_DELAYED_THREADS = 1151
  176. ER_ABORTING_CONNECTION = 1152
  177. ER_NET_PACKET_TOO_LARGE = 1153
  178. ER_NET_READ_ERROR_FROM_PIPE = 1154
  179. ER_NET_FCNTL_ERROR = 1155
  180. ER_NET_PACKETS_OUT_OF_ORDER = 1156
  181. ER_NET_UNCOMPRESS_ERROR = 1157
  182. ER_NET_READ_ERROR = 1158
  183. ER_NET_READ_INTERRUPTED = 1159
  184. ER_NET_ERROR_ON_WRITE = 1160
  185. ER_NET_WRITE_INTERRUPTED = 1161
  186. ER_TOO_LONG_STRING = 1162
  187. ER_TABLE_CANT_HANDLE_BLOB = 1163
  188. ER_TABLE_CANT_HANDLE_AUTO_INCREMENT = 1164
  189. ER_DELAYED_INSERT_TABLE_LOCKED = 1165
  190. ER_WRONG_COLUMN_NAME = 1166
  191. ER_WRONG_KEY_COLUMN = 1167
  192. ER_WRONG_MRG_TABLE = 1168
  193. ER_DUP_UNIQUE = 1169
  194. ER_BLOB_KEY_WITHOUT_LENGTH = 1170
  195. ER_PRIMARY_CANT_HAVE_NULL = 1171
  196. ER_TOO_MANY_ROWS = 1172
  197. ER_REQUIRES_PRIMARY_KEY = 1173
  198. ER_NO_RAID_COMPILED = 1174
  199. ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE = 1175
  200. ER_KEY_DOES_NOT_EXITS = 1176
  201. ER_CHECK_NO_SUCH_TABLE = 1177
  202. ER_CHECK_NOT_IMPLEMENTED = 1178
  203. ER_CANT_DO_THIS_DURING_AN_TRANSACTION = 1179
  204. ER_ERROR_DURING_COMMIT = 1180
  205. ER_ERROR_DURING_ROLLBACK = 1181
  206. ER_ERROR_DURING_FLUSH_LOGS = 1182
  207. ER_ERROR_DURING_CHECKPOINT = 1183
  208. ER_NEW_ABORTING_CONNECTION = 1184
  209. ER_DUMP_NOT_IMPLEMENTED = 1185
  210. ER_FLUSH_MASTER_BINLOG_CLOSED = 1186
  211. ER_INDEX_REBUILD = 1187
  212. ER_MASTER = 1188
  213. ER_MASTER_NET_READ = 1189
  214. ER_MASTER_NET_WRITE = 1190
  215. ER_FT_MATCHING_KEY_NOT_FOUND = 1191
  216. ER_LOCK_OR_ACTIVE_TRANSACTION = 1192
  217. ER_UNKNOWN_SYSTEM_VARIABLE = 1193
  218. ER_CRASHED_ON_USAGE = 1194
  219. ER_CRASHED_ON_REPAIR = 1195
  220. ER_WARNING_NOT_COMPLETE_ROLLBACK = 1196
  221. ER_TRANS_CACHE_FULL = 1197
  222. ER_SLAVE_MUST_STOP = 1198
  223. ER_SLAVE_NOT_RUNNING = 1199
  224. ER_BAD_SLAVE = 1200
  225. ER_MASTER_INFO = 1201
  226. ER_SLAVE_THREAD = 1202
  227. ER_TOO_MANY_USER_CONNECTIONS = 1203
  228. ER_SET_CONSTANTS_ONLY = 1204
  229. ER_LOCK_WAIT_TIMEOUT = 1205
  230. ER_LOCK_TABLE_FULL = 1206
  231. ER_READ_ONLY_TRANSACTION = 1207
  232. ER_DROP_DB_WITH_READ_LOCK = 1208
  233. ER_CREATE_DB_WITH_READ_LOCK = 1209
  234. ER_WRONG_ARGUMENTS = 1210
  235. ER_NO_PERMISSION_TO_CREATE_USER = 1211
  236. ER_UNION_TABLES_IN_DIFFERENT_DIR = 1212
  237. ER_LOCK_DEADLOCK = 1213
  238. ER_TABLE_CANT_HANDLE_FT = 1214
  239. ER_CANNOT_ADD_FOREIGN = 1215
  240. ER_NO_REFERENCED_ROW = 1216
  241. ER_ROW_IS_REFERENCED = 1217
  242. ER_CONNECT_TO_MASTER = 1218
  243. ER_QUERY_ON_MASTER = 1219
  244. ER_ERROR_WHEN_EXECUTING_COMMAND = 1220
  245. ER_WRONG_USAGE = 1221
  246. ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT = 1222
  247. ER_CANT_UPDATE_WITH_READLOCK = 1223
  248. ER_MIXING_NOT_ALLOWED = 1224
  249. ER_DUP_ARGUMENT = 1225
  250. ER_USER_LIMIT_REACHED = 1226
  251. ER_SPECIFIC_ACCESS_DENIED_ERROR = 1227
  252. ER_LOCAL_VARIABLE = 1228
  253. ER_GLOBAL_VARIABLE = 1229
  254. ER_NO_DEFAULT = 1230
  255. ER_WRONG_VALUE_FOR_VAR = 1231
  256. ER_WRONG_TYPE_FOR_VAR = 1232
  257. ER_VAR_CANT_BE_READ = 1233
  258. ER_CANT_USE_OPTION_HERE = 1234
  259. ER_NOT_SUPPORTED_YET = 1235
  260. ER_MASTER_FATAL_ERROR_READING_BINLOG = 1236
  261. ER_SLAVE_IGNORED_TABLE = 1237
  262. ER_INCORRECT_GLOBAL_LOCAL_VAR = 1238
  263. ER_WRONG_FK_DEF = 1239
  264. ER_KEY_REF_DO_NOT_MATCH_TABLE_REF = 1240
  265. ER_OPERAND_COLUMNS = 1241
  266. ER_SUBQUERY_NO_1_ROW = 1242
  267. ER_UNKNOWN_STMT_HANDLER = 1243
  268. ER_CORRUPT_HELP_DB = 1244
  269. ER_CYCLIC_REFERENCE = 1245
  270. ER_AUTO_CONVERT = 1246
  271. ER_ILLEGAL_REFERENCE = 1247
  272. ER_DERIVED_MUST_HAVE_ALIAS = 1248
  273. ER_SELECT_REDUCED = 1249
  274. ER_TABLENAME_NOT_ALLOWED_HERE = 1250
  275. ER_NOT_SUPPORTED_AUTH_MODE = 1251
  276. ER_SPATIAL_CANT_HAVE_NULL = 1252
  277. ER_COLLATION_CHARSET_MISMATCH = 1253
  278. ER_SLAVE_WAS_RUNNING = 1254
  279. ER_SLAVE_WAS_NOT_RUNNING = 1255
  280. ER_TOO_BIG_FOR_UNCOMPRESS = 1256
  281. ER_ZLIB_Z_MEM_ERROR = 1257
  282. ER_ZLIB_Z_BUF_ERROR = 1258
  283. ER_ZLIB_Z_DATA_ERROR = 1259
  284. ER_CUT_VALUE_GROUP_CONCAT = 1260
  285. ER_WARN_TOO_FEW_RECORDS = 1261
  286. ER_WARN_TOO_MANY_RECORDS = 1262
  287. ER_WARN_NULL_TO_NOTNULL = 1263
  288. ER_WARN_DATA_OUT_OF_RANGE = 1264
  289. WARN_DATA_TRUNCATED = 1265
  290. ER_WARN_USING_OTHER_HANDLER = 1266
  291. ER_CANT_AGGREGATE_2COLLATIONS = 1267
  292. ER_DROP_USER = 1268
  293. ER_REVOKE_GRANTS = 1269
  294. ER_CANT_AGGREGATE_3COLLATIONS = 1270
  295. ER_CANT_AGGREGATE_NCOLLATIONS = 1271
  296. ER_VARIABLE_IS_NOT_STRUCT = 1272
  297. ER_UNKNOWN_COLLATION = 1273
  298. ER_SLAVE_IGNORED_SSL_PARAMS = 1274
  299. ER_SERVER_IS_IN_SECURE_AUTH_MODE = 1275
  300. ER_WARN_FIELD_RESOLVED = 1276
  301. ER_BAD_SLAVE_UNTIL_COND = 1277
  302. ER_MISSING_SKIP_SLAVE = 1278
  303. ER_UNTIL_COND_IGNORED = 1279
  304. ER_WRONG_NAME_FOR_INDEX = 1280
  305. ER_WRONG_NAME_FOR_CATALOG = 1281
  306. ER_WARN_QC_RESIZE = 1282
  307. ER_BAD_FT_COLUMN = 1283
  308. ER_UNKNOWN_KEY_CACHE = 1284
  309. ER_WARN_HOSTNAME_WONT_WORK = 1285
  310. ER_UNKNOWN_STORAGE_ENGINE = 1286
  311. ER_WARN_DEPRECATED_SYNTAX = 1287
  312. ER_NON_UPDATABLE_TABLE = 1288
  313. ER_FEATURE_DISABLED = 1289
  314. ER_OPTION_PREVENTS_STATEMENT = 1290
  315. ER_DUPLICATED_VALUE_IN_TYPE = 1291
  316. ER_TRUNCATED_WRONG_VALUE = 1292
  317. ER_TOO_MUCH_AUTO_TIMESTAMP_COLS = 1293
  318. ER_INVALID_ON_UPDATE = 1294
  319. ER_UNSUPPORTED_PS = 1295
  320. ER_GET_ERRMSG = 1296
  321. ER_GET_TEMPORARY_ERRMSG = 1297
  322. ER_UNKNOWN_TIME_ZONE = 1298
  323. ER_WARN_INVALID_TIMESTAMP = 1299
  324. ER_INVALID_CHARACTER_STRING = 1300
  325. ER_WARN_ALLOWED_PACKET_OVERFLOWED = 1301
  326. ER_CONFLICTING_DECLARATIONS = 1302
  327. ER_SP_NO_RECURSIVE_CREATE = 1303
  328. ER_SP_ALREADY_EXISTS = 1304
  329. ER_SP_DOES_NOT_EXIST = 1305
  330. ER_SP_DROP_FAILED = 1306
  331. ER_SP_STORE_FAILED = 1307
  332. ER_SP_LILABEL_MISMATCH = 1308
  333. ER_SP_LABEL_REDEFINE = 1309
  334. ER_SP_LABEL_MISMATCH = 1310
  335. ER_SP_UNINIT_VAR = 1311
  336. ER_SP_BADSELECT = 1312
  337. ER_SP_BADRETURN = 1313
  338. ER_SP_BADSTATEMENT = 1314
  339. ER_UPDATE_LOG_DEPRECATED_IGNORED = 1315
  340. ER_UPDATE_LOG_DEPRECATED_TRANSLATED = 1316
  341. ER_QUERY_INTERRUPTED = 1317
  342. ER_SP_WRONG_NO_OF_ARGS = 1318
  343. ER_SP_COND_MISMATCH = 1319
  344. ER_SP_NORETURN = 1320
  345. ER_SP_NORETURNEND = 1321
  346. ER_SP_BAD_CURSOR_QUERY = 1322
  347. ER_SP_BAD_CURSOR_SELECT = 1323
  348. ER_SP_CURSOR_MISMATCH = 1324
  349. ER_SP_CURSOR_ALREADY_OPEN = 1325
  350. ER_SP_CURSOR_NOT_OPEN = 1326
  351. ER_SP_UNDECLARED_VAR = 1327
  352. ER_SP_WRONG_NO_OF_FETCH_ARGS = 1328
  353. ER_SP_FETCH_NO_DATA = 1329
  354. ER_SP_DUP_PARAM = 1330
  355. ER_SP_DUP_VAR = 1331
  356. ER_SP_DUP_COND = 1332
  357. ER_SP_DUP_CURS = 1333
  358. ER_SP_CANT_ALTER = 1334
  359. ER_SP_SUBSELECT_NYI = 1335
  360. ER_STMT_NOT_ALLOWED_IN_SF_OR_TRG = 1336
  361. ER_SP_VARCOND_AFTER_CURSHNDLR = 1337
  362. ER_SP_CURSOR_AFTER_HANDLER = 1338
  363. ER_SP_CASE_NOT_FOUND = 1339
  364. ER_FPARSER_TOO_BIG_FILE = 1340
  365. ER_FPARSER_BAD_HEADER = 1341
  366. ER_FPARSER_EOF_IN_COMMENT = 1342
  367. ER_FPARSER_ERROR_IN_PARAMETER = 1343
  368. ER_FPARSER_EOF_IN_UNKNOWN_PARAMETER = 1344
  369. ER_VIEW_NO_EXPLAIN = 1345
  370. ER_FRM_UNKNOWN_TYPE = 1346
  371. ER_WRONG_OBJECT = 1347
  372. ER_NONUPDATEABLE_COLUMN = 1348
  373. ER_VIEW_SELECT_DERIVED = 1349
  374. ER_VIEW_SELECT_CLAUSE = 1350
  375. ER_VIEW_SELECT_VARIABLE = 1351
  376. ER_VIEW_SELECT_TMPTABLE = 1352
  377. ER_VIEW_WRONG_LIST = 1353
  378. ER_WARN_VIEW_MERGE = 1354
  379. ER_WARN_VIEW_WITHOUT_KEY = 1355
  380. ER_VIEW_INVALID = 1356
  381. ER_SP_NO_DROP_SP = 1357
  382. ER_SP_GOTO_IN_HNDLR = 1358
  383. ER_TRG_ALREADY_EXISTS = 1359
  384. ER_TRG_DOES_NOT_EXIST = 1360
  385. ER_TRG_ON_VIEW_OR_TEMP_TABLE = 1361
  386. ER_TRG_CANT_CHANGE_ROW = 1362
  387. ER_TRG_NO_SUCH_ROW_IN_TRG = 1363
  388. ER_NO_DEFAULT_FOR_FIELD = 1364
  389. ER_DIVISION_BY_ZERO = 1365
  390. ER_TRUNCATED_WRONG_VALUE_FOR_FIELD = 1366
  391. ER_ILLEGAL_VALUE_FOR_TYPE = 1367
  392. ER_VIEW_NONUPD_CHECK = 1368
  393. ER_VIEW_CHECK_FAILED = 1369
  394. ER_PROCACCESS_DENIED_ERROR = 1370
  395. ER_RELAY_LOG_FAIL = 1371
  396. ER_PASSWD_LENGTH = 1372
  397. ER_UNKNOWN_TARGET_BINLOG = 1373
  398. ER_IO_ERR_LOG_INDEX_READ = 1374
  399. ER_BINLOG_PURGE_PROHIBITED = 1375
  400. ER_FSEEK_FAIL = 1376
  401. ER_BINLOG_PURGE_FATAL_ERR = 1377
  402. ER_LOG_IN_USE = 1378
  403. ER_LOG_PURGE_UNKNOWN_ERR = 1379
  404. ER_RELAY_LOG_INIT = 1380
  405. ER_NO_BINARY_LOGGING = 1381
  406. ER_RESERVED_SYNTAX = 1382
  407. ER_WSAS_FAILED = 1383
  408. ER_DIFF_GROUPS_PROC = 1384
  409. ER_NO_GROUP_FOR_PROC = 1385
  410. ER_ORDER_WITH_PROC = 1386
  411. ER_LOGGING_PROHIBIT_CHANGING_OF = 1387
  412. ER_NO_FILE_MAPPING = 1388
  413. ER_WRONG_MAGIC = 1389
  414. ER_PS_MANY_PARAM = 1390
  415. ER_KEY_PART_0 = 1391
  416. ER_VIEW_CHECKSUM = 1392
  417. ER_VIEW_MULTIUPDATE = 1393
  418. ER_VIEW_NO_INSERT_FIELD_LIST = 1394
  419. ER_VIEW_DELETE_MERGE_VIEW = 1395
  420. ER_CANNOT_USER = 1396
  421. ER_XAER_NOTA = 1397
  422. ER_XAER_INVAL = 1398
  423. ER_XAER_RMFAIL = 1399
  424. ER_XAER_OUTSIDE = 1400
  425. ER_XAER_RMERR = 1401
  426. ER_XA_RBROLLBACK = 1402
  427. ER_NONEXISTING_PROC_GRANT = 1403
  428. ER_PROC_AUTO_GRANT_FAIL = 1404
  429. ER_PROC_AUTO_REVOKE_FAIL = 1405
  430. ER_DATA_TOO_LONG = 1406
  431. ER_SP_BAD_SQLSTATE = 1407
  432. ER_STARTUP = 1408
  433. ER_LOAD_FROM_FIXED_SIZE_ROWS_TO_VAR = 1409
  434. ER_CANT_CREATE_USER_WITH_GRANT = 1410
  435. ER_WRONG_VALUE_FOR_TYPE = 1411
  436. ER_TABLE_DEF_CHANGED = 1412
  437. ER_SP_DUP_HANDLER = 1413
  438. ER_SP_NOT_VAR_ARG = 1414
  439. ER_SP_NO_RETSET = 1415
  440. ER_CANT_CREATE_GEOMETRY_OBJECT = 1416
  441. ER_FAILED_ROUTINE_BREAK_BINLOG = 1417
  442. ER_BINLOG_UNSAFE_ROUTINE = 1418
  443. ER_BINLOG_CREATE_ROUTINE_NEED_SUPER = 1419
  444. ER_EXEC_STMT_WITH_OPEN_CURSOR = 1420
  445. ER_STMT_HAS_NO_OPEN_CURSOR = 1421
  446. ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG = 1422
  447. ER_NO_DEFAULT_FOR_VIEW_FIELD = 1423
  448. ER_SP_NO_RECURSION = 1424
  449. ER_TOO_BIG_SCALE = 1425
  450. ER_TOO_BIG_PRECISION = 1426
  451. ER_M_BIGGER_THAN_D = 1427
  452. ER_WRONG_LOCK_OF_SYSTEM_TABLE = 1428
  453. ER_CONNECT_TO_FOREIGN_DATA_SOURCE = 1429
  454. ER_QUERY_ON_FOREIGN_DATA_SOURCE = 1430
  455. ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST = 1431
  456. ER_FOREIGN_DATA_STRING_INVALID_CANT_CREATE = 1432
  457. ER_FOREIGN_DATA_STRING_INVALID = 1433
  458. ER_CANT_CREATE_FEDERATED_TABLE = 1434
  459. ER_TRG_IN_WRONG_SCHEMA = 1435
  460. ER_STACK_OVERRUN_NEED_MORE = 1436
  461. ER_TOO_LONG_BODY = 1437
  462. ER_WARN_CANT_DROP_DEFAULT_KEYCACHE = 1438
  463. ER_TOO_BIG_DISPLAYWIDTH = 1439
  464. ER_XAER_DUPID = 1440
  465. ER_DATETIME_FUNCTION_OVERFLOW = 1441
  466. ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG = 1442
  467. ER_VIEW_PREVENT_UPDATE = 1443
  468. ER_PS_NO_RECURSION = 1444
  469. ER_SP_CANT_SET_AUTOCOMMIT = 1445
  470. ER_MALFORMED_DEFINER = 1446
  471. ER_VIEW_FRM_NO_USER = 1447
  472. ER_VIEW_OTHER_USER = 1448
  473. ER_NO_SUCH_USER = 1449
  474. ER_FORBID_SCHEMA_CHANGE = 1450
  475. ER_ROW_IS_REFERENCED_2 = 1451
  476. ER_NO_REFERENCED_ROW_2 = 1452
  477. ER_SP_BAD_VAR_SHADOW = 1453
  478. ER_TRG_NO_DEFINER = 1454
  479. ER_OLD_FILE_FORMAT = 1455
  480. ER_SP_RECURSION_LIMIT = 1456
  481. ER_SP_PROC_TABLE_CORRUPT = 1457
  482. ER_SP_WRONG_NAME = 1458
  483. ER_TABLE_NEEDS_UPGRADE = 1459
  484. ER_SP_NO_AGGREGATE = 1460
  485. ER_MAX_PREPARED_STMT_COUNT_REACHED = 1461
  486. ER_VIEW_RECURSIVE = 1462
  487. ER_NON_GROUPING_FIELD_USED = 1463
  488. ER_TABLE_CANT_HANDLE_SPKEYS = 1464
  489. ER_NO_TRIGGERS_ON_SYSTEM_SCHEMA = 1465
  490. ER_REMOVED_SPACES = 1466
  491. ER_AUTOINC_READ_FAILED = 1467
  492. ER_USERNAME = 1468
  493. ER_HOSTNAME = 1469
  494. ER_WRONG_STRING_LENGTH = 1470
  495. ER_NON_INSERTABLE_TABLE = 1471
  496. )
  497. // ClientError is a type for mymysql client errors.
  498. type ClientError string
  499. func (e ClientError) Error() string {
  500. return string(e)
  501. }
  502. var (
  503. ErrSeq = ClientError("packet sequence error")
  504. ErrPkt = ClientError("malformed packet")
  505. ErrPktLong = ClientError("packet too long")
  506. ErrUnexpNullLCS = ClientError("unexpected NULL LCS")
  507. ErrUnexpNullLCB = ClientError("unexpected NULL LCB")
  508. ErrUnexpNullDate = ClientError("unexpected NULL DATETIME")
  509. ErrUnexpNullTime = ClientError("unexpected NULL TIME")
  510. ErrUnkResultPkt = ClientError("unexpected or unknown result packet")
  511. ErrNotConn = ClientError("not connected")
  512. ErrAlredyConn = ClientError("already connected")
  513. ErrBadResult = ClientError("unexpected result")
  514. ErrUnreadedReply = ClientError("reply is not completely read")
  515. ErrBindCount = ClientError("wrong number of values for bind")
  516. ErrBindUnkType = ClientError("unknown value type for bind")
  517. ErrRowLength = ClientError("wrong length of row slice")
  518. ErrBadCommand = ClientError("comand isn't text SQL nor *Stmt")
  519. ErrWrongDateLen = ClientError("wrong datetime/timestamp length")
  520. ErrWrongTimeLen = ClientError("wrong time length")
  521. ErrUnkMySQLType = ClientError("unknown MySQL type")
  522. ErrWrongParamNum = ClientError("wrong parameter number")
  523. ErrUnkDataType = ClientError("unknown data source type")
  524. ErrSmallPktSize = ClientError("specified packet size is to small")
  525. ErrReadAfterEOR = ClientError("previous ScanRow call returned io.EOF")
  526. ErrOldProtocol = ClientError("server does not support 4.1 protocol")
  527. ErrAuthentication = ClientError("authentication error")
  528. )