1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#28012 Patch : IM crashes instead of reporting an error when mysqldpath is bad

On the windows platform, if an instance object failed to initialize during
program start, the instance manager would crash.
This could happen if an incorrect mysqld path was supplied in the 
defaults configuration file.
The patch prevents the program from crashing and makes it show an
error message instead.
This commit is contained in:
thek@adventure.(none)
2007-07-23 15:05:50 +02:00
parent 08e7d2d312
commit 7d55b07fca
6 changed files with 393 additions and 108 deletions

View File

@ -156,7 +156,8 @@ int Instance_options::get_default_option(char *result, size_t result_len,
goto err;
/* +2 eats first "--" from the option string (E.g. "--datadir") */
rc= parse_output_and_get_value((char*) cmd.buffer, option_name + 2,
rc= parse_output_and_get_value((char*) cmd.buffer,
option_name + 2, strlen(option_name + 2),
result, result_len, GET_VALUE);
err:
return rc;
@ -194,8 +195,8 @@ bool Instance_options::fill_instance_version()
bzero(result, MAX_VERSION_LENGTH);
if (parse_output_and_get_value((char*) cmd.buffer, "Ver", result,
MAX_VERSION_LENGTH, GET_LINE))
if (parse_output_and_get_value((char*) cmd.buffer, STRING_WITH_LEN("Ver"),
result, MAX_VERSION_LENGTH, GET_LINE))
{
log_error("Failed to get version of '%s': unexpected output.",
(const char *) mysqld_path.str);
@ -206,8 +207,7 @@ bool Instance_options::fill_instance_version()
{
char *start;
/* chop the newline from the end of the version string */
result[strlen(result) - NEWLINE_LEN]= '\0';
/* trim leading whitespaces */
start= result;
while (my_isspace(default_charset_info, *start))
@ -255,7 +255,8 @@ bool Instance_options::fill_mysqld_real_path()
bzero(result, FN_REFLEN);
if (parse_output_and_get_value((char*) cmd.buffer, "Usage: ",
if (parse_output_and_get_value((char*) cmd.buffer,
STRING_WITH_LEN("Usage: "),
result, FN_REFLEN,
GET_LINE))
{