diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-02-08 17:17:27 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-02-08 17:17:27 +0100 |
commit | 5ffc2dc202e49607b91851f3e44f60f49f175294 (patch) | |
tree | 967d8de484f6482cd45e20525e555d15b9fd82e3 /extra/perror.c | |
parent | 64baa9dd7afa8dc7421d87405730c33b78f6bf40 (diff) | |
download | mariadb-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.c | 16 |
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 |