📄 ndberror.c
字号:
{ 285, SE, "Unknown table error in transaction coordinator" }, { 881, SE, "Unable to create table, out of data pages (increase DataMemory) " }, { 906, SE, "Unsupported attribute type in index" }, { 907, SE, "Unsupported character set in table or index" }, { 908, IS, "Invalid ordered index tree node size" }, { 1225, SE, "Table not defined in local query handler" }, { 1226, SE, "Table is being dropped" }, { 1228, SE, "Cannot use drop table for drop index" }, { 1229, SE, "Too long frm data supplied" }, { 1231, SE, "Invalid table or index to scan" }, { 1232, SE, "Invalid table or index to scan" }, /** * FunctionNotImplemented */ { 4003, NI, "Function not implemented yet" }, /** * Backup error codes */ { 1300, IE, "Undefined error" }, { 1301, IE, "Backup issued to not master (reissue command to master)" }, { 1302, IE, "Out of backup record" }, { 1303, IS, "Out of resources" }, { 1304, IE, "Sequence failure" }, { 1305, IE, "Backup definition not implemented" }, { 1306, AE, "Backup not supported in diskless mode (change Diskless)" }, { 1321, IE, "Backup aborted by application" }, { 1322, IE, "Backup already completed" }, { 1323, IE, "1323" }, { 1324, IE, "Backup log buffer full" }, { 1325, IE, "File or scan error" }, { 1326, IE, "Backup abortet due to node failure" }, { 1327, IE, "1327" }, { 1340, IE, "Backup undefined error" }, { 1342, AE, "Backup failed to allocate buffers (check configuration)" }, { 1343, AE, "Backup failed to setup fs buffers (check configuration)" }, { 1344, AE, "Backup failed to allocate tables (check configuration)" }, { 1345, AE, "Backup failed to insert file header (check configuration)" }, { 1346, AE, "Backup failed to insert table list (check configuration)" }, { 1347, AE, "Backup failed to allocate table memory (check configuration)" }, { 1348, AE, "Backup failed to allocate file record (check configuration)" }, { 1349, AE, "Backup failed to allocate attribute record (check configuration)" }, { 1329, AE, "Backup during software upgrade not supported" }, /** * Still uncategorized */ { 720, AE, "Attribute name reused in table definition" }, { 4004, AE, "Attribute name not found in the Table" }, { 4100, AE, "Status Error in NDB" }, { 4101, AE, "No connections to NDB available and connect failed" }, { 4102, AE, "Type in NdbTamper not correct" }, { 4103, AE, "No schema connections to NDB available and connect failed" }, { 4104, AE, "Ndb Init in wrong state, destroy Ndb object and create a new" }, { 4105, AE, "Too many Ndb objects" }, { 4106, AE, "All Not NULL attribute have not been defined" }, { 4114, AE, "Transaction is already completed" }, { 4116, AE, "Operation was not defined correctly, probably missing a key" }, { 4117, AE, "Could not start transporter, configuration error"}, { 4118, AE, "Parameter error in API call" }, { 4300, AE, "Tuple Key Type not correct" }, { 4301, AE, "Fragment Type not correct" }, { 4302, AE, "Minimum Load Factor not correct" }, { 4303, AE, "Maximum Load Factor not correct" }, { 4304, AE, "Maximum Load Factor smaller than Minimum" }, { 4305, AE, "K value must currently be set to 6" }, { 4306, AE, "Memory Type not correct" }, { 4307, AE, "Invalid table name" }, { 4308, AE, "Attribute Size not correct" }, { 4309, AE, "Fixed array too large, maximum 64000 bytes" }, { 4310, AE, "Attribute Type not correct" }, { 4311, AE, "Storage Mode not correct" }, { 4312, AE, "Null Attribute Type not correct" }, { 4313, AE, "Index only storage for non-key attribute" }, { 4314, AE, "Storage Type of attribute not correct" }, { 4315, AE, "No more key attributes allowed after defining variable length key attribute" }, { 4316, AE, "Key attributes are not allowed to be NULL attributes" }, { 4317, AE, "Too many primary keys defined in table" }, { 4318, AE, "Invalid attribute name" }, { 4319, AE, "createAttribute called at erroneus place" }, { 4322, AE, "Attempt to define distribution key when not prepared to" }, { 4323, AE, "Distribution Key set on table but not defined on first attribute" }, { 4324, AE, "Attempt to define distribution group when not prepared to" }, { 4325, AE, "Distribution Group set on table but not defined on first attribute" }, { 4326, AE, "Distribution Group with erroneus number of bits" }, { 4327, AE, "Distribution Group with 1 byte attribute is not allowed" }, { 4328, AE, "Disk memory attributes not yet supported" }, { 4329, AE, "Variable stored attributes not yet supported" }, { 4400, AE, "Status Error in NdbSchemaCon" }, { 4401, AE, "Only one schema operation per schema transaction" }, { 4402, AE, "No schema operation defined before calling execute" }, { 4501, AE, "Insert in hash table failed when getting table information from Ndb" }, { 4502, AE, "GetValue not allowed in Update operation" }, { 4503, AE, "GetValue not allowed in Insert operation" }, { 4504, AE, "SetValue not allowed in Read operation" }, { 4505, AE, "NULL value not allowed in primary key search" }, { 4506, AE, "Missing getValue/setValue when calling execute" }, { 4507, AE, "Missing operation request when calling execute" }, { 4200, AE, "Status Error when defining an operation" }, { 4201, AE, "Variable Arrays not yet supported" }, { 4202, AE, "Set value on tuple key attribute is not allowed" }, { 4203, AE, "Trying to set a NOT NULL attribute to NULL" }, { 4204, AE, "Set value and Read/Delete Tuple is incompatible" }, { 4205, AE, "No Key attribute used to define tuple" }, { 4206, AE, "Not allowed to equal key attribute twice" }, { 4207, AE, "Key size is limited to 4092 bytes" }, { 4208, AE, "Trying to read a non-stored attribute" }, { 4209, AE, "Length parameter in equal/setValue is incorrect" }, { 4210, AE, "Ndb sent more info than the length he specified" }, { 4211, AE, "Inconsistency in list of NdbRecAttr-objects" }, { 4212, AE, "Ndb reports NULL value on Not NULL attribute" }, { 4213, AE, "Not all data of an attribute has been received" }, { 4214, AE, "Not all attributes have been received" }, { 4215, AE, "More data received than reported in TCKEYCONF message" }, { 4216, AE, "More than 8052 bytes in setValue cannot be handled" }, { 4217, AE, "It is not allowed to increment any other than unsigned ints" }, { 4218, AE, "Currently not allowed to increment NULL-able attributes" }, { 4219, AE, "Maximum size of interpretative attributes are 64 bits" }, { 4220, AE, "Maximum size of interpretative attributes are 64 bits" }, { 4221, AE, "Trying to jump to a non-defined label" }, { 4222, AE, "Label was not found, internal error" }, { 4223, AE, "Not allowed to create jumps to yourself" }, { 4224, AE, "Not allowed to jump to a label in a different subroutine" }, { 4225, AE, "All primary keys defined, call setValue/getValue"}, { 4226, AE, "Bad number when defining a label" }, { 4227, AE, "Bad number when defining a subroutine" }, { 4228, AE, "Illegal interpreter function in scan definition" }, { 4229, AE, "Illegal register in interpreter function definition" }, { 4230, AE, "Illegal state when calling getValue, probably not a read" }, { 4231, AE, "Illegal state when calling interpreter routine" }, { 4233, AE, "Calling execute (synchronous) when already prepared asynchronous transaction exists" }, { 4234, AE, "Illegal to call setValue in this state" }, { 4235, AE, "No callback from execute" }, { 4236, AE, "Trigger name too long" }, { 4237, AE, "Too many triggers" }, { 4238, AE, "Trigger not found" }, { 4239, AE, "Trigger with given name already exists"}, { 4240, AE, "Unsupported trigger type"}, { 4241, AE, "Index name too long" }, { 4242, AE, "Too many indexes" }, { 4243, AE, "Index not found" }, { 4244, OE, "Index or table with given name already exists" }, { 4247, AE, "Illegal index/trigger create/drop/alter request" }, { 4248, AE, "Trigger/index name invalid" }, { 4249, AE, "Invalid table" }, { 4250, AE, "Invalid index type or index logging option" }, { 4251, AE, "Cannot create unique index, duplicate keys found" }, { 4252, AE, "Failed to allocate space for index" }, { 4253, AE, "Failed to create index table" }, { 4254, AE, "Table not an index table" }, { 4255, AE, "Hash index attributes must be specified in same order as table attributes" }, { 4258, AE, "Cannot create unique index, duplicate attributes found in definition" }, { 4259, AE, "Invalid set of range scan bounds" }, { 4260, UD, "NdbScanFilter: Operator is not defined in NdbScanFilter::Group"}, { 4261, UD, "NdbScanFilter: Column is NULL"}, { 4262, UD, "NdbScanFilter: Condition is out of bounds"}, { 4263, IE, "Invalid blob attributes or invalid blob parts table" }, { 4264, AE, "Invalid usage of blob attribute" }, { 4265, AE, "Method is not valid in current blob state" }, { 4266, AE, "Invalid blob seek position" }, { 4267, IE, "Corrupted blob value" }, { 4268, IE, "Error in blob head update forced rollback of transaction" }, { 4269, IE, "No connection to ndb management server" }, { 4270, IE, "Unknown blob error" }, { 4335, AE, "Only one autoincrement column allowed per table. Having a table without primary key uses an autoincremented hidden key, i.e. a table without a primary key can not have an autoincremented column" }, { 4271, AE, "Invalid index object, not retrieved via getIndex()" }};staticconstint NbErrorCodes = sizeof(ErrorCodes)/sizeof(ErrorBundle);typedef struct ErrorStatusMessage { ndberror_status status; const char * message;} ErrorStatusMessage;typedef struct ErrorStatusClassification { ndberror_status status; ndberror_classification classification; const char * message;} ErrorStatusClassification;/** * Mapping between classification and status */staticconstErrorStatusMessage StatusMessageMapping[] = { { ST_S, "Success"}, { ST_P, "Permanent error"}, { ST_T, "Temporary error"}, { ST_U ,"Unknown result"}};staticconstint NbStatus = sizeof(StatusMessageMapping)/sizeof(ErrorStatusMessage);staticconstErrorStatusClassification StatusClassificationMapping[] = { { ST_S, NE, "No error"}, { ST_P, AE, "Application error"}, { ST_P, CE, "Configuration or application error"}, { ST_P, ND, "No data found"}, { ST_P, CV, "Constraint violation"}, { ST_P, SE, "Schema error"}, { ST_P, UD, "User defined error"}, { ST_P, IS, "Insufficient space"}, { ST_T, TR, "Temporary Resource error"}, { ST_T, NR, "Node Recovery error"}, { ST_T, OL, "Overload error"}, { ST_T, TO, "Timeout expired"}, { ST_T, NS, "Node shutdown"}, { ST_U , UR, "Unknown result error"}, { ST_U , UE, "Unknown error code"}, { ST_P, IE, "Internal error"}, { ST_P, NI, "Function not implemented"}};staticconstint NbClassification = sizeof(StatusClassificationMapping)/sizeof(ErrorStatusClassification);#ifdef NOT_USED/** * Complete all fields of an NdbError given the error code * and details */staticvoidset(ndberror_struct * error, int code, const char * details, ...){ error->code = code; { va_list ap; va_start(ap, details); vsnprintf(error->details, sizeof(error->details), details, ap); va_end(ap); }}#endifvoidndberror_update(ndberror_struct * error){ int found = 0; int i; for(i = 0; i<NbErrorCodes; i++){ if(ErrorCodes[i].code == error->code){ error->classification = ErrorCodes[i].classification; error->message = ErrorCodes[i].message; found = 1; break; } } if(!found){ error->classification = UE; error->message = "Unknown error code"; } found = 0; for(i = 0; i<NbClassification; i++){ if(StatusClassificationMapping[i].classification == error->classification){ error->status = StatusClassificationMapping[i].status; found = 1; break; } } if(!found){ error->status = ST_U; } error->details = 0;}intcheckErrorCodes(){ int i, j; for(i = 0; i<NbErrorCodes; i++) for(j = i+1; j<NbErrorCodes; j++) if(ErrorCodes[i].code == ErrorCodes[j].code){ printf("ErrorCode %d is defined multiple times!!\n", ErrorCodes[i].code); assert(0); } return 1;}/*static const int a = checkErrorCodes();*/#if CHECK_ERRORCODESint main(void){ checkErrorCodes(); return 0;}#endifconst char *ndberror_status_message(ndberror_status status){ int i; for (i= 0; i < NbStatus; i++) if (StatusMessageMapping[i].status == status) return StatusMessageMapping[i].message; return empty_string;}const char *ndberror_classification_message(ndberror_classification classification){ int i; for (i= 0; i < NbClassification; i++) if (StatusClassificationMapping[i].classification == classification) return StatusClassificationMapping[i].message; return empty_string;}int ndb_error_string(int err_no, char *str, unsigned int size){ ndberror_struct error; unsigned int len; error.code = err_no; ndberror_update(&error); len = my_snprintf(str, size-1, "%s: %s: %s", error.message, ndberror_status_message(error.status), ndberror_classification_message(error.classification)); str[size-1]= '\0'; if (error.classification != UE) return len; return -len;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -