This section provides information about the
NdbError data structure, which contains status
and other information about errors, including error codes,
classifications, and messages.
- Description
-
An
NdbErrorconsists of six parts, listed here, of which one is deprecated:-
Error status: This describes the impact of an error on the application, and reflects what the application should do when the error is encountered.
The error status is described by a value of the
Statustype. See NdbError::Status, for possibleStatusvalues and how they should be interpreted. -
Error classification: This represents a logical error type or grouping.
The error classification is described by a value of the
Classificationtype. See NdbError::Classification, for possible classifications and their interpretation. Additional information is provided in Section 2.4.4, “NDB Error Classifications”. -
Error code: This is an NDB API internal error code which uniquely identifies the error.
ImportantIt is not recommended to write application programs which are dependent on specific error codes. Instead, applications should check error status and classification. More information about errors can also be obtained by checking error messages and (when available) error detail messages. However—like error codes—these error messages and error detail messages are subject to change.
A listing of current error codes, broken down by classification, is provided in Section 2.4.2, “NDB Error Codes: by Type”. This listing is updated with new NDB Cluster releases. You can also check the file
storage/ndb/src/ndbapi/ndberror.cin the NDB Cluster sources. MySQL Error code: This is the corresponding MySQL Server error code. MySQL error codes are not discussed in this document; please see Server Error Message Reference, in the MySQL Manual, for information about these.
Error message: This is a generic, context-independent description of the error.
-
Error details: This can often provide additional information (not found in the error message) about an error, specific to the circumstances under which the error is encountered. However, it is not available in all cases.
Where not specified, the error detail message is
NULL.NoteThis property is deprecated and scheduled for eventual removal. For obtaining error details, you should use the
Ndb::getNdbErrorDetail()method instead.
Specific NDB API error codes, messages, and detail messages are subject to change without notice.
-
- Definition
-
The
NdbErrorstructure contains the following members, whose types are as shown here:Status status: The error status.Classification classification: The error type (classification).int code: The NDB API error code.int mysql_code: The MySQL error code.const char* message: The error message.-
char* details: The error detail message.detailsis deprecated and scheduled for eventual removal. You should use theNdb::getNdbErrorDetail()method instead. (Bug #48851)
- Types
-
NdbErrordefines the two data types listed here:Classification: The type of error or the logical grouping to which the error belongs.Status: The error status.
This section provides information about the
Classification data type.
- Description
This type describes the type of error, or the logical group to which it belongs.
- Enumeration values
-
Possible values are shown, along with descriptions, in the following table:
Table 2.40 NdbError Classification data type values and descriptions
Name Description NoErrorIndicates success (no error occurred) ApplicationErrorAn error occurred in an application program NoDataFoundA read operation failed due to one or more missing records. ConstraintViolationA constraint violation occurred, such as attempting to insert a tuple having a primary key value already in use in the target table. SchemaErrorAn error took place when trying to create or use a table. InsufficientSpaceThere was insufficient memory for data or indexes. TemporaryResourceErrorThis type of error is typically encountered when there are too many active transactions. NodeRecoveryErrorThis is a temporary failure which was likely caused by a node recovery in progress, some examples being when information sent between an application and NDBis lost, or when there is a distribution change.OverloadErrorThis type of error is often caused when there is insufficient log file space. TimeoutExpiredA timeout, often caused by a deadlock. UnknownResultErrorIt is not known whether a transaction was committed. InternalErrorA serious error has occurred in NDBitself.FunctionNotImplementedThe application attempted to use a function which is not yet implemented. UnknownErrorCodeThis is seen where the NDBerror handler cannot determine the correct error code to report.NodeShutdownThis is caused by a node shutdown. SchemaObjectExistsThe application attempted to create a schema object that already exists. InternalTemporaryA request was sent to a node other than the master. Related information specific to certain error conditions can be found in Section 2.4.2, “NDB Error Codes: by Type”, and in Section 2.4.4, “NDB Error Classifications”.
This section provides information about the
Status data type.
- Description
This type is used to describe an error's status.
- Enumeration values
-
Possible values are shown, along with descriptions, in the following table:
Table 2.41 NdbError Status data type values and descriptions
Name Description SuccessNo error has occurred TemporaryErrorA temporary and usually recoverable error; the application should retry the operation giving rise to the error PermanentErrorPermanent error; not recoverable UnknownResultThe operation's result or status is unknown Related information specific to certain error conditions can be found in Section 2.4.4, “NDB Error Classifications”.