github.com/searKing/golang/go@v1.2.117/database/mysql/error.go (about)

     1  // Copyright 2022 The searKing Author. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package mysql
     6  
     7  // Error codes for server-side errors.
     8  // Originally found in https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html
     9  // See above reference for more information on each code.
    10  const (
    11  	// unknown
    12  	ERUnknownError = 1105
    13  
    14  	// internal
    15  	ERInternalError = 1815
    16  
    17  	// unimplemented
    18  	ERNotSupportedYet = 1235
    19  	ERUnsupportedPS   = 1295
    20  
    21  	// resource exhausted
    22  	ERDiskFull               = 1021
    23  	EROutOfMemory            = 1037
    24  	EROutOfSortMemory        = 1038
    25  	ERConCount               = 1040
    26  	EROutOfResources         = 1041
    27  	ERRecordFileFull         = 1114
    28  	ERHostIsBlocked          = 1129
    29  	ERCantCreateThread       = 1135
    30  	ERTooManyDelayedThreads  = 1151
    31  	ERNetPacketTooLarge      = 1153
    32  	ERTooManyUserConnections = 1203
    33  	ERLockTableFull          = 1206
    34  	ERUserLimitReached       = 1226
    35  
    36  	// deadline exceeded
    37  	ERLockWaitTimeout = 1205
    38  
    39  	// unavailable
    40  	ERServerShutdown = 1053
    41  
    42  	// not found
    43  	ERCantFindFile          = 1017
    44  	ERFormNotFound          = 1029
    45  	ERKeyNotFound           = 1032
    46  	ERBadFieldError         = 1054
    47  	ERNoSuchThread          = 1094
    48  	ERUnknownTable          = 1109
    49  	ERCantFindUDF           = 1122
    50  	ERNonExistingGrant      = 1141
    51  	ERNoSuchTable           = 1146
    52  	ERNonExistingTableGrant = 1147
    53  	ERKeyDoesNotExist       = 1176
    54  	ERDbDropExists          = 1008
    55  
    56  	// permissions
    57  	ERDBAccessDenied            = 1044
    58  	ERAccessDeniedError         = 1045
    59  	ERKillDenied                = 1095
    60  	ERNoPermissionToCreateUsers = 1211
    61  	ERSpecifiedAccessDenied     = 1227
    62  
    63  	// failed precondition
    64  	ERNoDb                          = 1046
    65  	ERNoSuchIndex                   = 1082
    66  	ERCantDropFieldOrKey            = 1091
    67  	ERTableNotLockedForWrite        = 1099
    68  	ERTableNotLocked                = 1100
    69  	ERTooBigSelect                  = 1104
    70  	ERNotAllowedCommand             = 1148
    71  	ERTooLongString                 = 1162
    72  	ERDelayedInsertTableLocked      = 1165
    73  	ERDupUnique                     = 1169
    74  	ERRequiresPrimaryKey            = 1173
    75  	ERCantDoThisDuringAnTransaction = 1179
    76  	ERReadOnlyTransaction           = 1207
    77  	ERCannotAddForeign              = 1215
    78  	ERNoReferencedRow               = 1216
    79  	ERRowIsReferenced               = 1217
    80  	ERCantUpdateWithReadLock        = 1223
    81  	ERNoDefault                     = 1230
    82  	EROperandColumns                = 1241
    83  	ERSubqueryNo1Row                = 1242
    84  	ERWarnDataOutOfRange            = 1264
    85  	ERNonUpdateableTable            = 1288
    86  	ERFeatureDisabled               = 1289
    87  	EROptionPreventsStatement       = 1290
    88  	ERDuplicatedValueInType         = 1291
    89  	ERSPDoesNotExist                = 1305
    90  	ERRowIsReferenced2              = 1451
    91  	ErNoReferencedRow2              = 1452
    92  	ErSPNotVarArg                   = 1414
    93  	ERInnodbReadOnly                = 1874
    94  
    95  	// already exists
    96  	ERTableExists    = 1050
    97  	ERDupEntry       = 1062
    98  	ERFileExists     = 1086
    99  	ERUDFExists      = 1125
   100  	ERDbCreateExists = 1007
   101  
   102  	// aborted
   103  	ERGotSignal          = 1078
   104  	ERForcingClose       = 1080
   105  	ERAbortingConnection = 1152
   106  	ERLockDeadlock       = 1213
   107  
   108  	// invalid arg
   109  	ERUnknownComError              = 1047
   110  	ERBadNullError                 = 1048
   111  	ERBadDb                        = 1049
   112  	ERBadTable                     = 1051
   113  	ERNonUniq                      = 1052
   114  	ERWrongFieldWithGroup          = 1055
   115  	ERWrongGroupField              = 1056
   116  	ERWrongSumSelect               = 1057
   117  	ERWrongValueCount              = 1058
   118  	ERTooLongIdent                 = 1059
   119  	ERDupFieldName                 = 1060
   120  	ERDupKeyName                   = 1061
   121  	ERWrongFieldSpec               = 1063
   122  	ERParseError                   = 1064
   123  	EREmptyQuery                   = 1065
   124  	ERNonUniqTable                 = 1066
   125  	ERInvalidDefault               = 1067
   126  	ERMultiplePriKey               = 1068
   127  	ERTooManyKeys                  = 1069
   128  	ERTooManyKeyParts              = 1070
   129  	ERTooLongKey                   = 1071
   130  	ERKeyColumnDoesNotExist        = 1072
   131  	ERBlobUsedAsKey                = 1073
   132  	ERTooBigFieldLength            = 1074
   133  	ERWrongAutoKey                 = 1075
   134  	ERWrongFieldTerminators        = 1083
   135  	ERBlobsAndNoTerminated         = 1084
   136  	ERTextFileNotReadable          = 1085
   137  	ERWrongSubKey                  = 1089
   138  	ERCantRemoveAllFields          = 1090
   139  	ERUpdateTableUsed              = 1093
   140  	ERNoTablesUsed                 = 1096
   141  	ERTooBigSet                    = 1097
   142  	ERBlobCantHaveDefault          = 1101
   143  	ERWrongDbName                  = 1102
   144  	ERWrongTableName               = 1103
   145  	ERUnknownProcedure             = 1106
   146  	ERWrongParamCountToProcedure   = 1107
   147  	ERWrongParametersToProcedure   = 1108
   148  	ERFieldSpecifiedTwice          = 1110
   149  	ERInvalidGroupFuncUse          = 1111
   150  	ERTableMustHaveColumns         = 1113
   151  	ERUnknownCharacterSet          = 1115
   152  	ERTooManyTables                = 1116
   153  	ERTooManyFields                = 1117
   154  	ERTooBigRowSize                = 1118
   155  	ERWrongOuterJoin               = 1120
   156  	ERNullColumnInIndex            = 1121
   157  	ERFunctionNotDefined           = 1128
   158  	ERWrongValueCountOnRow         = 1136
   159  	ERInvalidUseOfNull             = 1138
   160  	ERRegexpError                  = 1139
   161  	ERMixOfGroupFuncAndFields      = 1140
   162  	ERIllegalGrantForTable         = 1144
   163  	ERSyntaxError                  = 1149
   164  	ERWrongColumnName              = 1166
   165  	ERWrongKeyColumn               = 1167
   166  	ERBlobKeyWithoutLength         = 1170
   167  	ERPrimaryCantHaveNull          = 1171
   168  	ERTooManyRows                  = 1172
   169  	ERLockOrActiveTransaction      = 1192
   170  	ERUnknownSystemVariable        = 1193
   171  	ERSetConstantsOnly             = 1204
   172  	ERWrongArguments               = 1210
   173  	ERWrongUsage                   = 1221
   174  	ERWrongNumberOfColumnsInSelect = 1222
   175  	ERDupArgument                  = 1225
   176  	ERLocalVariable                = 1228
   177  	ERGlobalVariable               = 1229
   178  	ERWrongValueForVar             = 1231
   179  	ERWrongTypeForVar              = 1232
   180  	ERVarCantBeRead                = 1233
   181  	ERCantUseOptionHere            = 1234
   182  	ERIncorrectGlobalLocalVar      = 1238
   183  	ERWrongFKDef                   = 1239
   184  	ERKeyRefDoNotMatchTableRef     = 1240
   185  	ERCyclicReference              = 1245
   186  	ERCollationCharsetMismatch     = 1253
   187  	ERCantAggregate2Collations     = 1267
   188  	ERCantAggregate3Collations     = 1270
   189  	ERCantAggregateNCollations     = 1271
   190  	ERVariableIsNotStruct          = 1272
   191  	ERUnknownCollation             = 1273
   192  	ERWrongNameForIndex            = 1280
   193  	ERWrongNameForCatalog          = 1281
   194  	ERBadFTColumn                  = 1283
   195  	ERTruncatedWrongValue          = 1292
   196  	ERTooMuchAutoTimestampCols     = 1293
   197  	ERInvalidOnUpdate              = 1294
   198  	ERUnknownTimeZone              = 1298
   199  	ERInvalidCharacterString       = 1300
   200  	ERIllegalReference             = 1247
   201  	ERDerivedMustHaveAlias         = 1248
   202  	ERTableNameNotAllowedHere      = 1250
   203  	ERQueryInterrupted             = 1317
   204  	ERTruncatedWrongValueForField  = 1366
   205  	ERDataTooLong                  = 1406
   206  	ERForbidSchemaChange           = 1450
   207  	ERDataOutOfRange               = 1690
   208  
   209  	// server not available
   210  	ERServerIsntAvailable = 3168
   211  )