summaryrefslogtreecommitdiff
path: root/server-tools
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-04-17 09:38:50 -0700
committerunknown <jimw@mysql.com>2006-04-17 09:38:50 -0700
commit11099ed53c6dec4b9905a579d4b1cc0a47114032 (patch)
treeb86e8829040c912b368477130f8cf90af0619ff5 /server-tools
parent3d1f97b170310d97a1feee7e5ce093792fbc7c70 (diff)
downloadmariadb-git-11099ed53c6dec4b9905a579d4b1cc0a47114032.tar.gz
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). server-tools/instance-manager/instance_options.cc: Look for 'Ver' to get version from running mysqld --version server-tools/instance-manager/parse_output.cc: Make parse_output_and_get_value() look at the whole line to find the word, instead of just at the beginning of each line. sql/mysqld.cc: Note that the instance manager relies on 'Ver' in mysqld --version
Diffstat (limited to 'server-tools')
-rw-r--r--server-tools/instance-manager/instance_options.cc2
-rw-r--r--server-tools/instance-manager/parse_output.cc6
2 files changed, 4 insertions, 4 deletions
diff --git a/server-tools/instance-manager/instance_options.cc b/server-tools/instance-manager/instance_options.cc
index d2946270b9e..06a6e1ebc63 100644
--- a/server-tools/instance-manager/instance_options.cc
+++ b/server-tools/instance-manager/instance_options.cc
@@ -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);
diff --git a/server-tools/instance-manager/parse_output.cc b/server-tools/instance-manager/parse_output.cc
index ebc45c1f7d4..64bb6a6485f 100644
--- a/server-tools/instance-manager/parse_output.cc
+++ b/server-tools/instance-manager/parse_output.cc
@@ -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);