mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Fix output of perror to include whether the error message
corresponds to an OS or MySQL error. (Bug #8517) extra/perror.c: Don't report OS errors that start with 'Unknown Error', and always make clear whether we are reporting an OS or MySQL error message.
This commit is contained in:
@ -245,16 +245,17 @@ int main(int argc,char *argv[])
|
|||||||
msg = strerror(code);
|
msg = strerror(code);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Don't print message for not existing error messages or for
|
We don't print the OS error message if it is the same as the
|
||||||
unknown errors. We test for 'Uknown Errors' just as an
|
unknown_error message we retrieved above, or it starts with
|
||||||
extra safety for Netware
|
'Unknown Error' (without regard to case).
|
||||||
*/
|
*/
|
||||||
if (msg && strcmp(msg, "Unknown Error") &&
|
if (msg &&
|
||||||
|
my_strnncoll(&my_charset_latin1, msg, 13, "Unknown Error", 13) &&
|
||||||
(!unknown_error || strcmp(msg, unknown_error)))
|
(!unknown_error || strcmp(msg, unknown_error)))
|
||||||
{
|
{
|
||||||
found=1;
|
found=1;
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("Error code %3d: %s\n",code,msg);
|
printf("OS error code %3d: %s\n",code,msg);
|
||||||
else
|
else
|
||||||
puts(msg);
|
puts(msg);
|
||||||
}
|
}
|
||||||
@ -269,7 +270,7 @@ int main(int argc,char *argv[])
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (verbose)
|
if (verbose)
|
||||||
printf("MySQL error: %3d = %s\n",code,msg);
|
printf("MySQL error code %3d: %s\n",code,msg);
|
||||||
else
|
else
|
||||||
puts(msg);
|
puts(msg);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user