summaryrefslogtreecommitdiff
path: root/extra/perror.c
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-02-08 17:17:27 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2006-02-08 17:17:27 +0100
commit5ffc2dc202e49607b91851f3e44f60f49f175294 (patch)
tree967d8de484f6482cd45e20525e555d15b9fd82e3 /extra/perror.c
parent64baa9dd7afa8dc7421d87405730c33b78f6bf40 (diff)
downloadmariadb-git-5ffc2dc202e49607b91851f3e44f60f49f175294.tar.gz
Bug #17235 perror prints wrong prefix for ndb error codes
Diffstat (limited to 'extra/perror.c')
-rw-r--r--extra/perror.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/extra/perror.c b/extra/perror.c
index 919088ba42e..82311c1b2c9 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -239,10 +239,24 @@ int main(int argc,char *argv[])
if ((ndb_error_string(code, ndb_string, sizeof(ndb_string)) < 0) &&
(ndbd_exit_string(code, ndb_string, sizeof(ndb_string)) < 0))
{
- msg= 0;
+ msg= 0;
}
else
msg= ndb_string;
+ if (msg)
+ {
+ if (verbose)
+ printf("NDB error code %3d: %s\n",code,msg);
+ else
+ puts(msg);
+ }
+ else
+ {
+ fprintf(stderr,"Illegal ndb error code: %d\n",code);
+ error= 1;
+ }
+ found= 1;
+ msg= 0;
}
else
#endif