diff options
author | unknown <tulin@build.mysql.com> | 2004-05-10 17:40:57 +0200 |
---|---|---|
committer | unknown <tulin@build.mysql.com> | 2004-05-10 17:40:57 +0200 |
commit | 806a06fdbdc19edd596a0b4c5ef54b1c546f5b20 (patch) | |
tree | 808e79a60bd6ef6a37714172df3a6b1f8c06b1b3 /extra | |
parent | 572899e0362f08755a82603a36a27628fb88a5d0 (diff) | |
parent | 5edb391973f235890e3e6eb771e7d0fa3102b24a (diff) | |
download | mariadb-git-806a06fdbdc19edd596a0b4c5ef54b1c546f5b20.tar.gz |
merge resolve
extra/perror.c:
Auto merged
ndb/include/debugger/SignalLoggerManager.hpp:
Auto merged
ndb/include/ndb_version.h:
Auto merged
ndb/src/common/portlib/unix/NdbMem.c:
Auto merged
ndb/src/common/portlib/unix/NdbThread.c:
Auto merged
ndb/src/common/util/Parser.cpp:
Auto merged
ndb/src/common/util/getarg.c:
Auto merged
ndb/src/common/util/version.c:
Auto merged
ndb/src/kernel/blocks/backup/restore/Restore.cpp:
Auto merged
ndb/src/kernel/blocks/dbutil/DbUtil.cpp:
Auto merged
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp:
Auto merged
ndb/src/kernel/ndb-main/Main.cpp:
Auto merged
ndb/src/mgmapi/test/keso.c:
Auto merged
ndb/src/mgmclient/test_cpcd/test_cpcd.cpp:
Auto merged
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'extra')
-rw-r--r-- | extra/Makefile.am | 2 | ||||
-rw-r--r-- | extra/perror.c | 24 |
2 files changed, 24 insertions, 2 deletions
diff --git a/extra/Makefile.am b/extra/Makefile.am index 0276355ef65..df29a3a6ab7 100644 --- a/extra/Makefile.am +++ b/extra/Makefile.am @@ -14,7 +14,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include +INCLUDES = @MT_INCLUDES@ -I$(top_srcdir)/include @ndbcluster_includes@ LDADD = @CLIENT_EXTRA_LDFLAGS@ ../mysys/libmysys.a \ ../dbug/libdbug.a ../strings/libmystrings.a bin_PROGRAMS = replace comp_err perror resolveip my_print_defaults \ 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; |