Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
420814fa
Commit
420814fa
authored
May 05, 2004
by
tomas@mc05.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructure of ndb error
parent
23d47410
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
783 additions
and
639 deletions
+783
-639
ndb/include/ndbapi/NdbError.hpp
ndb/include/ndbapi/NdbError.hpp
+38
-20
ndb/include/ndbapi/ndberror.h
ndb/include/ndbapi/ndberror.h
+100
-0
ndb/src/kernel/blocks/backup/restore/Makefile
ndb/src/kernel/blocks/backup/restore/Makefile
+3
-3
ndb/src/ndbapi/Makefile
ndb/src/ndbapi/Makefile
+1
-0
ndb/src/ndbapi/NdbErrorOut.cpp
ndb/src/ndbapi/NdbErrorOut.cpp
+3
-62
ndb/src/ndbapi/Ndberror.cpp
ndb/src/ndbapi/Ndberror.cpp
+42
-554
ndb/src/ndbapi/ndberror.c
ndb/src/ndbapi/ndberror.c
+596
-0
No files found.
ndb/include/ndbapi/NdbError.hpp
View file @
420814fa
...
...
@@ -17,6 +17,8 @@
#ifndef NDB_ERROR_HPP
#define NDB_ERROR_HPP
#include <ndberror.h>
/**
* @struct NdbError
* @brief Contains error information
...
...
@@ -51,7 +53,7 @@ struct NdbError {
* The error code indicate success<br>
* (Includes classification: NdbError::NoError)
*/
Success
=
0
,
Success
=
ndberror_st_success
,
/**
* The error code indicates a temporary error.
...
...
@@ -61,7 +63,7 @@ struct NdbError {
* NdbError::OverloadError, NdbError::NodeShutdown
* and NdbError::TimeoutExpired.)
*/
TemporaryError
=
1
,
TemporaryError
=
ndberror_st_temporary
,
/**
* The error code indicates a permanent error.<br>
...
...
@@ -71,14 +73,14 @@ struct NdbError {
* NdbError::UserDefinedError, NdbError::InternalError, and,
* NdbError::FunctionNotImplemented.)
*/
PermanentError
=
2
,
PermanentError
=
ndberror_st_permanent
,
/**
* The result/status is unknown.<br>
* (Includes classifications: NdbError::UnknownResultError, and
* NdbError::UnknownErrorCode.)
*/
UnknownResult
=
3
UnknownResult
=
ndberror_st_unknown
};
/**
...
...
@@ -88,85 +90,85 @@ struct NdbError {
/**
* Success. No error occurred.
*/
NoError
=
0
,
NoError
=
ndberror_cl_none
,
/**
* Error in application program.
*/
ApplicationError
=
1
,
ApplicationError
=
ndberror_cl_application
,
/**
* Read operation failed due to missing record.
*/
NoDataFound
=
2
,
NoDataFound
=
ndberror_cl_no_data_found
,
/**
* E.g. inserting a tuple with a primary key already existing
* in the table.
*/
ConstraintViolation
=
3
,
ConstraintViolation
=
ndberror_cl_constraint_violation
,
/**
* Error in creating table or usage of table.
*/
SchemaError
=
4
,
SchemaError
=
ndberror_cl_schema_error
,
/**
* Error occurred in interpreted program.
*/
UserDefinedError
=
5
,
UserDefinedError
=
ndberror_cl_user_defined
,
/**
* E.g. insufficient memory for data or indexes.
*/
InsufficientSpace
=
6
,
InsufficientSpace
=
ndberror_cl_insufficient_space
,
/**
* E.g. too many active transactions.
*/
TemporaryResourceError
=
7
,
TemporaryResourceError
=
ndberror_cl_temporary_resource
,
/**
* Temporary failures which are probably inflicted by a node
* recovery in progress. Examples: information sent between
* application and NDB lost, distribution change.
*/
NodeRecoveryError
=
8
,
NodeRecoveryError
=
ndberror_cl_node_recovery
,
/**
* E.g. out of log file space.
*/
OverloadError
=
9
,
OverloadError
=
ndberror_cl_overload
,
/**
* Timeouts, often inflicted by deadlocks in NDB.
*/
TimeoutExpired
=
10
,
TimeoutExpired
=
ndberror_cl_timeout_expired
,
/**
* Is is unknown whether the transaction was committed or not.
*/
UnknownResultError
=
11
,
UnknownResultError
=
ndberror_cl_unknown_result
,
/**
* A serious error in NDB has occurred.
*/
InternalError
=
12
,
InternalError
=
ndberror_cl_internal_error
,
/**
* A function used is not yet implemented.
*/
FunctionNotImplemented
=
13
,
FunctionNotImplemented
=
ndberror_cl_function_not_implemented
,
/**
* Error handler could not determine correct error code.
*/
UnknownErrorCode
=
14
,
UnknownErrorCode
=
ndberror_cl_unknown_error_code
,
/**
* Node shutdown
*/
NodeShutdown
=
15
NodeShutdown
=
ndberror_cl_node_shutdown
};
/**
...
...
@@ -204,6 +206,22 @@ struct NdbError {
message
=
0
;
details
=
0
;
}
NdbError
(
ndberror_struct
ndberror
){
status
=
(
NdbError
::
Status
)
ndberror
.
status
;
classification
=
(
NdbError
::
Classification
)
ndberror
.
classification
;
code
=
ndberror
.
code
;
message
=
ndberror
.
message
;
details
=
ndberror
.
details
;
}
operator
ndberror_struct
()
const
{
ndberror_struct
ndberror
;
ndberror
.
status
=
(
ndberror_status_enum
)
status
;
ndberror
.
classification
=
(
ndberror_classification_enum
)
classification
;
ndberror
.
code
=
code
;
ndberror
.
message
=
message
;
ndberror
.
details
=
details
;
return
ndberror
;
}
};
class
NdbOut
&
operator
<<
(
class
NdbOut
&
,
const
NdbError
&
);
...
...
ndb/include/ndbapi/ndberror.h
0 → 100644
View file @
420814fa
/* Copyright (C) 2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#ifndef NDBERROR_H
#define NDBERROR_H
#include <stdlib.h>
#ifdef __cplusplus
extern
"C"
{
#endif
typedef
enum
{
ndberror_st_success
=
0
,
ndberror_st_temporary
=
1
,
ndberror_st_permanent
=
2
,
ndberror_st_unknown
=
3
}
ndberror_status_enum
;
typedef
enum
{
ndberror_cl_none
=
0
,
ndberror_cl_application
=
1
,
ndberror_cl_no_data_found
=
2
,
ndberror_cl_constraint_violation
=
3
,
ndberror_cl_schema_error
=
4
,
ndberror_cl_user_defined
=
5
,
ndberror_cl_insufficient_space
=
6
,
ndberror_cl_temporary_resource
=
7
,
ndberror_cl_node_recovery
=
8
,
ndberror_cl_overload
=
9
,
ndberror_cl_timeout_expired
=
10
,
ndberror_cl_unknown_result
=
11
,
ndberror_cl_internal_error
=
12
,
ndberror_cl_function_not_implemented
=
13
,
ndberror_cl_unknown_error_code
=
14
,
ndberror_cl_node_shutdown
=
15
}
ndberror_classification_enum
;
typedef
struct
{
/**
* Error status.
*/
ndberror_status_enum
status
;
/**
* Error type
*/
ndberror_classification_enum
classification
;
/**
* Error code
*/
int
code
;
/**
* Error message
*/
const
char
*
message
;
/**
* The detailed description. This is extra information regarding the
* error which is not included in the error message.
*
* @note Is NULL when no details specified
*/
char
*
details
;
}
ndberror_struct
;
typedef
ndberror_status_enum
ndberror_status
;
typedef
ndberror_classification_enum
ndberror_classification
;
const
char
*
ndberror_status_message
(
const
ndberror_status
);
const
char
*
ndberror_classification_message
(
const
ndberror_classification
);
void
ndberror_update
(
ndberror_struct
*
);
int
ndb_error_string
(
int
err_no
,
char
*
str
,
size_t
size
);
#ifdef __cplusplus
}
#endif
#endif
ndb/src/kernel/blocks/backup/restore/Makefile
View file @
420814fa
include
.defs.mk
TYPE
:=
ndbapi ndbapiclient
TYPE
:=
*
BIN_TARGET
:=
restore
BIN_TARGET_LIBS
:=
BIN_TARGET_ARCHIVES
:=
NDB_API
general
BIN_TARGET_ARCHIVES
:=
NDB_API
CCFLAGS_LOC
=
-I
..
-I
$(NDB_TOP)
/src/ndbapi
CCFLAGS_LOC
=
-I
..
-I
$(NDB_TOP)
/src/ndbapi
-I
$(NDB_TOP)
/include/ndbapi
-I
$(NDB_TOP)
/include/util
-I
$(NDB_TOP)
/include/portlib
-I
$(NDB_TOP)
/include/kernel
#ifneq ($(MYSQLCLUSTER_TOP),)
#CCFLAGS_LOC +=-I$(MYSQLCLUSTER_TOP)/include -D USE_MYSQL
...
...
ndb/src/ndbapi/Makefile
View file @
420814fa
...
...
@@ -32,6 +32,7 @@ SOURCES = \
Ndbif.cpp
\
Ndbinit.cpp
\
Ndberror.cpp
\
ndberror.c
\
NdbErrorOut.cpp
\
NdbConnection.cpp
\
NdbConnectionScan.cpp
\
...
...
ndb/src/ndbapi/NdbErrorOut.cpp
View file @
420814fa
...
...
@@ -15,7 +15,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NdbError.hpp>
#include <NdbStdio.h>
#include <stdarg.h>
...
...
@@ -23,10 +22,7 @@
#include <NdbOut.hpp>
const
char
*
ndberror_status_message
(
const
NdbError
::
Status
&
status
);
const
char
*
ndberror_classification_message
(
const
NdbError
::
Classification
&
classification
);
int
ndb_error_string
(
int
err_no
,
char
*
str
,
size_t
size
);
void
ndberror_update
(
const
NdbError
&
_err
);
#include <NdbError.hpp>
/**
* operators
...
...
@@ -42,66 +38,11 @@ operator<<(NdbOut & out, const NdbError & error){
NdbOut
&
operator
<<
(
NdbOut
&
out
,
const
NdbError
::
Status
&
status
){
return
out
<<
ndberror_status_message
(
status
);
return
out
<<
ndberror_status_message
(
(
ndberror_status
)
status
);
}
NdbOut
&
operator
<<
(
NdbOut
&
out
,
const
NdbError
::
Classification
&
classification
){
return
out
<<
ndberror_classification_message
(
classification
);
}
/******************************************************
*
*/
#include "NdbImpl.hpp"
#include "NdbDictionaryImpl.hpp"
#include <NdbSchemaCon.hpp>
#include <NdbOperation.hpp>
#include <NdbConnection.hpp>
const
NdbError
&
Ndb
::
getNdbError
(
int
code
){
theError
.
code
=
code
;
ndberror_update
(
theError
);
return
theError
;
return
out
<<
ndberror_classification_message
((
ndberror_classification
)
classification
);
}
const
NdbError
&
Ndb
::
getNdbError
()
const
{
ndberror_update
(
theError
);
return
theError
;
}
const
NdbError
&
NdbDictionaryImpl
::
getNdbError
()
const
{
ndberror_update
(
m_error
);
return
m_error
;
}
const
NdbError
&
NdbConnection
::
getNdbError
()
const
{
ndberror_update
(
theError
);
return
theError
;
}
const
NdbError
&
NdbOperation
::
getNdbError
()
const
{
ndberror_update
(
theError
);
return
theError
;
}
const
NdbError
&
NdbSchemaCon
::
getNdbError
()
const
{
ndberror_update
(
theError
);
return
theError
;
}
ndb/src/ndbapi/Ndberror.cpp
View file @
420814fa
This diff is collapsed.
Click to expand it.
ndb/src/ndbapi/ndberror.c
0 → 100644
View file @
420814fa
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment