Commit de41f4e7 authored by unknown's avatar unknown

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
parent 0227a7b0
......@@ -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);
}
}
}
}
......
......@@ -9,3 +9,14 @@ enable_query_log;
--exec $MY_PERROR 150
--exec $MY_PERROR --silent 120
#
# Bug#16561 Unknown ERROR msg "ERROR 1186 (HY000): Binlog closed" by perror
#
# As long there is no error code 1186 defined by NDB
# we should get a message "Illegal ndb error code: 1186"
--error 1
--exec $MY_PERROR --ndb 1186
# As there is an error code defined for 1186, expect error
--exec $MY_PERROR 1186
......@@ -247,7 +247,7 @@ int ndbd_exit_string(int err_no, char *str, unsigned int size)
ndbd_exit_classification cl;
ndbd_exit_status st;
const char *msg = ndbd_exit_message(err_no, &cl);
if (msg[0] != '\0')
if (msg[0] != '\0' && cl != XUE)
{
const char *cl_msg = ndbd_exit_classification_message(cl, &st);
const char *st_msg = ndbd_exit_status_message(st);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment