Commit 1c3cd1fd authored by unknown's avatar unknown

Merged.

parent 089595c5
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id =2 server_id = 2
-------------------------------------------------------------------- --------------------------------------------------------------------
SHOW INSTANCES; SHOW INSTANCES;
instance_name state instance_name state
...@@ -20,8 +20,8 @@ mysqld3 offline ...@@ -20,8 +20,8 @@ mysqld3 offline
mysqld2 offline mysqld2 offline
mysqld1 online mysqld1 online
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id =2 server_id = 2
-------------------------------------------------------------------- --------------------------------------------------------------------
CREATE INSTANCE mysqld1; CREATE INSTANCE mysqld1;
ERROR HY000: Instance already exists ERROR HY000: Instance already exists
......
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id =2 server_id = 2
-------------------------------------------------------------------- --------------------------------------------------------------------
SHOW VARIABLES LIKE 'server_id'; SHOW VARIABLES LIKE 'server_id';
Variable_name Value Variable_name Value
...@@ -99,13 +99,13 @@ ERROR HY000: The instance is active. Stop the instance first ...@@ -99,13 +99,13 @@ ERROR HY000: The instance is active. Stop the instance first
UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc; UNSET mysqld2.server_id, mysqld3.server_id, mysqld.ccc;
ERROR HY000: Bad instance name. Check that the instance with such a name exists ERROR HY000: Bad instance name. Check that the instance with such a name exists
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id=2 server_id=2
-------------------------------------------------------------------- --------------------------------------------------------------------
UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc; UNSET mysqld2.server_id, mysqld3.server_id, mysqld1.ccc;
ERROR HY000: The instance is active. Stop the instance first ERROR HY000: The instance is active. Stop the instance first
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id=2 server_id=2
-------------------------------------------------------------------- --------------------------------------------------------------------
DROP INSTANCE mysqld3; DROP INSTANCE mysqld3;
...@@ -115,7 +115,7 @@ SET mysqld2.server_id = 222 ; ...@@ -115,7 +115,7 @@ SET mysqld2.server_id = 222 ;
SET mysqld2 . server_id = 222 ; SET mysqld2 . server_id = 222 ;
SET mysqld2 . server_id = 222 , mysqld2 . aaa , mysqld2 . bbb ; SET mysqld2 . server_id = 222 , mysqld2 . aaa , mysqld2 . bbb ;
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id=222 server_id=222
-------------------------------------------------------------------- --------------------------------------------------------------------
aaa aaa
...@@ -124,13 +124,13 @@ bbb ...@@ -124,13 +124,13 @@ bbb
-------------------------------------------------------------------- --------------------------------------------------------------------
UNSET mysqld2 . aaa , mysqld2 . bbb ; UNSET mysqld2 . aaa , mysqld2 . bbb ;
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id=222 server_id=222
-------------------------------------------------------------------- --------------------------------------------------------------------
-------------------------------------------------------------------- --------------------------------------------------------------------
-------------------------------------------------------------------- --------------------------------------------------------------------
-------------------------------------------------------------------- --------------------------------------------------------------------
server_id =1 server_id = 1
server_id=222 server_id=222
-------------------------------------------------------------------- --------------------------------------------------------------------
SHOW VARIABLES LIKE 'server_id'; SHOW VARIABLES LIKE 'server_id';
......
...@@ -9,6 +9,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc ...@@ -9,6 +9,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc
instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc
mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc mysqlmanager.cc options.cc parse.cc parse_output.cc priv.cc protocol.cc
thread_registry.cc user_map.cc imservice.cpp windowsservice.cpp thread_registry.cc user_map.cc imservice.cpp windowsservice.cpp
user_management_commands.cc
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c ../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
../../libmysql/errmsg.c) ../../libmysql/errmsg.c)
......
...@@ -89,6 +89,9 @@ Instance_options::Instance_options() ...@@ -89,6 +89,9 @@ Instance_options::Instance_options()
mysqld_path.str= NULL; mysqld_path.str= NULL;
mysqld_path.length= 0; mysqld_path.length= 0;
mysqld_real_path.str= NULL;
mysqld_real_path.length= 0;
memset(logs, 0, sizeof(logs)); memset(logs, 0, sizeof(logs));
} }
...@@ -206,12 +209,12 @@ int Instance_options::fill_instance_version() ...@@ -206,12 +209,12 @@ int Instance_options::fill_instance_version()
int Instance_options::fill_mysqld_real_path() int Instance_options::fill_mysqld_real_path()
{ {
char result[FN_REFLEN]; char result[FN_REFLEN];
char help_option[]= " --no-defaults --help"; LEX_STRING help_option=
{ C_STRING_WITH_SIZE(" --no-defaults --help") };
int rc= 1; int rc= 1;
Buffer cmd(mysqld_path_len + sizeof(help_option)); Buffer cmd(mysqld_path.length + help_option.length);
if (create_mysqld_command(&cmd, mysqld_path, mysqld_path_len, if (create_mysqld_command(&cmd, &mysqld_path, &help_option))
help_option, sizeof(help_option)))
goto err; goto err;
bzero(result, FN_REFLEN); bzero(result, FN_REFLEN);
...@@ -226,7 +229,8 @@ int Instance_options::fill_mysqld_real_path() ...@@ -226,7 +229,8 @@ int Instance_options::fill_mysqld_real_path()
/* chop the path of at [OPTIONS] */ /* chop the path of at [OPTIONS] */
if ((options_str= strstr(result, "[OPTIONS]"))) if ((options_str= strstr(result, "[OPTIONS]")))
*options_str= '\0'; *options_str= '\0';
mysqld_real_path= strdup_root(&alloc, result); mysqld_real_path.str= strdup_root(&alloc, result);
mysqld_real_path.length= strlen(mysqld_real_path.str);
} }
err: err:
if (rc) if (rc)
......
...@@ -365,10 +365,10 @@ static void angel() ...@@ -365,10 +365,10 @@ static void angel()
pid= getpid(); /* Get our pid. */ pid= getpid(); /* Get our pid. */
log_info("Angel pid file: '%s'; PID: %d.", log_info("Angel pid file: '%s'; PID: %d.",
(const char *) options.angel_pid_file_name, (const char *) Options::Daemon::angel_pid_file_name,
(int) pid); (int) pid);
create_pid_file(Options::angel_pid_file_name, pid); create_pid_file(Options::Daemon::angel_pid_file_name, pid);
while (child_status == CHILD_OK && is_terminated == 0) while (child_status == CHILD_OK && is_terminated == 0)
sigsuspend(&zeromask); sigsuspend(&zeromask);
......
...@@ -67,7 +67,7 @@ static int setup_windows_defaults(); ...@@ -67,7 +67,7 @@ static int setup_windows_defaults();
my_bool Options::Daemon::run_as_service= FALSE; my_bool Options::Daemon::run_as_service= FALSE;
const char *Options::Daemon::log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME); const char *Options::Daemon::log_file_name= QUOTE(DEFAULT_LOG_FILE_NAME);
const char *Options::Daemon::user= NULL; /* No default value */ const char *Options::Daemon::user= NULL; /* No default value */
const char *Options::angel_pid_file_name= NULL; const char *Options::Daemon::angel_pid_file_name= NULL;
const char *Options::Main::config_file= QUOTE(DEFAULT_CONFIG_FILE); const char *Options::Main::config_file= QUOTE(DEFAULT_CONFIG_FILE);
const char * const char *
...@@ -155,8 +155,8 @@ static struct my_option my_long_options[] = ...@@ -155,8 +155,8 @@ static struct my_option my_long_options[] =
#ifndef __WIN__ #ifndef __WIN__
{ "angel-pid-file", OPT_ANGEL_PID_FILE, "Pid file for angel process.", { "angel-pid-file", OPT_ANGEL_PID_FILE, "Pid file for angel process.",
(gptr *) &Options::angel_pid_file_name, (gptr *) &Options::Daemon::angel_pid_file_name,
(gptr *) &Options::angel_pid_file_name, (gptr *) &Options::Daemon::angel_pid_file_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
#endif #endif
...@@ -507,8 +507,8 @@ void Options::cleanup() ...@@ -507,8 +507,8 @@ void Options::cleanup()
delete User_management::cmd; delete User_management::cmd;
#ifndef __WIN__ #ifndef __WIN__
if (Options::run_as_service) if (Options::Daemon::run_as_service)
free((void *) Options::angel_pid_file_name); free((void *) Options::Daemon::angel_pid_file_name);
#endif #endif
} }
......
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