summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-06-17 17:21:27 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-06-17 17:21:27 +0200
commit8f7696d26657be40ef99d4d4cb8d64115b9eae95 (patch)
treeeb368394fe534c806714f0b0c11713445314fd77 /extra
parentce28c41eb7b42bc02a471aa43eee1d1bee94a330 (diff)
parente2380b98afafc67021bfa0db0171c320b02c25e9 (diff)
downloadmariadb-git-8f7696d26657be40ef99d4d4cb8d64115b9eae95.tar.gz
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-engines extra/perror.c: Auto merged mysql-test/t/ndb_basic.test: Auto merged mysql-test/t/ndb_insert.test: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/mysqld.cc: Auto merged storage/ndb/src/common/transporter/Packer.cpp: Auto merged storage/ndb/src/common/transporter/TCP_Transporter.hpp: Auto merged storage/ndb/src/common/transporter/TransporterRegistry.cpp: Auto merged storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: Auto merged storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged storage/ndb/src/mgmclient/main.cpp: Auto merged storage/ndb/src/ndbapi/NdbBlob.cpp: Auto merged storage/ndb/test/ndbapi/testNdbApi.cpp: Auto merged storage/ndb/test/run-test/daily-basic-tests.txt: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged mysql-test/t/disabled.def: manual merge
Diffstat (limited to 'extra')
-rw-r--r--extra/perror.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/extra/perror.c b/extra/perror.c
index 9b87bfa3d2a..fba7b69bfe4 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -25,6 +25,7 @@
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
#include "../storage/ndb/src/ndbapi/ndberror.c"
#include "../storage/ndb/src/kernel/error/ndbd_exit_codes.c"
+#include "../storage/ndb/include/mgmapi/mgmapi_error.h"
#endif
static my_bool verbose, print_all_codes;
@@ -32,6 +33,20 @@ static my_bool verbose, print_all_codes;
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
static my_bool ndb_code;
static char ndb_string[1024];
+int mgmapi_error_string(int err_no, char *str, int size)
+{
+ int i;
+ for (i= 0; i < ndb_mgm_noOfErrorMsgs; i++)
+ {
+ if ((int)ndb_mgm_error_msgs[i].code == err_no)
+ {
+ my_snprintf(str, size-1, "%s", ndb_mgm_error_msgs[i].msg);
+ str[size-1]= '\0';
+ return 0;
+ }
+ }
+ return -1;
+}
#endif
static struct my_option my_long_options[] =
@@ -238,8 +253,9 @@ int main(int argc,char *argv[])
#ifdef WITH_NDBCLUSTER_STORAGE_ENGINE
if (ndb_code)
{
- if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
- (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
+ if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
+ (ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
+ (mgmapi_error_string(code, ndb_string, sizeof(ndb_string)) < 0))
{
msg= 0;
}