summaryrefslogtreecommitdiff
path: root/extra/perror.c
diff options
context:
space:
mode:
authortulin@build.mysql.com <>2004-05-10 17:40:57 +0200
committertulin@build.mysql.com <>2004-05-10 17:40:57 +0200
commitff4018aa8ac58411e76e40f8c06536ef21ae8454 (patch)
tree808e79a60bd6ef6a37714172df3a6b1f8c06b1b3 /extra/perror.c
parent6fffe5907751ad862f4c684bcfc4969ad7d5e6d5 (diff)
parentbb9f7a9375d7f0bfa08e345d0faf7dfb9a6eb618 (diff)
downloadmariadb-git-ff4018aa8ac58411e76e40f8c06536ef21ae8454.tar.gz
merge resolve
Diffstat (limited to 'extra/perror.c')
-rw-r--r--extra/perror.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/extra/perror.c b/extra/perror.c
index 10b2442de20..1d3d7c70fac 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -23,15 +23,27 @@
#include <m_string.h>
#include <errno.h>
#include <my_getopt.h>
+#ifdef HAVE_NDBCLUSTER_DB
+#include "../ndb/src/ndbapi/ndberror.c"
+#endif
static my_bool verbose, print_all_codes;
+#ifdef HAVE_NDBCLUSTER_DB
+static my_bool ndb_code;
+static char ndb_string[1024];
+#endif
+
static struct my_option my_long_options[] =
{
{"help", '?', "Displays this help and exits.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"info", 'I', "Synonym for --help.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
+#ifdef HAVE_NDBCLUSTER_DB
+ {"ndb", 0, "Ndbcluster storage engine specific error codes.", (gptr*) &ndb_code,
+ (gptr*) &ndb_code, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0},
+#endif
#ifdef HAVE_SYS_ERRLIST
{"all", 'a', "Print all the error messages and the number.",
(gptr*) &print_all_codes, (gptr*) &print_all_codes, 0, GET_BOOL, NO_ARG,
@@ -199,7 +211,17 @@ int main(int argc,char *argv[])
{
found=0;
code=atoi(*argv);
- msg = strerror(code);
+#ifdef HAVE_NDBCLUSTER_DB
+ if (ndb_code)
+ {
+ if (ndb_error_string(code, ndb_string, 1024) < 0)
+ msg= 0;
+ else
+ msg= ndb_string;
+ }
+ else
+#endif
+ msg = strerror(code);
if (msg)
{
found=1;