Commit c1306fc0 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0-kt

into  rama.(none):/home/jimw/my/mysql-5.0-12673

parents ee513ab5 812c9cc8
...@@ -74,3 +74,6 @@ START INSTANCE mysqld1,mysqld2,mysqld3; ...@@ -74,3 +74,6 @@ START INSTANCE mysqld1,mysqld2,mysqld3;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
STOP INSTANCE mysqld1,mysqld2,mysqld3; STOP INSTANCE mysqld1,mysqld2,mysqld3;
ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use ERROR 42000: You have an error in your command syntax. Check the manual that corresponds to your MySQL Instance Manager version for the right syntax to use
STOP INSTANCE mysqld2;
ERROR HY000: Cannot stop instance. Perhaps the instance is not started, or was started manually, so IM cannot find the pidfile.
End of 5.0 tests
...@@ -218,3 +218,11 @@ START INSTANCE mysqld1,mysqld2,mysqld3; ...@@ -218,3 +218,11 @@ START INSTANCE mysqld1,mysqld2,mysqld3;
--error ER_SYNTAX_ERROR --error ER_SYNTAX_ERROR
STOP INSTANCE mysqld1,mysqld2,mysqld3; STOP INSTANCE mysqld1,mysqld2,mysqld3;
#
# Bug #12673: Instance Manager: allows to stop the instance many times
#
--error 3001
STOP INSTANCE mysqld2;
--echo End of 5.0 tests
...@@ -469,6 +469,8 @@ int Instance::stop() ...@@ -469,6 +469,8 @@ int Instance::stop()
struct timespec timeout; struct timespec timeout;
uint waitchild= (uint) DEFAULT_SHUTDOWN_DELAY; uint waitchild= (uint) DEFAULT_SHUTDOWN_DELAY;
if (is_running())
{
if (options.shutdown_delay_val) if (options.shutdown_delay_val)
waitchild= options.shutdown_delay_val; waitchild= options.shutdown_delay_val;
...@@ -478,7 +480,7 @@ int Instance::stop() ...@@ -478,7 +480,7 @@ int Instance::stop()
timeout.tv_sec= time(NULL) + waitchild; timeout.tv_sec= time(NULL) + waitchild;
timeout.tv_nsec= 0; timeout.tv_nsec= 0;
if (pthread_mutex_lock(&LOCK_instance)) if (pthread_mutex_lock(&LOCK_instance))
goto err; return ER_STOP_INSTANCE;
while (options.get_pid() != 0) /* while server isn't stopped */ while (options.get_pid() != 0) /* while server isn't stopped */
{ {
...@@ -496,10 +498,9 @@ int Instance::stop() ...@@ -496,10 +498,9 @@ int Instance::stop()
kill_instance(SIGKILL); kill_instance(SIGKILL);
return 0; return 0;
}
return ER_INSTANCE_IS_NOT_STARTED; return ER_INSTANCE_IS_NOT_STARTED;
err:
return ER_STOP_INSTANCE;
} }
#ifdef __WIN__ #ifdef __WIN__
......
...@@ -48,8 +48,8 @@ static const char *mysqld_error_message(unsigned sql_errno) ...@@ -48,8 +48,8 @@ static const char *mysqld_error_message(unsigned sql_errno)
case ER_BAD_INSTANCE_NAME: case ER_BAD_INSTANCE_NAME:
return "Bad instance name. Check that the instance with such a name exists"; return "Bad instance name. Check that the instance with such a name exists";
case ER_INSTANCE_IS_NOT_STARTED: case ER_INSTANCE_IS_NOT_STARTED:
return "Cannot stop instance. Perhaps the instance is not started, or was started" return "Cannot stop instance. Perhaps the instance is not started, or was"
"manually, so IM cannot find the pidfile."; " started manually, so IM cannot find the pidfile.";
case ER_INSTANCE_ALREADY_STARTED: case ER_INSTANCE_ALREADY_STARTED:
return "The instance is already started"; return "The instance is already started";
case ER_CANNOT_START_INSTANCE: case ER_CANNOT_START_INSTANCE:
...@@ -67,7 +67,7 @@ static const char *mysqld_error_message(unsigned sql_errno) ...@@ -67,7 +67,7 @@ static const char *mysqld_error_message(unsigned sql_errno)
return "Cannot open log file"; return "Cannot open log file";
case ER_GUESS_LOGFILE: case ER_GUESS_LOGFILE:
return "Cannot guess the log filename. Try specifying full log name" return "Cannot guess the log filename. Try specifying full log name"
"in the instance options"; " in the instance options";
case ER_ACCESS_OPTION_FILE: case ER_ACCESS_OPTION_FILE:
return "Cannot open the option file to edit. Check permissions"; return "Cannot open the option file to edit. Check permissions";
default: default:
......
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