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

fix IM to display version string in "show instance status" (Bug #10229)

server-tools/instance-manager/buffer.h:
  fix for the valgring error
server-tools/instance-manager/commands.cc:
  sent the version string
server-tools/instance-manager/instance_options.cc:
  compute and store the version string
server-tools/instance-manager/instance_options.h:
  add a version string option, and added caching of the mysqld_path length
server-tools/instance-manager/options.cc:
  fix valgrind error
server-tools/instance-manager/parse_output.cc:
  Add an option to parse_output_and_get_value in order to be
  able to get the rest of the string after the found word in
  the output of popen() (E.g. a version string).
server-tools/instance-manager/parse_output.h:
  prototype changed
This commit is contained in:
unknown
2005-06-01 04:40:22 +04:00
parent 1c7b61e3ae
commit 26f03563f7
7 changed files with 130 additions and 36 deletions

View File

@ -38,7 +38,7 @@ class Instance_options
{
public:
Instance_options() :
mysqld_socket(0), mysqld_datadir(0),
mysqld_version(0), mysqld_socket(0), mysqld_datadir(0),
mysqld_bind_address(0), mysqld_pid_file(0), mysqld_port(0),
mysqld_port_val(0), mysqld_path(0), nonguarded(0), shutdown_delay(0),
shutdown_delay_val(0), filled_default_options(0)
@ -64,6 +64,11 @@ public:
enum { MEM_ROOT_BLOCK_SIZE= 512 };
char pid_file_with_path[MAX_PATH_LEN];
char **argv;
/*
Here we cache the version string, obtained from mysqld --version.
In the case when mysqld binary is not found we get "unknown" here.
*/
const char *mysqld_version;
/* We need the some options, so we store them as a separate pointers */
const char *mysqld_socket;
const char *mysqld_datadir;
@ -74,6 +79,7 @@ public:
const char *instance_name;
uint instance_name_len;
const char *mysqld_path;
uint mysqld_path_len;
const char *nonguarded;
const char *shutdown_delay;
uint shutdown_delay_val;
@ -84,6 +90,7 @@ public:
DYNAMIC_ARRAY options_array;
private:
int fill_log_options();
int fill_instance_version();
int add_to_argv(const char *option);
int get_default_option(char *result, size_t result_len,
const char *option_name);