mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Merge mysql.com:/home/jimw/my/mysql-5.0-clean
into mysql.com:/home/jimw/my/mysql-5.1-clean BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-mysql_upgrade.dsp: Delete: VC++Files/client/mysql_upgrade.dsp BitKeeper/deleted/.del-mysql_upgrade_ia64.dsp: Delete: VC++Files/client/mysql_upgrade_ia64.dsp BitKeeper/deleted/.del-mysql_upgrade.c: Delete: client/mysql_upgrade.c VC++Files/mysql.dsw: Auto merged VC++Files/mysql.sln: Auto merged VC++Files/mysql_ia64.dsw: Auto merged client/mysql.cc: Auto merged config/ac-macros/zlib.m4: Auto merged configure.in: Auto merged extra/yassl/Makefile.am: Auto merged extra/yassl/taocrypt/Makefile.am: Auto merged include/my_global.h: Auto merged include/mysql.h: Auto merged libmysql/libmysql.def: Auto merged libmysqld/libmysqld.def: Auto merged mysql-test/r/grant2.result: Auto merged mysql-test/r/sp-security.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/trigger.result: Auto merged mysql-test/r/udf.result: Auto merged mysql-test/t/grant2.test: Auto merged mysql-test/t/rpl_openssl.test: Auto merged mysql-test/t/rpl_rotate_logs.test: Auto merged mysql-test/t/sp-security.test: Auto merged mysql-test/t/trigger.test: Auto merged sql/item.cc: Auto merged sql/item.h: Auto merged sql/item_subselect.cc: Auto merged sql-common/client.c: Auto merged sql/mysqld.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_parse.cc: Auto merged client/Makefile.am: Resolve conflict config/ac-macros/yassl.m4: Resolve conflict mysql-test/include/have_udf.inc: Resolve conflict mysql-test/lib/mtr_process.pl: Resolve conflict mysql-test/mysql-test-run.pl: Resolve conflict mysql-test/r/have_udf.require: Resolve conflict mysql-test/r/rpl_openssl.result: Resolve conflict mysql-test/t/disabled.def: Resolve conflict mysql-test/t/information_schema.test: Resolve conflict server-tools/instance-manager/instance_options.cc: Resolve conflict sql/mysql_priv.h: Resolve conflict sql/set_var.cc: Resolve conflict support-files/mysql.spec.sh: Resolve conflict
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
|
||||
#include "parse_output.h"
|
||||
#include "buffer.h"
|
||||
#include "log.h"
|
||||
|
||||
#include <my_sys.h>
|
||||
#include <signal.h>
|
||||
@ -148,6 +149,60 @@ int Instance_options::fill_instance_version()
|
||||
mysqld_version= strdup_root(&alloc, start);
|
||||
}
|
||||
err:
|
||||
if (rc)
|
||||
log_error("fill_instance_version: Failed to get version of '%s'",
|
||||
mysqld_path);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Fill mysqld_real_path
|
||||
|
||||
SYNOPSYS
|
||||
fill_mysqld_real_path()
|
||||
|
||||
DESCRIPTION
|
||||
|
||||
Get the real path to mysqld from "mysqld --help" output.
|
||||
Will print the realpath of mysqld between "Usage: " and "[OPTIONS]"
|
||||
|
||||
This is needed if the mysqld_path variable is pointing at a
|
||||
script(for example libtool) or a symlink.
|
||||
|
||||
RETURN
|
||||
0 - ok
|
||||
1 - error occured
|
||||
*/
|
||||
|
||||
int Instance_options::fill_mysqld_real_path()
|
||||
{
|
||||
char result[FN_REFLEN];
|
||||
char help_option[]= " --no-defaults --help";
|
||||
int rc= 1;
|
||||
Buffer cmd(mysqld_path_len + sizeof(help_option));
|
||||
|
||||
if (create_mysqld_command(&cmd, mysqld_path, mysqld_path_len,
|
||||
help_option, sizeof(help_option)))
|
||||
goto err;
|
||||
|
||||
bzero(result, FN_REFLEN);
|
||||
|
||||
rc= parse_output_and_get_value(cmd.buffer, "Usage: ",
|
||||
result, FN_REFLEN,
|
||||
GET_LINE);
|
||||
|
||||
if (*result != '\0')
|
||||
{
|
||||
char* options_str;
|
||||
/* chop the path of at [OPTIONS] */
|
||||
if ((options_str= strstr(result, "[OPTIONS]")))
|
||||
*options_str= '\0';
|
||||
mysqld_real_path= strdup_root(&alloc, result);
|
||||
}
|
||||
err:
|
||||
if (rc)
|
||||
log_error("fill_mysqld_real_path: Failed to get real path of mysqld");
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -408,7 +463,7 @@ int Instance_options::complete_initialization(const char *default_path,
|
||||
options_array.elements*sizeof(char*));
|
||||
argv[filled_default_options + options_array.elements]= 0;
|
||||
|
||||
if (fill_log_options() || fill_instance_version())
|
||||
if (fill_log_options() || fill_mysqld_real_path() || fill_instance_version())
|
||||
goto err;
|
||||
|
||||
return 0;
|
||||
|
@ -44,7 +44,8 @@ public:
|
||||
Instance_options() :
|
||||
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),
|
||||
mysqld_port_val(0), mysqld_path(0), mysqld_real_path(0),
|
||||
nonguarded(0), shutdown_delay(0),
|
||||
shutdown_delay_val(0), filled_default_options(0)
|
||||
{}
|
||||
~Instance_options();
|
||||
@ -84,6 +85,7 @@ public:
|
||||
uint instance_name_len;
|
||||
const char *mysqld_path;
|
||||
uint mysqld_path_len;
|
||||
const char *mysqld_real_path;
|
||||
const char *nonguarded;
|
||||
const char *shutdown_delay;
|
||||
uint shutdown_delay_val;
|
||||
@ -95,6 +97,7 @@ public:
|
||||
private:
|
||||
int fill_log_options();
|
||||
int fill_instance_version();
|
||||
int fill_mysqld_real_path();
|
||||
int add_to_argv(const char *option);
|
||||
int get_default_option(char *result, size_t result_len,
|
||||
const char *option_name);
|
||||
|
Reference in New Issue
Block a user