Commit a817bd38 authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

A slave now can optionally register with the master providing the

info on how to connect to the slave for the clients that connect to
the master, but would like to know where the slaves are
parent 196e995c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ enum enum_server_command {COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
			  COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
			  COM_DEBUG,COM_PING,COM_TIME,COM_DELAYED_INSERT,
			  COM_CHANGE_USER, COM_BINLOG_DUMP,
                          COM_TABLE_DUMP, COM_CONNECT_OUT};
                          COM_TABLE_DUMP, COM_CONNECT_OUT,
			  COM_REGISTER_SLAVE};

#define NOT_NULL_FLAG	1		/* Field can't be NULL */
#define PRI_KEY_FLAG	2		/* Field is part of a primary key */
+2 −0
Original line number Diff line number Diff line
@@ -520,6 +520,8 @@ start_slave()
	    --tmpdir=$MYSQL_TMP_DIR \
            --language=english \
	    --skip-innodb --skip-slave-start \
	    --report-host=127.0.0.1 --report-user=root \
	    --report-port=$SLAVE_MYPORT \
	     $SMALL_SERVER \
             $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
    if [ x$DO_DDD = x1 ]
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@ n
2000
2001
2002
Server_id	Host	User	Password	Port
2	127.0.0.1	root		9307
id	created
1	1970-01-01 06:25:45
id	created
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ use test;
sync_with_master;
select * from t1;
connection master;
show slave hosts;
drop table t1;
save_master_pos;
connection slave;
+1 −1
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open,
       LOCK_thread_count,LOCK_mapped_file,LOCK_user_locks, LOCK_status,
       LOCK_grant, LOCK_error_log, LOCK_delayed_insert,
       LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone,
       LOCK_binlog_update, LOCK_slave, LOCK_server_id;
       LOCK_binlog_update, LOCK_slave, LOCK_server_id, LOCK_slave_list;
extern pthread_cond_t COND_refresh,COND_thread_count, COND_binlog_update,
                      COND_slave_stopped, COND_slave_start;
extern pthread_attr_t connection_attrib;
Loading