got the last changeset to compile/run

mysqltest can run without connecting to the manager for tests that do not 
require manager operations
parent af82bc24
...@@ -92,7 +92,7 @@ static char *db = 0, *pass=0; ...@@ -92,7 +92,7 @@ static char *db = 0, *pass=0;
const char* user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./"; const char* user = 0, *host = 0, *unix_sock = 0, *opt_basedir="./";
static int port = 0, opt_big_test=0, opt_compress=0; static int port = 0, opt_big_test=0, opt_compress=0;
static uint start_lineno, *lineno; static uint start_lineno, *lineno;
const char* manager_user="root",*manager_host="localhost"; const char* manager_user="root",*manager_host=0;
char *manager_pass=0; char *manager_pass=0;
int manager_port=MYSQL_MANAGER_PORT; int manager_port=MYSQL_MANAGER_PORT;
int manager_wait_timeout=3; int manager_wait_timeout=3;
...@@ -655,6 +655,10 @@ int do_server_op(struct st_query* q,const char* op) ...@@ -655,6 +655,10 @@ int do_server_op(struct st_query* q,const char* op)
{ {
char* p=q->first_argument; char* p=q->first_argument;
char com_buf[256],*com_p; char com_buf[256],*com_p;
if (!manager)
{
die("Manager is not initialized, manager commands are not possible");
}
com_p=strmov(com_buf,op); com_p=strmov(com_buf,op);
com_p=strmov(com_p,"_exec "); com_p=strmov(com_p,"_exec ");
if (!*p) if (!*p)
...@@ -2195,8 +2199,9 @@ int main(int argc, char** argv) ...@@ -2195,8 +2199,9 @@ int main(int argc, char** argv)
if (cur_file == file_stack) if (cur_file == file_stack)
*++cur_file = stdin; *++cur_file = stdin;
*lineno=1; *lineno=1;
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
init_manager(); if (manager_host)
init_manager();
#endif #endif
if (!( mysql_init(&cur_con->mysql))) if (!( mysql_init(&cur_con->mysql)))
die("Failed in mysql_init()"); die("Failed in mysql_init()");
......
...@@ -538,7 +538,8 @@ start_manager() ...@@ -538,7 +538,8 @@ start_manager()
$MYSQL_MANAGER --log=$MYSQL_MANAGER_LOG --port=$MYSQL_MANAGER_PORT \ $MYSQL_MANAGER --log=$MYSQL_MANAGER_LOG --port=$MYSQL_MANAGER_PORT \
--password-file=$MYSQL_MANAGER_PW_FILE --password-file=$MYSQL_MANAGER_PW_FILE
abort_if_failed "Could not start MySQL manager" abort_if_failed "Could not start MySQL manager"
mysqltest_manager_args="--manager-user=$MYSQL_MANAGER_USER \ mysqltest_manager_args="--manager-host=localhost \
--manager-user=$MYSQL_MANAGER_USER \
--manager-password=$MYSQL_MANAGER_PW \ --manager-password=$MYSQL_MANAGER_PW \
--manager-port=$MYSQL_MANAGER_PORT \ --manager-port=$MYSQL_MANAGER_PORT \
--manager-wait-timeout=$START_WAIT_TIMEOUT" --manager-wait-timeout=$START_WAIT_TIMEOUT"
...@@ -600,7 +601,7 @@ start_master() ...@@ -600,7 +601,7 @@ start_master()
then then
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \ master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \
--server-id=1 --rpl-recovery-rank=1 \ --server-id=1 --rpl-recovery-rank=1 \
--basedir=$MY_BASEDIR \ --basedir=$MY_BASEDIR --init-rpl-role=master \
--port=$MASTER_MYPORT \ --port=$MASTER_MYPORT \
--exit-info=256 \ --exit-info=256 \
--datadir=$MASTER_MYDDIR \ --datadir=$MASTER_MYDDIR \
...@@ -617,7 +618,7 @@ start_master() ...@@ -617,7 +618,7 @@ start_master()
else else
master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \ master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin \
--server-id=1 --rpl-recovery-rank=1 \ --server-id=1 --rpl-recovery-rank=1 \
--basedir=$MY_BASEDIR \ --basedir=$MY_BASEDIR --init-rpl-role=master \
--port=$MASTER_MYPORT \ --port=$MASTER_MYPORT \
--datadir=$MASTER_MYDDIR \ --datadir=$MASTER_MYDDIR \
--pid-file=$MASTER_MYPID \ --pid-file=$MASTER_MYPID \
...@@ -712,7 +713,7 @@ start_slave() ...@@ -712,7 +713,7 @@ start_slave()
--socket=$slave_sock \ --socket=$slave_sock \
--character-sets-dir=$CHARSETSDIR \ --character-sets-dir=$CHARSETSDIR \
--default-character-set=$CHARACTER_SET \ --default-character-set=$CHARACTER_SET \
--core \ --core --init-rpl-role=slave \
--tmpdir=$MYSQL_TMP_DIR \ --tmpdir=$MYSQL_TMP_DIR \
--language=$LANGUAGE \ --language=$LANGUAGE \
--skip-innodb --skip-slave-start \ --skip-innodb --skip-slave-start \
......
...@@ -6,12 +6,24 @@ slave start; ...@@ -6,12 +6,24 @@ slave start;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 1 rpl_recovery_rank 1
show status like 'Rpl_status';
Variable_name Value
Rpl_status AUTH_MASTER
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 2 rpl_recovery_rank 2
show status like 'Rpl_status';
Variable_name Value
Rpl_status IDLE_SLAVE
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 3 rpl_recovery_rank 3
show status like 'Rpl_status';
Variable_name Value
Rpl_status IDLE_SLAVE
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
Variable_name Value Variable_name Value
rpl_recovery_rank 4 rpl_recovery_rank 4
show status like 'Rpl_status';
Variable_name Value
Rpl_status IDLE_SLAVE
...@@ -3,9 +3,13 @@ connect (slave_sec,localhost,root,,test,0,slave.sock-1); ...@@ -3,9 +3,13 @@ connect (slave_sec,localhost,root,,test,0,slave.sock-1);
connect (slave_ter,localhost,root,,test,0,slave.sock-2); connect (slave_ter,localhost,root,,test,0,slave.sock-2);
connection master; connection master;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave; connection slave;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave_sec; connection slave_sec;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
connection slave_ter; connection slave_ter;
show variables like 'rpl_recovery_rank'; show variables like 'rpl_recovery_rank';
show status like 'Rpl_status';
...@@ -2598,7 +2598,7 @@ enum options { ...@@ -2598,7 +2598,7 @@ enum options {
OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT, OPT_REPORT_USER, OPT_REPORT_PASSWORD, OPT_REPORT_PORT,
OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT, OPT_SHOW_SLAVE_AUTH_INFO, OPT_OLD_RPL_COMPAT,
OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE, OPT_SLAVE_LOAD_TMPDIR, OPT_NO_MIX_TYPE,
OPT_RPL_RECOVERY_RANK OPT_RPL_RECOVERY_RANK,OPT_INIT_RPL_ROLE
}; };
static struct option long_options[] = { static struct option long_options[] = {
...@@ -2634,6 +2634,7 @@ static struct option long_options[] = { ...@@ -2634,6 +2634,7 @@ static struct option long_options[] = {
{"enable-pstack", no_argument, 0, (int) OPT_DO_PSTACK}, {"enable-pstack", no_argument, 0, (int) OPT_DO_PSTACK},
{"exit-info", optional_argument, 0, 'T'}, {"exit-info", optional_argument, 0, 'T'},
{"flush", no_argument, 0, (int) OPT_FLUSH}, {"flush", no_argument, 0, (int) OPT_FLUSH},
{"init-rpl-role", required_argument, 0, (int) OPT_INIT_RPL_ROLE},
/* We must always support this option to make scripts like mysqltest easier /* We must always support this option to make scripts like mysqltest easier
to do */ to do */
{"innodb_data_file_path", required_argument, 0, {"innodb_data_file_path", required_argument, 0,
...@@ -3502,7 +3503,7 @@ static void get_options(int argc,char **argv) ...@@ -3502,7 +3503,7 @@ static void get_options(int argc,char **argv)
fprintf(stderr, "Unknown replication role: %s\n", optarg); fprintf(stderr, "Unknown replication role: %s\n", optarg);
exit(1); exit(1);
} }
rpl_status = (rpl_role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE; rpl_status = (role == 1) ? RPL_AUTH_MASTER : RPL_IDLE_SLAVE;
break; break;
} }
case (int)OPT_REPLICATE_IGNORE_DB: case (int)OPT_REPLICATE_IGNORE_DB:
......
...@@ -23,9 +23,9 @@ RPL_STATUS rpl_status=RPL_NULL; ...@@ -23,9 +23,9 @@ RPL_STATUS rpl_status=RPL_NULL;
pthread_mutex_t LOCK_rpl_status; pthread_mutex_t LOCK_rpl_status;
pthread_cond_t COND_rpl_status; pthread_cond_t COND_rpl_status;
const char *rpl_role_type[] = {"","MASTER","SLAVE",NullS}; const char *rpl_role_type[] = {"MASTER","SLAVE",NullS};
TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-4,"", TYPELIB rpl_role_typelib = {array_elements(rpl_role_type)-1,"",
rpl_role_type+1}; rpl_role_type};
const char* rpl_status_type[] = {"AUTH_MASTER","ACTIVE_SLAVE","IDLE_SLAVE", const char* rpl_status_type[] = {"AUTH_MASTER","ACTIVE_SLAVE","IDLE_SLAVE",
"LOST_SOLDIER","TROOP_SOLDIER", "LOST_SOLDIER","TROOP_SOLDIER",
......
...@@ -9,5 +9,5 @@ extern RPL_STATUS rpl_status; ...@@ -9,5 +9,5 @@ extern RPL_STATUS rpl_status;
extern pthread_mutex_t LOCK_rpl_status; extern pthread_mutex_t LOCK_rpl_status;
extern pthread_cond_t COND_rpl_status; extern pthread_cond_t COND_rpl_status;
extern TYPELIB rpl_role_typelib, rpl_status_typelib; extern TYPELIB rpl_role_typelib, rpl_status_typelib;
extern char* rpl_role_type[], *rpl_status_type; extern const char* rpl_role_type[], *rpl_status_type[];
#endif #endif
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "mysql_priv.h" #include "mysql_priv.h"
#include "sql_select.h" // For select_describe #include "sql_select.h" // For select_describe
#include "sql_acl.h" #include "sql_acl.h"
#include "repl_failsafe.h"
#include <my_dir.h> #include <my_dir.h>
#ifdef HAVE_BERKELEY_DB #ifdef HAVE_BERKELEY_DB
......
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