From: Jim Winstead Date: April 17 2006 4:38pm Subject: bk commit into 5.1 tree (jimw:1.2355) BUG#19059 List-Archive: http://lists.mysql.com/commits/5021 X-Bug: 19059 Message-Id: <20060417163857.8423AA8437@rama.trainedmonkey.com> Below is the list of changes that have just been committed into a local 5.1 repository of jimw. When jimw does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2355 06/04/17 09:38:50 jimw@stripped +3 -0 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). sql/mysqld.cc 1.555 06/04/17 09:38:45 jimw@stripped +4 -0 Note that the instance manager relies on 'Ver' in mysqld --version server-tools/instance-manager/parse_output.cc 1.19 06/04/17 09:38:45 jimw@stripped +3 -3 Make parse_output_and_get_value() look at the whole line to find the word, instead of just at the beginning of each line. server-tools/instance-manager/instance_options.cc 1.31 06/04/17 09:38:45 jimw@stripped +1 -1 Look for 'Ver' to get version from running mysqld --version # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: jimw # Host: rama.(none) # Root: /home/jimw/my/mysql-5.1-19059 --- 1.554/sql/mysqld.cc 2006-04-10 08:54:36 -07:00 +++ 1.555/sql/mysqld.cc 2006-04-17 09:38:45 -07:00 @@ -6864,6 +6864,10 @@ 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); } --- 1.30/server-tools/instance-manager/instance_options.cc 2006-02-09 16:35:04 -08:00 +++ 1.31/server-tools/instance-manager/instance_options.cc 2006-04-17 09:38:45 -07:00 @@ -132,7 +132,7 @@ 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); --- 1.18/server-tools/instance-manager/parse_output.cc 2005-11-02 07:28:47 -08:00 +++ 1.19/server-tools/instance-manager/parse_output.cc 2006-04-17 09:38:45 -07:00 @@ -96,14 +96,14 @@ 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);