summaryrefslogtreecommitdiff
path: root/extra/perror.c
diff options
context:
space:
mode:
authorunknown <msvensson@neptunus.(none)>2006-07-26 14:09:20 +0200
committerunknown <msvensson@neptunus.(none)>2006-07-26 14:09:20 +0200
commitde41f4e7bb0582101e4e1c8343962fa31bbe549e (patch)
tree328d27d08b707854347a0457312e5c1ee8517dbd /extra/perror.c
parent0227a7b066bc64a05ab81dc8859227545829a386 (diff)
downloadmariadb-git-de41f4e7bb0582101e4e1c8343962fa31bbe549e.tar.gz
Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
- Since error 1186 is not found among NDB error codes, the message retuned should indicate that. extra/perror.c: Move the !found out one level mysql-test/t/perror.test: Add test case for bug#16561 ndb/src/kernel/error/ndbd_exit_codes.c: Check not only for zero size string but also classification "unknown error" when looking for an error mesage for an error code
Diffstat (limited to 'extra/perror.c')
-rw-r--r--extra/perror.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/extra/perror.c b/extra/perror.c
index 531d30dae86..b26e516a101 100644
--- a/extra/perror.c
+++ b/extra/perror.c
@@ -261,7 +261,7 @@ int main(int argc,char *argv[])
found= 1;
msg= 0;
}
- else
+ else
#endif
msg = strerror(code);
@@ -281,20 +281,23 @@ int main(int argc,char *argv[])
else
puts(msg);
}
- if (!(msg=get_ha_error_msg(code)))
+
+ if (!found)
{
- if (!found)
- {
+ /* Error message still not found, look in handler error codes */
+ if (!(msg=get_ha_error_msg(code)))
+ {
fprintf(stderr,"Illegal error code: %d\n",code);
error=1;
- }
- }
- else
- {
- if (verbose)
- printf("MySQL error code %3d: %s\n",code,msg);
- else
- puts(msg);
+ }
+ else
+ {
+ found= 1;
+ if (verbose)
+ printf("MySQL error code %3d: %s\n",code,msg);
+ else
+ puts(msg);
+ }
}
}
}