Commit 80b85636 authored by jimw@mysql.com's avatar jimw@mysql.com

Bug #19059: Failure to get version information when running from source tree

  Fix the way that instance manager finds the version number of instances,
  so that it works properly when the executable name isn't the same as what
  the instance-manager launched, such as when wrapping a libtool-wrapped
  executable from the source tree.

  This removes the 'Ver ' reported in the version column output by
  'SHOW INSTANCE STATUS ...', but the format of this column is not
  documented (and is pretty free-form to begin with).
parent 8732caf2
......@@ -132,7 +132,7 @@ int Instance_options::fill_instance_version()
bzero(result, MAX_VERSION_STRING_LENGTH);
rc= parse_output_and_get_value(cmd.buffer, mysqld_path,
rc= parse_output_and_get_value(cmd.buffer, "Ver",
result, MAX_VERSION_STRING_LENGTH,
GET_LINE);
......
......@@ -96,14 +96,14 @@ int parse_output_and_get_value(const char *command, const char *word,
linebuf[sizeof(linebuf) - 1]= '\0'; /* safety */
/*
Compare the start of our line with the word(s) we are looking for.
Find the word(s) we are looking for in the line
*/
if (!strncmp(word, linep, wordlen))
if ((linep= strstr(linep, word)))
{
/*
If we have found our word(s), then move linep past the word(s)
*/
linep+= wordlen;
linep+= wordlen;
if (flag & GET_VALUE)
{
trim_space((const char**) &linep, &found_word_len);
......
......@@ -6864,6 +6864,10 @@ SHOW_VAR status_vars[]= {
static void print_version(void)
{
set_server_version();
/*
Note: the instance manager keys off the string 'Ver' so it can find the
version from the output of 'mysqld --version', so don't change it!
*/
printf("%s Ver %s for %s on %s (%s)\n",my_progname,
server_version,SYSTEM_TYPE,MACHINE_TYPE, MYSQL_COMPILATION_COMMENT);
}
......
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