List:Commits« Previous MessageNext Message »
From:Li-Bing.Song Date:April 1 2010 11:34am
Subject:bzr commit into mysql-5.1 branch (Li-Bing.Song:3368)
View as plain text  
#At file:///home/anders/work/bzrwork/mysql-5.1-wl4677/ based on revid:build@stripped

 3368 Li-Bing.Song@stripped	2010-04-01
      Master_UUID is added into the slave's status. It is a dynamic value,
      so it have to be replaced by a constant string.
      It is better to use include/show_slave_status2.inc
      
      Master_UUID is added into the slave's status. It is a dynamic value,
      so it have to be replaced by a constant string.
     @ mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/include/show_slave_hosts.inc
        It is an auxiliary file for 'SHOW SLAVE HOSTS'.
        Slave_UUID is different between different server,
        so it have to be replaced by a constant string.
     @ mysql-test/include/show_slave_status.inc
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/include/show_slave_status2.inc
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/include/test_fieldsize.inc
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysql-test/suite/parts/r/rpl_partition.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/parts/t/rpl_partition.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysql-test/suite/rpl/r/rpl_000015.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_bug33931.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_change_master.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_flushlog_loop.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
        Add test for getting master's UUID
     @ mysql-test/suite/rpl/r/rpl_grant.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_incident.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_log_pos.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_replicate_do.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_rotate_logs.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_colSize.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_log.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_log_innodb.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_reset_slave.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_row_until.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_skip_error.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_slave_skip.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_ssl.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_ssl1.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_stm_log.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_stm_until.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/r/rpl_temporary_errors.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl/t/rpl_bug33931.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_flushlog_loop.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_incident.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status.inc
     @ mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_replicate_do.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysql-test/suite/rpl/t/rpl_row_until.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_slave_skip.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status.inc
     @ mysql-test/suite/rpl/t/rpl_ssl.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl/t/rpl_ssl1.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
        Master_UUID is added into the slave's status.
        So the result of the test have to be updated.
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
        Master_UUID is added into the slave's status. It is a dynamic value,
        so it have to be replaced by a constant string.
        It is better to use include/show_slave_status2.inc
     @ mysys/default.c
        This patch calls my_load_default without default_directories argument.
     @ sql/mysqld.cc
        The global variable for server_uuid. It is initialized when mysqld
        start and does not be changed when mysqld running. 
        When starting, it checks whether there is a uuid in auto.cnf file.
        it will call generate_server_uuid function to generate a uuid if there
        is no uuid in auto.cnf or auto.cnf does not exist. The uuid will be stored into auto.cnf if it is a new one.
     @ sql/repl_failsafe.cc
        Slave's uuid is added into the result of 'SHOW SLAVE HOSTS' command.
        Every dump thread has a user veriable called '@slave_uuid' which is 
        set by slave I/O thread when connecting. We can call get_slave_uuid to
        get each slave's uuid.
     @ sql/rpl_mi.cc
        master's UUID should be written into master.info.
        It is in the last line of master.info if master's uuid exists.
     @ sql/rpl_mi.h
        Master_info shall has a master_uuid variable.
        It will be set after slave I/O thread connects to master and 
        will be written into master.info file.
     @ sql/set_var.cc
        There is a system global variable called '@@server_uuid'.
        It is read only.
     @ sql/slave.cc
        When slave I/O thread connects to master, it calls get_master_uuid
        function to get master's uuid and set mi->master_uuid.
        It will be in the result of 'SHOW SLAVE STATUS'.
     @ sql/sql_parse.cc
        Because of bug#33815, we use slave's uuid instead of slave's server_id
        to kill a zombie dump thread.
     @ sql/sql_repl.cc
        Because of bug#33815, we use slave's uuid instead of slave's server_id
        to kill a zombie dump thread.

    added:
      mysql-test/include/show_slave_hosts.inc
      mysql-test/r/server_uuid.result
      mysql-test/suite/rpl/r/rpl_server_uuid.result
      mysql-test/suite/rpl/t/rpl_server_uuid.cnf
      mysql-test/suite/rpl/t/rpl_server_uuid.test
      mysql-test/t/server_uuid.test
    modified:
      mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
      mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test
      mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
      mysql-test/include/show_slave_status.inc
      mysql-test/include/show_slave_status2.inc
      mysql-test/include/test_fieldsize.inc
      mysql-test/suite/parts/r/rpl_partition.result
      mysql-test/suite/parts/t/rpl_partition.test
      mysql-test/suite/rpl/r/rpl_000015.result
      mysql-test/suite/rpl/r/rpl_bug33931.result
      mysql-test/suite/rpl/r/rpl_change_master.result
      mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
      mysql-test/suite/rpl/r/rpl_extraCol_innodb.result
      mysql-test/suite/rpl/r/rpl_extraCol_myisam.result
      mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
      mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
      mysql-test/suite/rpl/r/rpl_flushlog_loop.result
      mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result
      mysql-test/suite/rpl/r/rpl_grant.result
      mysql-test/suite/rpl/r/rpl_incident.result
      mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
      mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
      mysql-test/suite/rpl/r/rpl_log_pos.result
      mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
      mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
      mysql-test/suite/rpl/r/rpl_replicate_do.result
      mysql-test/suite/rpl/r/rpl_rotate_logs.result
      mysql-test/suite/rpl/r/rpl_row_colSize.result
      mysql-test/suite/rpl/r/rpl_row_log.result
      mysql-test/suite/rpl/r/rpl_row_log_innodb.result
      mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
      mysql-test/suite/rpl/r/rpl_row_reset_slave.result
      mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
      mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
      mysql-test/suite/rpl/r/rpl_row_until.result
      mysql-test/suite/rpl/r/rpl_skip_error.result
      mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
      mysql-test/suite/rpl/r/rpl_slave_skip.result
      mysql-test/suite/rpl/r/rpl_ssl.result
      mysql-test/suite/rpl/r/rpl_ssl1.result
      mysql-test/suite/rpl/r/rpl_stm_log.result
      mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
      mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
      mysql-test/suite/rpl/r/rpl_stm_until.result
      mysql-test/suite/rpl/r/rpl_temporary_errors.result
      mysql-test/suite/rpl/t/rpl_bug33931.test
      mysql-test/suite/rpl/t/rpl_flushlog_loop.test
      mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
      mysql-test/suite/rpl/t/rpl_incident.test
      mysql-test/suite/rpl/t/rpl_known_bugs_detection.test
      mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test
      mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
      mysql-test/suite/rpl/t/rpl_replicate_do.test
      mysql-test/suite/rpl/t/rpl_row_until.test
      mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test
      mysql-test/suite/rpl/t/rpl_slave_skip.test
      mysql-test/suite/rpl/t/rpl_ssl.test
      mysql-test/suite/rpl/t/rpl_ssl1.test
      mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result
      mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result
      mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test
      mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test
      mysys/default.c
      sql/mysql_priv.h
      sql/mysqld.cc
      sql/repl_failsafe.cc
      sql/rpl_mi.cc
      sql/rpl_mi.h
      sql/set_var.cc
      sql/slave.cc
      sql/slave.h
      sql/sql_parse.cc
      sql/sql_repl.cc
      sql/sql_repl.h
=== modified file 'mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2009-02-05 09:49:32 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2010-04-01 11:34:04 +0000
@@ -149,8 +149,7 @@ SELECT * FROM t1 ORDER BY f3 LIMIT 20;
 --echo
 --echo * Show Slave Status *
 --echo
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical show slave status;
+source include/show_slave_status2.inc;
 --echo
 
 ### Altering table def scenario
@@ -438,9 +437,7 @@ connection master;
    sync_slave_with_master;
    select * from t31;
 
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical show slave status;
+source include/show_slave_status2.inc;
 
 #### Clean Up ####
 
@@ -498,9 +495,7 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,
 --echo
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -555,9 +550,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing
 --echo
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -698,9 +691,7 @@ SELECT c1,c3,hex(c4),c5,c6 FROM t14 ORDE
 #***************************
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 #***************************
 
 STOP SLAVE;
@@ -764,9 +755,7 @@ SELECT c1,hex(c4),c5,c6,c7,c2 FROM t15 O
 --echo
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 STOP SLAVE;
 RESET SLAVE;
 
@@ -841,9 +830,7 @@ SELECT c1,hex(c4),c5,c6,c7 FROM t16 ORDE
 --echo
 connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 STOP SLAVE;
 RESET SLAVE;
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test'
--- a/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2009-10-22 00:21:50 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test	2010-04-01 11:34:04 +0000
@@ -97,9 +97,7 @@ SELECT * FROM t2 ORDER BY a;
 connection slave;
 START SLAVE;
 source include/wait_for_slave_sql_to_stop.inc;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 STOP SLAVE;
 RESET SLAVE;
 SELECT * FROM t2 ORDER BY a;
@@ -150,9 +148,7 @@ INSERT INTO t3 () VALUES(@b1,2,'Kyle, TE
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -195,9 +191,7 @@ INSERT INTO t4 () VALUES(100.22,2,'Kyle,
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -240,9 +234,7 @@ INSERT INTO t5 () VALUES(1,'Kyle',200.23
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -286,9 +278,7 @@ INSERT INTO t6 () VALUES(1,'Kyle',200.23
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
 #START SLAVE;
 
@@ -388,9 +378,7 @@ INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(
 
 #connection slave;
 #wait_for_slave_to_stop;
-#--replace_result $MASTER_MYPORT MASTER_PORT
-#--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
-#--query_vertical SHOW SLAVE STATUS
+#source include/show_slave_status2.inc;
 #SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 #START SLAVE;
 
@@ -452,9 +440,7 @@ if (`SELECT $engine_type != 'NDB'`)
   # and add/restore waiting for stop test
 
   #--source include/wait_for_slave_sql_to_stop.inc
-  #--replace_result $MASTER_MYPORT MASTER_PORT
-  #--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
-  #--query_vertical SHOW SLAVE STATUS
+  #source include/show_slave_status2.inc;
   #SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
   #START SLAVE;
 }
@@ -495,9 +481,7 @@ INSERT INTO t10 () VALUES(1,@b1,'Kyle'),
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -539,9 +523,7 @@ INSERT INTO t11 () VALUES(1,@b1,'Kyle'),
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -811,9 +793,7 @@ ALTER TABLE t15 ADD COLUMN c6 INT AFTER 
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 
@@ -922,9 +902,7 @@ INSERT INTO t17 () VALUES(92233720368547
 --echo ********************************************
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_tabledefs.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test	2009-10-22 00:10:42 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test	2010-04-01 11:34:04 +0000
@@ -139,7 +139,7 @@ sync_slave_with_master;
 --echo **** On Slave ****
 SELECT * FROM t2;
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> 39 #
 --query_vertical SHOW SLAVE STATUS
 
 connection master;
@@ -151,7 +151,7 @@ INSERT INTO t4 VALUES (4);
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> 39 #
 --query_vertical SHOW SLAVE STATUS
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
@@ -165,7 +165,7 @@ INSERT INTO t5 VALUES (5,10,25);
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> 39 #
 --query_vertical SHOW SLAVE STATUS
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
@@ -179,7 +179,7 @@ INSERT INTO t6 VALUES (6,12,36);
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> 39 #
 --query_vertical SHOW SLAVE STATUS
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
@@ -188,7 +188,7 @@ connection master;
 INSERT INTO t9 VALUES (6);
 sync_slave_with_master;
 --replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error>
+--replace_column 1 # 4 # 7 # 8 # 9 # 20 <Last_Error> 22 # 23 # 33 # 35 <Last_IO_Errno> 36 <Last_IO_Error> 38 <Last_SQL_Error> 39 #
 --query_vertical SHOW SLAVE STATUS
 
 # Testing some tables extra field that can be null and cannot be null

=== added file 'mysql-test/include/show_slave_hosts.inc'
--- a/mysql-test/include/show_slave_hosts.inc	1970-01-01 00:00:00 +0000
+++ b/mysql-test/include/show_slave_hosts.inc	2010-04-01 11:34:04 +0000
@@ -0,0 +1,3 @@
+--replace_result $SLAVE_MYPORT SLAVE_PORT $DEFAULT_MASTER_PORT DEFAULT_PORT
+--replace_regex /[0-9, a-f]{8}-[0-9, a-f]{4}-[0-9, a-f]{4}-[0-9, a-f]{4}-[0-9, a-f]{12}/SLAVE_UUID/
+SHOW SLAVE HOSTS;

=== modified file 'mysql-test/include/show_slave_status.inc'
--- a/mysql-test/include/show_slave_status.inc	2007-06-11 20:15:39 +0000
+++ b/mysql-test/include/show_slave_status.inc	2010-04-01 11:34:04 +0000
@@ -2,5 +2,5 @@
 # that varies depending on where the test is executed.
 
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;

=== modified file 'mysql-test/include/show_slave_status2.inc'
--- a/mysql-test/include/show_slave_status2.inc	2008-01-14 07:38:02 +0000
+++ b/mysql-test/include/show_slave_status2.inc	2010-04-01 11:34:04 +0000
@@ -4,5 +4,5 @@
 # masked out log positions
 
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;

=== modified file 'mysql-test/include/test_fieldsize.inc'
--- a/mysql-test/include/test_fieldsize.inc	2007-08-10 16:48:01 +0000
+++ b/mysql-test/include/test_fieldsize.inc	2010-04-01 11:34:04 +0000
@@ -23,9 +23,7 @@ eval $test_insert;
 connection slave;
 START SLAVE;
 wait_for_slave_to_stop;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 22 # 23 # 33 # 35 # 36 #
---query_vertical SHOW SLAVE STATUS
+source include/show_slave_status2.inc;
 
 # The following should be 0
 SELECT COUNT(*) FROM t1;

=== added file 'mysql-test/r/server_uuid.result'
--- a/mysql-test/r/server_uuid.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/r/server_uuid.result	2010-04-01 11:34:04 +0000
@@ -0,0 +1,19 @@
+CALL mtr.add_suppression("Master's UUID has changed, its old UUID is");
+
+# Case 1:
+# @@SERVER_UUID is readonly.
+-----------------------------------------------------------------------------
+SET GLOBAL SERVER_UUID= UUID();
+ERROR HY000: Variable 'server_uuid' is a read only variable
+
+# Case 2:
+# If the file does not exists, mysqld generates it automatically.
+-----------------------------------------------------------------------------
+
+# Case 3:
+# If there is no UUID in the file, mysqld generates it automatically.
+-----------------------------------------------------------------------------
+
+# Case 4:
+# If there is a UUID in the file, it will be loaded into SERVER_UUID.
+-----------------------------------------------------------------------------

=== modified file 'mysql-test/suite/parts/r/rpl_partition.result'
--- a/mysql-test/suite/parts/r/rpl_partition.result	2009-02-01 12:00:48 +0000
+++ b/mysql-test/suite/parts/r/rpl_partition.result	2010-04-01 11:34:04 +0000
@@ -138,11 +138,11 @@ SUBPARTITIONS 2
  PARTITION pa9 VALUES LESS THAN (90) ENGINE = InnoDB,
  PARTITION pa10 VALUES LESS THAN (100) ENGINE = InnoDB,
  PARTITION pa11 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
-show slave status;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	MASTER_MYPORT
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -154,7 +154,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0

=== modified file 'mysql-test/suite/parts/t/rpl_partition.test'
--- a/mysql-test/suite/parts/t/rpl_partition.test	2009-02-01 12:00:48 +0000
+++ b/mysql-test/suite/parts/t/rpl_partition.test	2010-04-01 11:34:04 +0000
@@ -144,9 +144,7 @@ SELECT count(*) as "Master byrange" FROM
 --sync_slave_with_master
 connection slave;
 show create table t3; 
---replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
-show slave status;
+source include/show_slave_status2.inc;
 SELECT count(*) "Slave norm" FROM t1;
 SELECT count(*) "Slave bykey" FROM t2;
 SELECT count(*) "Slave byrange" FROM t3;

=== modified file 'mysql-test/suite/rpl/r/rpl_000015.result'
--- a/mysql-test/suite/rpl/r/rpl_000015.result	2008-01-30 11:53:33 +0000
+++ b/mysql-test/suite/rpl/r/rpl_000015.result	2010-04-01 11:34:04 +0000
@@ -44,6 +44,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 change master to master_host='127.0.0.1',master_user='root',
 master_password='',master_port=MASTER_PORT;
 SHOW SLAVE STATUS;
@@ -85,6 +86,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -125,6 +127,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 drop table if exists t1;
 create table t1 (n int, PRIMARY KEY(n));
 insert into t1 values (10),(45),(90);

=== modified file 'mysql-test/suite/rpl/r/rpl_bug33931.result'
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result	2009-08-28 14:13:27 +0000
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result	2010-04-01 11:34:04 +0000
@@ -43,4 +43,5 @@ Last_IO_Errno	0
 Last_IO_Error	
 Last_SQL_Errno	#
 Last_SQL_Error	Failed during slave thread initialization
+Master_UUID	#
 SET GLOBAL debug="";

=== modified file 'mysql-test/suite/rpl/r/rpl_change_master.result'
--- a/mysql-test/suite/rpl/r/rpl_change_master.result	2008-01-14 07:38:02 +0000
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result	2010-04-01 11:34:04 +0000
@@ -50,6 +50,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 change master to master_user='root';
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -90,6 +91,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave;
 select * from t1;
 n

=== modified file 'mysql-test/suite/rpl/r/rpl_deadlock_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result	2009-04-03 21:33:13 +0000
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result	2010-04-01 11:34:04 +0000
@@ -89,6 +89,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 *** Test lock wait timeout ***
 include/stop_slave.inc
@@ -151,6 +152,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 *** Test lock wait timeout and purged relay logs ***
 SET @my_max_relay_log_size= @@global.max_relay_log_size;
@@ -218,6 +220,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 *** Clean up ***
 DROP TABLE t1,t2,t3;

=== modified file 'mysql-test/suite/rpl/r/rpl_extraCol_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result	2009-10-22 00:10:42 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_innodb.result	2010-04-01 11:34:04 +0000
@@ -58,7 +58,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -93,6 +93,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 SELECT * FROM t2 ORDER BY a;
@@ -125,7 +126,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -160,6 +161,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t3  ***
@@ -187,7 +189,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -222,6 +224,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t4  ***
@@ -249,7 +252,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -284,6 +287,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t5  ***
@@ -310,7 +314,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -345,6 +349,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
 *** Drop t6  ***
 DROP TABLE t6;
@@ -446,7 +451,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -481,6 +486,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t10  ***
@@ -507,7 +513,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -542,6 +548,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t11  ***
@@ -757,7 +764,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -792,6 +799,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1060
 Last_SQL_Error	Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 *** Try to insert in master ****
@@ -897,7 +905,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -932,6 +940,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 ** DROP table t17 ***

=== modified file 'mysql-test/suite/rpl/r/rpl_extraCol_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result	2009-10-22 00:10:42 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraCol_myisam.result	2010-04-01 11:34:04 +0000
@@ -58,7 +58,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -93,6 +93,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 size mismatch - master has size 10, test.t2 on slave has size 6. Master's column size should be <= the slave's column size.
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 SELECT * FROM t2 ORDER BY a;
@@ -125,7 +126,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -160,6 +161,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 252, test.t3 has type 3
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t3  ***
@@ -187,7 +189,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -222,6 +224,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 246, test.t4 has type 3
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t4  ***
@@ -249,7 +252,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -284,6 +287,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 5 type mismatch - received type 4, test.t5 has type 246
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t5  ***
@@ -310,7 +314,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -345,6 +349,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 3 type mismatch - received type 16, test.t6 has type 3
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=3;
 *** Drop t6  ***
 DROP TABLE t6;
@@ -446,7 +451,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -481,6 +486,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 254, test.t10 has type 5
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t10  ***
@@ -507,7 +513,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -542,6 +548,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 15, test.t11 has type 252
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 *** Drop t11  ***
@@ -757,7 +764,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -792,6 +799,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1060
 Last_SQL_Error	Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5'
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 *** Try to insert in master ****
@@ -897,7 +905,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -932,6 +940,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 8, test.t17 has type 2
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 ** DROP table t17 ***

=== modified file 'mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2009-02-05 09:49:32 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2010-04-01 11:34:04 +0000
@@ -94,11 +94,11 @@ f1	f2	f3	f4
 
 * Show Slave Status *
 
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -110,7 +110,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -133,6 +133,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 
 ***** Testing Altering table def scenario *****
@@ -470,11 +471,11 @@ delete from t31;
 
 select * from t31;
 f1	f2	f3	f4
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -486,7 +487,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -509,6 +510,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 ****************************************
 * columns in master at middle of table *
@@ -548,7 +550,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -560,7 +562,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -583,6 +585,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -623,7 +626,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -635,7 +638,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -658,6 +661,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -774,7 +778,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -786,7 +790,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1091
@@ -809,6 +813,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -860,7 +865,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -872,7 +877,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1054
@@ -895,6 +900,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -946,7 +952,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -958,7 +964,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1072
@@ -981,6 +987,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -1235,11 +1242,11 @@ f1	f2	f3	f4
 
 * Show Slave Status *
 
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1251,7 +1258,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -1274,6 +1281,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 
 ***** Testing Altering table def scenario *****
@@ -1611,11 +1619,11 @@ delete from t31;
 
 select * from t31;
 f1	f2	f3	f4
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1627,7 +1635,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -1650,6 +1658,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 ****************************************
 * columns in master at middle of table *
@@ -1689,7 +1698,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1701,7 +1710,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -1724,6 +1733,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -1764,7 +1774,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1776,7 +1786,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -1799,6 +1809,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -1915,7 +1926,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1927,7 +1938,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1091
@@ -1950,6 +1961,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -2001,7 +2013,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2013,7 +2025,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1054
@@ -2036,6 +2048,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -2087,7 +2100,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2099,7 +2112,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1072
@@ -2122,6 +2135,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -2376,11 +2390,11 @@ f1	f2	f3	f4
 
 * Show Slave Status *
 
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2392,7 +2406,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -2415,6 +2429,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 
 ***** Testing Altering table def scenario *****
@@ -2752,11 +2767,11 @@ delete from t31;
 
 select * from t31;
 f1	f2	f3	f4
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2768,7 +2783,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -2791,6 +2806,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 ****************************************
 * columns in master at middle of table *
@@ -2830,7 +2846,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2842,7 +2858,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -2865,6 +2881,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -2905,7 +2922,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2917,7 +2934,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -2940,6 +2957,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -3056,7 +3074,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -3068,7 +3086,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1091
@@ -3091,6 +3109,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -3142,7 +3161,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -3154,7 +3173,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1054
@@ -3177,6 +3196,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -3228,7 +3248,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -3240,7 +3260,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1072
@@ -3263,6 +3283,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 

=== modified file 'mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2009-02-05 09:49:32 +0000
+++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2010-04-01 11:34:04 +0000
@@ -94,11 +94,11 @@ f1	f2	f3	f4
 
 * Show Slave Status *
 
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -110,7 +110,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -133,6 +133,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 
 ***** Testing Altering table def scenario *****
@@ -470,11 +471,11 @@ delete from t31;
 
 select * from t31;
 f1	f2	f3	f4
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -486,7 +487,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -509,6 +510,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 ****************************************
 * columns in master at middle of table *
@@ -548,7 +550,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -560,7 +562,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -583,6 +585,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -623,7 +626,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -635,7 +638,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -658,6 +661,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -774,7 +778,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -786,7 +790,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1091
@@ -809,6 +813,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -860,7 +865,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -872,7 +877,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1054
@@ -895,6 +900,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -946,7 +952,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -958,7 +964,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1072
@@ -981,6 +987,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -1235,11 +1242,11 @@ f1	f2	f3	f4
 
 * Show Slave Status *
 
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1251,7 +1258,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -1274,6 +1281,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 
 ***** Testing Altering table def scenario *****
@@ -1611,11 +1619,11 @@ delete from t31;
 
 select * from t31;
 f1	f2	f3	f4
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1627,7 +1635,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -1650,6 +1658,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 ****************************************
 * columns in master at middle of table *
@@ -1689,7 +1698,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1701,7 +1710,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -1724,6 +1733,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -1764,7 +1774,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1776,7 +1786,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -1799,6 +1809,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -1915,7 +1926,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -1927,7 +1938,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1091
@@ -1950,6 +1961,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -2001,7 +2013,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2013,7 +2025,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1054
@@ -2036,6 +2048,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -2087,7 +2100,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2099,7 +2112,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1072
@@ -2122,6 +2135,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -2376,11 +2390,11 @@ f1	f2	f3	f4
 
 * Show Slave Status *
 
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2392,7 +2406,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -2415,6 +2429,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 
 ***** Testing Altering table def scenario *****
@@ -2752,11 +2767,11 @@ delete from t31;
 
 select * from t31;
 f1	f2	f3	f4
-show slave status;;
+SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2768,7 +2783,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -2791,6 +2806,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 
 ****************************************
 * columns in master at middle of table *
@@ -2830,7 +2846,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2842,7 +2858,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -2865,6 +2881,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 5, test.t10 has type 254
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -2905,7 +2922,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -2917,7 +2934,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1535
@@ -2940,6 +2957,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 2 type mismatch - received type 252, test.t11 has type 15
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 
@@ -3056,7 +3074,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -3068,7 +3086,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1091
@@ -3091,6 +3109,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1091
 Last_SQL_Error	Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -3142,7 +3161,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -3154,7 +3173,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1054
@@ -3177,6 +3196,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1054
 Last_SQL_Error	Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 
@@ -3228,7 +3248,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -3240,7 +3260,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	1072
@@ -3263,6 +3283,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1072
 Last_SQL_Error	Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)'
+Master_UUID	#
 STOP SLAVE;
 RESET SLAVE;
 

=== modified file 'mysql-test/suite/rpl/r/rpl_flushlog_loop.result'
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result	2008-11-12 17:51:47 +0000
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result	2010-04-01 11:34:04 +0000
@@ -59,3 +59,4 @@ Last_IO_Errno	#
 Last_IO_Error	
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#

=== modified file 'mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result'
--- a/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result	2010-01-27 02:52:13 +0000
+++ b/mysql-test/suite/rpl/r/rpl_get_master_version_and_clock.result	2010-04-01 11:34:04 +0000
@@ -7,6 +7,7 @@ start slave;
 call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
 call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
 call mtr.add_suppression("Slave I/O thread .* register on master");
+call mtr.add_suppression("Slave I/O: Get master SERVER_UUID failed with error");
 SELECT IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP");
 IS_FREE_LOCK("debug_lock.before_get_UNIX_TIMESTAMP")
 1
@@ -35,6 +36,20 @@ RELEASE_LOCK("debug_lock.before_get_SERV
 1
 Check network error happened here
 NETWORK ERROR
+SELECT IS_FREE_LOCK("debug_lock.before_get_MASTER_UUID");
+IS_FREE_LOCK("debug_lock.before_get_MASTER_UUID")
+1
+SELECT GET_LOCK("debug_lock.before_get_MASTER_UUID", 1000);
+GET_LOCK("debug_lock.before_get_MASTER_UUID", 1000)
+1
+set global debug= 'd,debug_lock.before_get_MASTER_UUID';
+stop slave;
+start slave;
+SELECT RELEASE_LOCK("debug_lock.before_get_MASTER_UUID");
+RELEASE_LOCK("debug_lock.before_get_MASTER_UUID")
+1
+Check network error happened here
+NETWORK ERROR
 set global debug= '';
 reset master;
 include/stop_slave.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_grant.result'
--- a/mysql-test/suite/rpl/r/rpl_grant.result	2008-10-03 15:54:22 +0000
+++ b/mysql-test/suite/rpl/r/rpl_grant.result	2010-04-01 11:34:04 +0000
@@ -80,3 +80,4 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#

=== modified file 'mysql-test/suite/rpl/r/rpl_incident.result'
--- a/mysql-test/suite/rpl/r/rpl_incident.result	2007-10-26 20:40:48 +0000
+++ b/mysql-test/suite/rpl/r/rpl_incident.result	2010-04-01 11:34:04 +0000
@@ -64,6 +64,7 @@ Last_IO_Errno	0
 Last_IO_Error	
 Last_SQL_Errno	1590
 Last_SQL_Error	The incident LOST_EVENTS occured on the master. Message: <none>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 SELECT * FROM t1;
@@ -111,4 +112,5 @@ Last_IO_Errno	0
 Last_IO_Error	
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_known_bugs_detection.result'
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result	2007-06-27 12:29:10 +0000
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result	2010-04-01 11:34:04 +0000
@@ -50,6 +50,7 @@ Last_IO_Errno	0
 Last_IO_Error	
 Last_SQL_Errno	1105
 Last_SQL_Error	Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'
+Master_UUID	#
 SELECT * FROM t1;
 a	b
 stop slave;
@@ -141,6 +142,7 @@ SELECT t2.field_a, t2.field_b, t2.field_
 FROM t2
 ON DUPLICATE KEY UPDATE
 t1.field_3 = t2.field_c'
+Master_UUID	#
 SELECT * FROM t1;
 id	field_1	field_2	field_3
 drop table t1, t2;

=== modified file 'mysql-test/suite/rpl/r/rpl_loaddata_fatal.result'
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result	2009-12-06 01:11:32 +0000
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result	2010-04-01 11:34:04 +0000
@@ -45,6 +45,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -85,6 +86,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1593
 Last_SQL_Error	Fatal error: Not enough memory
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_log_pos.result'
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result	2009-09-24 13:19:06 +0000
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result	2010-04-01 11:34:04 +0000
@@ -49,6 +49,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave;
 include/stop_slave.inc
 SHOW SLAVE STATUS;
@@ -90,6 +91,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB
 master-bin.000001	#	<Binlog_Do_DB>	<Binlog_Ignore_DB>

=== modified file 'mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result'
--- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result	2008-11-04 17:07:14 +0000
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result	2010-04-01 11:34:04 +0000
@@ -12,9 +12,9 @@ n
 2000
 2001
 2002
-show slave hosts;
-Server_id	Host	Port	Rpl_recovery_rank	Master_id
-2	127.0.0.1	9999	0	1
+SHOW SLAVE HOSTS;
+Server_id	Host	Port	Rpl_recovery_rank	Master_id	Slave_UUID
+2	127.0.0.1	SLAVE_PORT	0	1	SLAVE_UUID
 drop table t1;
 stop slave;
 create table t2(id int auto_increment primary key, created datetime);

=== modified file 'mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result'
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result	2009-05-31 05:44:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result	2010-04-01 11:34:04 +0000
@@ -63,6 +63,7 @@ Last_IO_Errno	#
 Last_IO_Error	
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 SHOW BINLOG EVENTS;
 Log_name	Pos	Event_type	Server_id	End_log_pos	Info
 slave-bin.000001	#	Format_desc	2	#	Server ver: VERSION, Binlog ver: 4

=== modified file 'mysql-test/suite/rpl/r/rpl_replicate_do.result'
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result	2010-04-01 11:34:04 +0000
@@ -42,7 +42,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	test.t1
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -65,6 +65,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 create table t1 (ts timestamp);
 set one_shot time_zone='met';
 insert into t1 values('2005-08-12 00:00:00');

=== modified file 'mysql-test/suite/rpl/r/rpl_rotate_logs.result'
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2009-03-12 09:48:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2010-04-01 11:34:04 +0000
@@ -53,6 +53,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 select * from t1;
 s
 Could not break slave
@@ -132,6 +133,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 select * from t2;
 m
 34
@@ -196,6 +198,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 lock tables t3 read;
 select count(*) from t3 where n >= 4;
 count(*)

=== modified file 'mysql-test/suite/rpl/r/rpl_row_colSize.result'
--- a/mysql-test/suite/rpl/r/rpl_row_colSize.result	2007-10-27 22:09:24 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result	2010-04-01 11:34:04 +0000
@@ -22,7 +22,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -57,6 +57,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -76,7 +77,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -111,6 +112,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 12, test.t1 on slave has size 12. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -130,7 +132,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -165,6 +167,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 10, test.t1 on slave has size 3. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -185,7 +188,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -220,6 +223,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 type mismatch - received type 5, test.t1 has type 4
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -240,7 +244,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -275,6 +279,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 8, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -294,7 +299,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -329,6 +334,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 2. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -349,7 +355,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -384,6 +390,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -404,7 +411,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -439,6 +446,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 20, test.t1 on slave has size 11. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -490,7 +498,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -525,6 +533,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 2, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -545,7 +554,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -580,6 +589,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 100. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -599,7 +609,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -634,6 +644,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 200, test.t1 on slave has size 10. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -653,7 +664,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -688,6 +699,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 2000, test.t1 on slave has size 1000. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0
@@ -708,7 +720,7 @@ SHOW SLAVE STATUS;
 Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
-Master_Port	#
+Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
 Read_Master_Log_Pos	#
@@ -743,6 +755,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	1535
 Last_SQL_Error	Table definition on master and slave does not match: Column 0 size mismatch - master has size 4, test.t1 on slave has size 1. Master's column size should be <= the slave's column size.
+Master_UUID	#
 SELECT COUNT(*) FROM t1;
 COUNT(*)
 0

=== modified file 'mysql-test/suite/rpl/r/rpl_row_log.result'
--- a/mysql-test/suite/rpl/r/rpl_row_log.result	2009-05-31 05:44:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result	2010-04-01 11:34:04 +0000
@@ -283,6 +283,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_log_innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result	2009-05-31 05:44:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result	2010-04-01 11:34:04 +0000
@@ -283,6 +283,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_max_relay_size.result'
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result	2008-11-13 19:19:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result	2010-04-01 11:34:04 +0000
@@ -60,6 +60,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 2
 #
@@ -108,6 +109,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 3: max_relay_log_size = 0
 #
@@ -156,6 +158,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
 #
@@ -201,6 +204,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 5
 #
@@ -247,6 +251,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
 #
@@ -291,6 +296,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 flush logs;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB

=== modified file 'mysql-test/suite/rpl/r/rpl_row_reset_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result	2009-06-03 14:14:18 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result	2010-04-01 11:34:04 +0000
@@ -43,6 +43,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 stop slave;
 change master to master_user='test';
 SHOW SLAVE STATUS;
@@ -84,6 +85,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 reset slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -124,6 +126,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -164,6 +167,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 stop slave;
 reset slave;
 start slave;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result'
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result	2009-10-22 00:10:42 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result	2010-04-01 11:34:04 +0000
@@ -157,6 +157,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 INSERT INTO t9 VALUES (4);
 INSERT INTO t4 VALUES (4);
 SHOW SLAVE STATUS;
@@ -198,6 +199,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	1535
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (5);
@@ -241,6 +243,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	1535
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -284,6 +287,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	1535
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -326,6 +330,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 INSERT INTO t7 VALUES (1),(2),(3);
 INSERT INTO t8 VALUES (1),(2),(3);
 SELECT * FROM t7 ORDER BY a;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result'
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result	2009-10-22 00:10:42 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result	2010-04-01 11:34:04 +0000
@@ -157,6 +157,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 INSERT INTO t9 VALUES (4);
 INSERT INTO t4 VALUES (4);
 SHOW SLAVE STATUS;
@@ -198,6 +199,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	1535
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (5);
@@ -241,6 +243,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	1535
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -284,6 +287,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	1535
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=2;
 START SLAVE;
 INSERT INTO t9 VALUES (6);
@@ -326,6 +330,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	0
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 INSERT INTO t7 VALUES (1),(2),(3);
 INSERT INTO t8 VALUES (1),(2),(3);
 SELECT * FROM t7 ORDER BY a;

=== modified file 'mysql-test/suite/rpl/r/rpl_row_until.result'
--- a/mysql-test/suite/rpl/r/rpl_row_until.result	2009-02-19 20:29:12 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result	2010-04-01 11:34:04 +0000
@@ -59,6 +59,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 START SLAVE UNTIL MASTER_LOG_FILE='master-no-such-bin.000001', MASTER_LOG_POS=291;
 SELECT * FROM t1;
 n
@@ -105,6 +106,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 START SLAVE UNTIL RELAY_LOG_FILE='slave-relay-bin.000002', RELAY_LOG_POS=relay_pos_insert1_t2
 SELECT * FROM t2;
 n
@@ -149,6 +151,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 START SLAVE;
 include/stop_slave.inc
 START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2
@@ -191,6 +194,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 START SLAVE UNTIL MASTER_LOG_FILE='master-bin', MASTER_LOG_POS=561;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL
 START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=561, RELAY_LOG_POS=12;

=== added file 'mysql-test/suite/rpl/r/rpl_server_uuid.result'
--- a/mysql-test/suite/rpl/r/rpl_server_uuid.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_server_uuid.result	2010-04-01 11:34:04 +0000
@@ -0,0 +1,88 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CALL mtr.add_suppression("master and slave have equal MySQL server UUIDs");
+CALL mtr.add_suppression("Master's UUID has changed, its old UUID is");
+
+# Case 1:
+# Master's UUID appears in the result of 'SHOW SLAVE STATUS'.
+# Slave's UUID appears in the resule of 'SHOW SLAVE HOSTS'.
+-----------------------------------------------------------------------------
+SHOW SLAVE HOSTS;
+Server_id	Host	Port	Rpl_recovery_rank	Master_id	Slave_UUID
+2	127.0.0.1	SLAVE_PORT	0	1	SLAVE_UUID
+
+# Case 2: 
+# After executing 'STOP SLAVE [IO_THREAD|SQL_THREAD]' successfully, Master's UUID
+# is still kept into Slave status.
+-----------------------------------------------------------------------------
+STOP SLAVE IO_THREAD;
+STOP SLAVE SQL_THREAD;
+START SLAVE;
+STOP SLAVE;
+
+# Case 3:
+# Slave generates an errror and aborts, if master's UUID is
+# equal to slave's UUID unless --replicate-same-server-id
+# option is set.
+-----------------------------------------------------------------------------
+START SLAVE IO_THREAD;
+Last_IO_Error
+Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work.
+
+# slave2 is running with --replicate-same-server-id option 
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1',
+MASTER_PORT= MASTER_PORT,
+MASTER_USER= 'root',
+MASTER_LOG_FILE='master-bin.000001';
+START SLAVE;
+Last_IO_Error
+
+STOP SLAVE;
+
+# Case 4:
+# When executing 'CHANGE MASTER ...', master's UUID and server_id will be
+# cleared if master_host or/and master_port are changed.
+# Master's UUID and server_id will not be cleared if both master_port
+# and master_host are not changed.
+-----------------------------------------------------------------------------
+START SLAVE IO_THREAD;
+STOP SLAVE;
+
+# Only change MASTER_PORT
+CHANGE MASTER TO MASTER_PORT= 1111;
+CHANGE MASTER TO MASTER_PORT= MASTER_PORT,
+MASTER_LOG_FILE= 'master-bin.000004', MASTER_LOG_POS= MASTER_POS;
+START SLAVE IO_THREAD;
+
+# Only change MASTER_HOST
+STOP SLAVE IO_THREAD;
+CHANGE MASTER TO MASTER_HOST= 'localhost';
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1',
+MASTER_LOG_FILE= 'master-bin.000004', MASTER_LOG_POS= MASTER_POS;
+START SLAVE IO_THREAD;
+
+# Both MASTER_HOST and MASTER_PORT are changed
+STOP SLAVE IO_THREAD;
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= 1111;
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= MASTER_PORT,
+MASTER_LOG_FILE= 'master-bin.000004', MASTER_LOG_POS= MASTER_POS;
+START SLAVE IO_THREAD;
+
+# Both MASTER_HOST and MASTER_PORT are NOT changed
+STOP SLAVE IO_THREAD;
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= MASTER_PORT;
+CHANGE MASTER TO 
+MASTER_LOG_FILE= 'master-bin.000004', MASTER_LOG_POS= MASTER_POS;
+
+# Case 5:
+# After executing 'RESET SLAVE' successfully, Master's UUID is still kept 
+# into Slave status.
+-----------------------------------------------------------------------------
+RESET SLAVE;
+CHANGE MASTER TO 
+MASTER_LOG_FILE= 'master-bin.000004', MASTER_LOG_POS= MASTER_POS;
+START SLAVE;

=== modified file 'mysql-test/suite/rpl/r/rpl_skip_error.result'
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result	2009-07-10 23:12:13 +0000
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result	2010-04-01 11:34:04 +0000
@@ -70,6 +70,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 ==== Clean Up ====
 drop table t1;
 create table t1(a int primary key);
@@ -123,6 +124,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 ==== Clean Up ====
 drop table t1;
 ==== Using Innodb ====

=== modified file 'mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result	2009-09-01 11:38:17 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result	2010-04-01 11:34:04 +0000
@@ -49,6 +49,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	9
 Last_SQL_Error	Error in Begin_load_query event: write to '../../tmp/SQL_LOAD.data' failed
+Master_UUID	#
 drop table t1;
 drop table t1;
 call mtr.add_suppression("Slave: Error writing file 'UNKNOWN' .Errcode: 9. Error_code: 3");

=== modified file 'mysql-test/suite/rpl/r/rpl_slave_skip.result'
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result	2009-05-31 05:44:41 +0000
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result	2010-04-01 11:34:04 +0000
@@ -59,7 +59,7 @@ Slave_SQL_Running	No
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -82,6 +82,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 SELECT * FROM t1;
@@ -123,7 +124,7 @@ Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
@@ -146,6 +147,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 **** On Master ****
 DROP TABLE t1, t2;
 SET SESSION BINLOG_FORMAT=ROW;

=== modified file 'mysql-test/suite/rpl/r/rpl_ssl.result'
--- a/mysql-test/suite/rpl/r/rpl_ssl.result	2007-06-27 12:29:10 +0000
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result	2010-04-01 11:34:04 +0000
@@ -58,6 +58,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 STOP SLAVE;
 select * from t1;
 t
@@ -102,6 +103,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 drop user replssl@localhost;
 drop table t1;
 End of 5.0 tests

=== modified file 'mysql-test/suite/rpl/r/rpl_ssl1.result'
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result	2007-06-27 12:29:10 +0000
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result	2010-04-01 11:34:04 +0000
@@ -57,6 +57,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 stop slave;
 change master to master_user='root',master_password='', master_ssl=0;
 start slave;
@@ -101,6 +102,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 stop slave;
 change master to
 master_host="localhost",
@@ -155,4 +157,5 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 drop table t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_log.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result	2009-12-06 01:11:32 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result	2010-04-01 11:34:04 +0000
@@ -265,6 +265,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 show binlog events in 'slave-bin.000005' from 4;
 ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result	2008-01-14 07:38:02 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result	2010-04-01 11:34:04 +0000
@@ -60,6 +60,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 2
 #
@@ -108,6 +109,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 3: max_relay_log_size = 0
 #
@@ -156,6 +158,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 4: Tests below are mainly to ensure that we have not coded with wrong assumptions
 #
@@ -201,6 +204,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 5
 #
@@ -247,6 +251,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 #
 # Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
 #
@@ -291,6 +296,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 flush logs;
 show master status;
 File	Position	Binlog_Do_DB	Binlog_Ignore_DB

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_reset_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result	2009-06-03 14:14:18 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result	2010-04-01 11:34:04 +0000
@@ -43,6 +43,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 stop slave;
 change master to master_user='test';
 SHOW SLAVE STATUS;
@@ -84,6 +85,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 reset slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -124,6 +126,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave;
 SHOW SLAVE STATUS;
 Slave_IO_State	#
@@ -164,6 +167,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 stop slave;
 reset slave;
 start slave;

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_until.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result	2010-01-27 17:27:49 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result	2010-04-01 11:34:04 +0000
@@ -63,6 +63,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave until master_log_file='master-no-such-bin.000001', master_log_pos=291;
 select * from t1;
 n
@@ -109,6 +110,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave until relay_log_file='slave-relay-bin.000004', relay_log_pos=746;
 select * from t2;
 n
@@ -153,6 +155,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 start slave;
 [on master]
 [on slave]
@@ -197,6 +200,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 ==== Test various error conditions ====
 start slave until master_log_file='master-bin', master_log_pos=561;
 ERROR HY000: Incorrect parameter or combination of parameters for START SLAVE UNTIL

=== modified file 'mysql-test/suite/rpl/r/rpl_temporary_errors.result'
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result	2008-10-13 18:33:08 +0000
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result	2010-04-01 11:34:04 +0000
@@ -79,6 +79,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 DROP TABLE t1;
 **** On Master ****
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl/t/rpl_bug33931.test'
--- a/mysql-test/suite/rpl/t/rpl_bug33931.test	2009-08-28 14:13:27 +0000
+++ b/mysql-test/suite/rpl/t/rpl_bug33931.test	2010-04-01 11:34:04 +0000
@@ -38,7 +38,7 @@ connection slave;
 source include/wait_for_slave_to_stop.inc;
 
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 #
+--replace_column 1 # 8 # 9 # 19 # 23 # 33 # 37 # 39 #
 query_vertical show slave status;
 
 #

=== modified file 'mysql-test/suite/rpl/t/rpl_flushlog_loop.test'
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test	2008-11-12 17:51:47 +0000
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test	2010-04-01 11:34:04 +0000
@@ -67,7 +67,7 @@ source include/wait_for_slave_param.inc;
 #  Show status of slave
 #
 --replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
---replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
+--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 # 39 #
 --query_vertical SHOW SLAVE STATUS
 
 --disable_query_log

=== modified file 'mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test'
--- a/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test	2010-01-27 02:52:13 +0000
+++ b/mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test	2010-04-01 11:34:04 +0000
@@ -21,6 +21,7 @@ connection slave;
 call mtr.add_suppression("Slave I/O: Master command COM_REGISTER_SLAVE failed: .*");
 call mtr.add_suppression("Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; .*");
 call mtr.add_suppression("Slave I/O thread .* register on master");
+call mtr.add_suppression("Slave I/O: Get master SERVER_UUID failed with error");
 
 #Test case 1: Try to get the value of the UNIX_TIMESTAMP from master under network disconnection
 let $debug_saved= `select @@global.debug`;
@@ -41,9 +42,18 @@ eval SELECT GET_LOCK($debug_lock, 1000);
 set global debug= 'd,debug_lock.before_get_SERVER_ID';
 source extra/rpl_tests/rpl_get_master_version_and_clock.test;
 
+#Test case 3: Try to get the value of the MASTER_UUID from master under network disconnection
+connection slave;
+let $debug_lock= "debug_lock.before_get_MASTER_UUID";
+eval SELECT IS_FREE_LOCK($debug_lock);
+eval SELECT GET_LOCK($debug_lock, 1000);
+
+set global debug= 'd,debug_lock.before_get_MASTER_UUID';
+source extra/rpl_tests/rpl_get_master_version_and_clock.test;
+
 eval set global debug= '$debug_saved';
 
-#Test case 3: This test checks that the slave I/O thread refuses to start
+#Test case 4: This test checks that the slave I/O thread refuses to start
 #if slave and master have the same server id.
 connection slave;
 reset master;

=== modified file 'mysql-test/suite/rpl/t/rpl_incident.test'
--- a/mysql-test/suite/rpl/t/rpl_incident.test	2009-05-02 19:28:54 +0000
+++ b/mysql-test/suite/rpl/t/rpl_incident.test	2010-04-01 11:34:04 +0000
@@ -24,7 +24,7 @@ source include/wait_for_slave_sql_error.
 SELECT * FROM t1;
 
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # 39 #
 --query_vertical SHOW SLAVE STATUS
 
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
@@ -36,7 +36,7 @@ START SLAVE;
 
 SELECT * FROM t1;
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 22 # 23 # 33 # 39 #
 --query_vertical SHOW SLAVE STATUS
 
 connection master;

=== modified file 'mysql-test/suite/rpl/t/rpl_known_bugs_detection.test'
--- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test	2010-04-01 11:34:04 +0000
@@ -27,7 +27,7 @@ SELECT * FROM t1;
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 # show the error message
---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # 39 #
 --query_vertical show slave status;
 # show that it was not replicated
 SELECT * FROM t1;
@@ -81,7 +81,7 @@ SELECT * FROM t1;
 connection slave;
 --source include/wait_for_slave_sql_to_stop.inc
 # show the error message
---replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 23 # 33 # 39 #
 --query_vertical show slave status;
 # show that it was not replicated
 SELECT * FROM t1;

=== modified file 'mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test'
--- a/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test	2007-06-27 12:28:02 +0000
+++ b/mysql-test/suite/rpl/t/rpl_mixed_ddl_dml.test	2010-04-01 11:34:04 +0000
@@ -13,8 +13,7 @@ insert into t1 values (NULL),(NULL),(NUL
 sync_slave_with_master;
 select * from t1;
 connection master;
---replace_result $SLAVE_MYPORT 9999
-show slave hosts;
+--source include/show_slave_hosts.inc
 drop table t1;
 sync_slave_with_master;
 stop slave;

=== modified file 'mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test'
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test	2008-07-16 09:17:10 +0000
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test	2010-04-01 11:34:04 +0000
@@ -23,7 +23,7 @@ SHOW BINLOG EVENTS;
 sync_slave_with_master;
 --echo **** On Slave ****
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 # 34 # 35 #
+--replace_column 1 # 8 # 9 # 23 # 33 # 34 # 35 # 39 #
 --query_vertical SHOW SLAVE STATUS
 --replace_result $VERSION VERSION
 --replace_column 2 # 5 #

=== modified file 'mysql-test/suite/rpl/t/rpl_replicate_do.test'
--- a/mysql-test/suite/rpl/t/rpl_replicate_do.test	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test	2010-04-01 11:34:04 +0000
@@ -31,9 +31,7 @@ save_master_pos;
 connection slave;
 sync_with_master;
 # show slave status, just to see of it prints replicate-do-table
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
-query_vertical SHOW SLAVE STATUS;
+--source include/show_slave_status2.inc
 
 #
 # BUG#12542

=== modified file 'mysql-test/suite/rpl/t/rpl_row_until.test'
--- a/mysql-test/suite/rpl/t/rpl_row_until.test	2009-02-19 20:29:12 +0000
+++ b/mysql-test/suite/rpl/t/rpl_row_until.test	2010-04-01 11:34:04 +0000
@@ -55,7 +55,7 @@ eval START SLAVE UNTIL MASTER_LOG_FILE='
 # Here table should be still not deleted
 SELECT * FROM t1;
 --replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;
 
 # This should fail right after start
@@ -64,7 +64,7 @@ START SLAVE UNTIL MASTER_LOG_FILE='maste
 # again this table should be still not deleted
 SELECT * FROM t1;
 --replace_result $master_pos_drop_t1 MASTER_POS_DROP_T1
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;
 
 # Try replicate all up to and not including the second insert to t2;
@@ -75,7 +75,7 @@ eval START SLAVE UNTIL RELAY_LOG_FILE='s
 --source include/wait_for_slave_sql_to_stop.inc
 SELECT * FROM t2;
 --replace_result $relay_pos_insert1_t2 RELAY_POS_INSERT1_T2 $master_pos_insert1_t2 MASTER_POS_INSERT1_T2
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;
 
 # clean up
@@ -97,7 +97,7 @@ let $slave_param_value= $master_pos_crea
 # here the sql slave thread should be stopped
 --replace_result bin.000005 bin.000004 bin.000006 bin.000004 bin.000007 bin.000004
 --replace_result $master_pos_create_t2 MASTER_POS_CREATE_T2 $master_pos_drop_t2 MASTER_POS_DROP_T2
---replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 16 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;
 
 #testing various error conditions

=== added file 'mysql-test/suite/rpl/t/rpl_server_uuid.cnf'
--- a/mysql-test/suite/rpl/t/rpl_server_uuid.cnf	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_uuid.cnf	2010-04-01 11:34:04 +0000
@@ -0,0 +1,8 @@
+!include ../my.cnf
+
+[mysqld.3]
+replicate-same-server-id=1
+
+[ENV]
+SLAVE_MYPORT1=		@mysqld.3.port
+SLAVE_MYSOCK1=		@mysqld.3.socket

=== added file 'mysql-test/suite/rpl/t/rpl_server_uuid.test'
--- a/mysql-test/suite/rpl/t/rpl_server_uuid.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_uuid.test	2010-04-01 11:34:04 +0000
@@ -0,0 +1,287 @@
+##############################################################################
+# WL#4677 Unique Server Ids for Replication Topology (UUIDs)                 #
+#
+# Master and slave exchange their UUID each other when connecting. Master's
+# UUID is set into the result of 'SHOW SLAVE STATUS' and stored into
+# master.info file. Slave's UUID appears in the result of 'SHOW SLAVE HOSTS'.
+# Slave and master cannot have the same UUID, except
+# --replicate-same-server-id is set.
+#
+##############################################################################
+--source include/master-slave.inc
+
+CALL mtr.add_suppression("master and slave have equal MySQL server UUIDs");
+CALL mtr.add_suppression("Master's UUID has changed, its old UUID is");
+
+--let $uuid_file= auto.cnf
+
+--let $master_datadir=`SELECT @@DATADIR`
+connection slave;
+--let $slave_datadir=`SELECT @@DATADIR`
+
+connect (slave2,127.0.0.1,root,,test,$SLAVE_MYPORT1,);
+connection slave2;
+--let $slave2_datadir=`SELECT @@DATADIR`
+
+connection master;
+--let $original_master_uuid=query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+--copy_file $master_datadir/$uuid_file $master_datadir/original_$uuid_file
+
+--echo
+--echo # Case 1:
+--echo # Master's UUID appears in the result of 'SHOW SLAVE STATUS'.
+--echo # Slave's UUID appears in the resule of 'SHOW SLAVE HOSTS'.
+--echo -----------------------------------------------------------------------------
+connection master;
+--let $master_uuid_on_master= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+--let $slave_uuid_on_master= query_get_value(SHOW SLAVE HOSTS, Slave_UUID, 1)
+
+--source include/show_slave_hosts.inc
+
+connection slave;
+--let $slave_uuid_on_slave= query_get_value(SHOW VARIABLES LIKE 'SERVER_UUID', Value, 1)
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+
+if (`SELECT '$master_uuid_on_slave' <> '$master_uuid_on_master'`)
+{
+  --echo master_uuid_on_slave <> master_uuid_on_master
+  --echo $master_uuid_on_slave <> $master_uuid_on_master
+}
+
+if (`SELECT '$slave_uuid_on_slave' <> '$slave_uuid_on_master'`)
+{
+  --echo slave_uuid_on_slave <> slave_uuid_on_master
+  --echo $slave_uuid_on_slave <> $slave_uuid_on_master
+}
+
+--echo 
+--echo # Case 2: 
+--echo # After executing 'STOP SLAVE [IO_THREAD|SQL_THREAD]' successfully, Master's UUID
+--echo # is still kept into Slave status.
+--echo -----------------------------------------------------------------------------
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+if (`SELECT '$master_uuid_on_slave' <> '$master_uuid_on_master'`)
+{
+  --echo master_uuid_on_slave <> master_uuid_on_master
+  --echo $master_uuid_on_slave <> $master_uuid_on_master
+}
+
+STOP SLAVE SQL_THREAD;
+--source include/wait_for_slave_sql_to_stop.inc
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+if (`SELECT '$master_uuid_on_slave' <> '$master_uuid_on_master'`)
+{
+  --echo master_uuid_on_slave <> master_uuid_on_master
+  --echo $master_uuid_on_slave <> $master_uuid_on_master
+}
+
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+if (`SELECT '$master_uuid_on_slave' <> '$master_uuid_on_master'`)
+{
+  --echo master_uuid_on_slave <> master_uuid_on_master
+  --echo $master_uuid_on_slave <> $master_uuid_on_master
+}
+
+--echo
+--echo # Case 3:
+--echo # Slave generates an errror and aborts, if master's UUID is
+--echo # equal to slave's UUID unless --replicate-same-server-id
+--echo # option is set.
+--echo -----------------------------------------------------------------------------
+connection master;
+# copy slave's server_properties file to master, so master will have a same
+# UUID as slave.
+--remove_file $master_datadir/$uuid_file
+--copy_file $slave_datadir/$uuid_file $master_datadir/$uuid_file
+--source include/restart_mysqld.inc
+
+connection slave;
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+--let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1)
+echo Last_IO_Error;
+echo $last_error;
+
+connection master;
+--remove_file $master_datadir/$uuid_file
+--copy_file $slave2_datadir/$uuid_file $master_datadir/$uuid_file
+--source include/restart_mysqld.inc
+let $master_log_file= query_get_value(SHOW MASTER STATUS, 'File', 1);
+let $master_log_pos= query_get_value(SHOW MASTER STATUS, 'Position', 1);
+
+--echo 
+--echo # slave2 is running with --replicate-same-server-id option 
+connection slave2;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1',
+     MASTER_PORT= $MASTER_MYPORT,
+     MASTER_USER= 'root',
+     MASTER_LOG_FILE='master-bin.000001';
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--let $last_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1)
+echo Last_IO_Error;
+echo $last_error;
+
+connection master;
+sync_slave_with_master slave2;
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+
+connection master;
+--remove_file $master_datadir/$uuid_file
+--move_file $master_datadir/original_$uuid_file $master_datadir/$uuid_file
+--source include/restart_mysqld.inc
+
+--echo
+--echo # Case 4:
+--echo # When executing 'CHANGE MASTER ...', master's UUID and server_id will be
+--echo # cleared if master_host or/and master_port are changed.
+--echo # Master's UUID and server_id will not be cleared if both master_port
+--echo # and master_host are not changed.
+--echo -----------------------------------------------------------------------------
+connection slave;
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+--let $show_statement= SHOW SLAVE STATUS
+--let $field= Master_UUID
+--let $condition= <> '$original_master_uuid'
+--source include/wait_show_condition.inc
+STOP SLAVE;
+--source include/wait_for_slave_to_stop.inc
+
+--echo
+--echo # Only change MASTER_PORT
+let $old_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $old_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+
+CHANGE MASTER TO MASTER_PORT= 1111;
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+#--let $master_server_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1)
+#if (`SELECT '$master_uuid_on_slave' <> '' || $master_server_id <> 0`)
+if (`SELECT '$master_uuid_on_slave' <> ''`)
+{
+  --echo Master_UUID $master_uuid_on_slave
+  #--echo Master_Server_Id $master_server_id
+}
+
+--replace_result $MASTER_MYPORT MASTER_PORT $old_master_log_pos MASTER_POS
+eval CHANGE MASTER TO MASTER_PORT= $MASTER_MYPORT,
+       MASTER_LOG_FILE= '$old_master_log_file', MASTER_LOG_POS= $old_master_log_pos;
+START SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_start.inc
+--let $show_statement= SHOW SLAVE STATUS
+--let $field= Master_UUID
+--let $condition= <> '$original_master_uuid'
+--source include/wait_show_condition.inc
+
+--echo
+--echo # Only change MASTER_HOST
+STOP SLAVE IO_THREAD;
+--source include/wait_for_slave_io_to_stop.inc
+let $old_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $old_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+
+CHANGE MASTER TO MASTER_HOST= 'localhost';
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+#--let $master_server_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1)
+#if (`SELECT '$master_uuid_on_slave' <> '' || $master_server_id <> 0`)
+if (`SELECT '$master_uuid_on_slave' <> ''`)
+{
+  --echo Master_UUID $master_uuid_on_slave
+  #--echo Master_Server_Id $master_server_id
+}
+
+--replace_result $MASTER_MYPORT MASTER_PORT $old_master_log_pos MASTER_POS
+eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1',
+       MASTER_LOG_FILE= '$old_master_log_file', MASTER_LOG_POS= $old_master_log_pos;
+START SLAVE IO_THREAD;
+--let $show_statement= SHOW SLAVE STATUS
+--let $field= Master_UUID
+--let $condition= <> '$original_master_uuid'
+--source include/wait_show_condition.inc
+
+--echo
+--echo # Both MASTER_HOST and MASTER_PORT are changed
+STOP SLAVE IO_THREAD;
+let $old_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $old_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+
+--source include/wait_for_slave_io_to_stop.inc
+CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= 1111;
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+#--let $master_server_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1)
+#if (`SELECT '$master_uuid_on_slave' <> '' || $master_server_id <> 0`)
+if (`SELECT '$master_uuid_on_slave' <> ''`)
+{
+  --echo Master_UUID $master_uuid_on_slave 
+  #--echo Master_Server_Id $master_server_id
+}
+
+--replace_result $MASTER_MYPORT MASTER_PORT $old_master_log_pos MASTER_POS
+eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= $MASTER_MYPORT,
+       MASTER_LOG_FILE= '$old_master_log_file', MASTER_LOG_POS= $old_master_log_pos;
+START SLAVE IO_THREAD;
+--let $show_statement= SHOW SLAVE STATUS
+--let $field= Master_UUID
+--let $condition= <> '$original_master_uuid'
+--source include/wait_show_condition.inc
+
+--echo
+--echo # Both MASTER_HOST and MASTER_PORT are NOT changed
+STOP SLAVE IO_THREAD;
+let $old_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $old_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+
+--source include/wait_for_slave_io_to_stop.inc
+--replace_result $MASTER_MYPORT MASTER_PORT $old_master_log_pos MASTER_POS
+eval CHANGE MASTER TO MASTER_HOST= '127.0.0.1', MASTER_PORT= $MASTER_MYPORT;
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+#--let $master_server_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1)
+#if (`SELECT '$master_uuid_on_slave' = '' || $master_server_id = 0`)
+if (`SELECT '$master_uuid_on_slave' = ''`)
+{
+  --echo Master_UUID $master_uuid_on_slave
+  #--echo Master_Server_Id $master_server_id
+}
+
+--replace_result $MASTER_MYPORT MASTER_PORT $old_master_log_pos MASTER_POS
+eval CHANGE MASTER TO 
+       MASTER_LOG_FILE= '$old_master_log_file', MASTER_LOG_POS= $old_master_log_pos;
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+#--let $master_server_id= query_get_value(SHOW SLAVE STATUS, Master_Server_Id, 1)
+#if (`SELECT '$master_uuid_on_slave' = '' || $master_server_id = 0`)
+if (`SELECT '$master_uuid_on_slave' = ''`)
+{
+  --echo Master_UUID $master_uuid_on_slave 
+  #--echo Master_Server_Id $master_server_id
+}
+
+--echo
+--echo # Case 5:
+--echo # After executing 'RESET SLAVE' successfully, Master's UUID is still kept 
+--echo # into Slave status.
+--echo -----------------------------------------------------------------------------
+connection slave;
+let $old_master_log_file= query_get_value(SHOW SLAVE STATUS, Master_Log_File, 1);
+let $old_master_log_pos= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
+
+RESET SLAVE;
+--let $master_uuid_on_slave= query_get_value(SHOW SLAVE STATUS, Master_UUID, 1)
+if (`SELECT '$master_uuid_on_slave' = ''`)
+{
+  --echo Master's UUID is null
+}
+
+--replace_result $MASTER_MYPORT MASTER_PORT $old_master_log_pos MASTER_POS
+eval CHANGE MASTER TO 
+       MASTER_LOG_FILE= '$old_master_log_file', MASTER_LOG_POS= $old_master_log_pos;
+START SLAVE;
+--source include/wait_for_slave_to_start.inc
+--source include/master-slave-end.inc

=== modified file 'mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test	2009-09-01 11:38:17 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_load_remove_tmpfile.test	2010-04-01 11:34:04 +0000
@@ -34,7 +34,7 @@ connection slave;
 source include/wait_for_slave_sql_to_stop.inc;
 
 --replace_result $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 --replace_regex /SQL_LOAD-[0-9]-[0-9]-[0-9]*/SQL_LOAD/
 query_vertical show slave status;
 

=== modified file 'mysql-test/suite/rpl/t/rpl_slave_skip.test'
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test	2009-01-23 12:22:05 +0000
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test	2010-04-01 11:34:04 +0000
@@ -28,9 +28,7 @@ connection slave;
 # Stop when reaching the the first table map event.
 START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=762;
 wait_for_slave_to_stop;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 #
-query_vertical SHOW SLAVE STATUS;
+--source include/show_slave_status.inc
 
 # Now we skip *one* table map event. If the execution starts right
 # after that table map event, *one* of the involved tables will be
@@ -63,9 +61,7 @@ wait_for_slave_to_stop;
 SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
 START SLAVE;
 sync_with_master;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 8 # 9 # 23 # 33 # 35 # 36 #
-query_vertical SHOW SLAVE STATUS;
+--source include/show_slave_status.inc
 
 --echo **** On Master ****
 connection master;

=== modified file 'mysql-test/suite/rpl/t/rpl_ssl.test'
--- a/mysql-test/suite/rpl/t/rpl_ssl.test	2007-12-05 19:33:36 +0000
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test	2010-04-01 11:34:04 +0000
@@ -31,7 +31,7 @@ select * from t1;
 # The slave is synced and waiting/reading from master
 # SHOW SLAVE STATUS will show "Waiting for master to send event"
 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical show slave status;
 
 # Stop the slave, as reported in bug#21871 it would hang
@@ -71,7 +71,7 @@ let $master_count= `select count(*) from
 sync_slave_with_master;
 --source include/wait_for_slave_to_start.inc
 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical show slave status;
 
 let $slave_count= `select count(*) from t1`;

=== modified file 'mysql-test/suite/rpl/t/rpl_ssl1.test'
--- a/mysql-test/suite/rpl/t/rpl_ssl1.test	2007-12-06 15:27:10 +0000
+++ b/mysql-test/suite/rpl/t/rpl_ssl1.test	2010-04-01 11:34:04 +0000
@@ -46,7 +46,7 @@ select * from t1;
 
 #checking show slave status
 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical show slave status;
 
 #checking if replication works without ssl also performing clean up
@@ -60,7 +60,7 @@ save_master_pos;
 connection slave;
 sync_with_master;
 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical show slave status;
 
 # End of 4.1 tests
@@ -90,7 +90,7 @@ select * from t1;
 
 #checking show slave status
 --replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR $MASTER_MYPORT MASTER_MYPORT
---replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 6 # 7 # 8 # 9 # 10 # 11 # 16 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical show slave status;
 
 connection master;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result	2008-07-10 16:09:39 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_basic.result	2010-04-01 11:34:04 +0000
@@ -179,6 +179,7 @@ Last_IO_Errno	<Last_IO_Errno>
 Last_IO_Error	<Last_IO_Error>
 Last_SQL_Errno	<Last_SQL_Errno>
 Last_SQL_Error	<Last_SQL_Error>
+Master_UUID	#
 set GLOBAL slave_transaction_retries=10;
 include/start_slave.inc
 select * from t1 order by nid;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result	2008-03-14 14:42:27 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular.result	2010-04-01 11:34:04 +0000
@@ -56,6 +56,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
@@ -99,5 +100,6 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 STOP SLAVE;
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result	2009-09-27 22:03:05 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_circular_simplex.result	2010-04-01 11:34:04 +0000
@@ -53,6 +53,7 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 SELECT * FROM t1 ORDER BY a;
 a	b
 1	2
@@ -102,4 +103,5 @@ Last_IO_Errno	#
 Last_IO_Error	#
 Last_SQL_Errno	0
 Last_SQL_Error	
+Master_UUID	#
 DROP TABLE t1;

=== modified file 'mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result'
--- a/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2009-03-16 21:36:14 +0000
+++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_sync.result	2010-04-01 11:34:04 +0000
@@ -69,29 +69,29 @@ master_log_file = 'master-bin.000001',
 master_log_pos = <the_pos> ;
 START SLAVE;
 SHOW SLAVE STATUS;
-Slave_IO_State	<Slave_IO_State>
+Slave_IO_State	#
 Master_Host	127.0.0.1
 Master_User	root
 Master_Port	MASTER_PORT
 Connect_Retry	1
 Master_Log_File	master-bin.000001
-Read_Master_Log_Pos	<Read_Master_Log_Pos>
-Relay_Log_File	<Relay_Log_File>
-Relay_Log_Pos	<Relay_Log_Pos>
+Read_Master_Log_Pos	#
+Relay_Log_File	#
+Relay_Log_Pos	#
 Relay_Master_Log_File	master-bin.000001
 Slave_IO_Running	Yes
 Slave_SQL_Running	Yes
 Replicate_Do_DB	
 Replicate_Ignore_DB	
 Replicate_Do_Table	
-Replicate_Ignore_Table	<Replicate_Ignore_Table>
+Replicate_Ignore_Table	#
 Replicate_Wild_Do_Table	
 Replicate_Wild_Ignore_Table	
 Last_Errno	0
 Last_Error	
 Skip_Counter	0
-Exec_Master_Log_Pos	<Exec_Master_Log_Pos>
-Relay_Log_Space	<Relay_Log_Space>
+Exec_Master_Log_Pos	#
+Relay_Log_Space	#
 Until_Condition	None
 Until_Log_File	
 Until_Log_Pos	0

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test	2008-07-10 16:09:39 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_basic.test	2010-04-01 11:34:04 +0000
@@ -193,7 +193,7 @@ source include/wait_for_slave_sql_to_sto
 # Replication should have stopped, since max retries were not enough.
 # verify with show slave status
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error>
+--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 19 <Last_Errno> 20 <Last_Error> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error> 37 <Last_SQL_Errno> 38 <Last_SQL_Error> 39 #
 --query_vertical SHOW SLAVE STATUS;
 
 # now set max retries high enough to succeed, and start slave again

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test	2009-09-27 22:03:05 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular.test	2010-04-01 11:34:04 +0000
@@ -40,14 +40,14 @@ INSERT INTO t1 VALUES (2,3);
 SELECT * FROM t1 ORDER BY a;
 #SELECT * FROM t2 ORDER BY a;
 # BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 --query_vertical show slave status;
 # connect to master and ensure data it there.
 --connection master
 SELECT * FROM t1 ORDER BY a;
 #SELECT * FROM t2 ORDER BY a;
 # BUG#34654 Last_IO_Errno is not reset - Mask columns 35 and 36
---replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 4 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 --query_vertical show slave status;
 
 # stop replication on "master" as not to replicate

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test	2009-09-27 22:03:05 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_circular_simplex.test	2010-04-01 11:34:04 +0000
@@ -49,7 +49,7 @@ sync_with_master;
 
 # Check that there is no error in replication
 --replace_result $SLAVE_MYPORT SLAVE_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;
 
 # Check that we have the data on the master
@@ -76,7 +76,7 @@ SELECT * FROM t1 ORDER BY a;
 
 # Check that there is no error in replication
 --replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 #
+--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 # 35 # 36 # 39 #
 query_vertical SHOW SLAVE STATUS;
 
 -- connection master

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test	2007-07-25 13:40:43 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_idempotent.test	2010-04-01 11:34:04 +0000
@@ -42,9 +42,7 @@ SELECT * FROM t1 ORDER BY c3;
 --connection slave
 SELECT * FROM t1 ORDER BY c3;
 
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
-SHOW SLAVE STATUS;
+source include/show_slave_status2.inc;
 
 # stop slave and reset position to before the last changes
 STOP SLAVE;
@@ -53,9 +51,7 @@ eval CHANGE MASTER TO
   master_log_file = '$the_file',
   master_log_pos = $the_pos ;
 
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
-SHOW SLAVE STATUS;
+source include/show_slave_status2.inc;
 
 # start the slave again
 # -> same events should have been applied again
@@ -106,9 +102,7 @@ COMMIT;
 --sync_slave_with_master
 --connection slave
 SELECT * FROM t1;
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error>
-SHOW SLAVE STATUS;
+source include/show_slave_status2.inc;
 
 connection master;
 DROP TABLE IF EXISTS t1;

=== modified file 'mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test'
--- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test	2007-12-12 17:19:24 +0000
+++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_sync.test	2010-04-01 11:34:04 +0000
@@ -71,9 +71,7 @@ START SLAVE;
 --connection master
 --sync_slave_with_master
 --connection slave
---replace_result $MASTER_MYPORT MASTER_PORT
---replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 35 <Last_IO_Errno> 36 <Last_IO_Error>
-query_vertical SHOW SLAVE STATUS;
+--source include/show_slave_status2.inc
 
 SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
 SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;

=== added file 'mysql-test/t/server_uuid.test'
--- a/mysql-test/t/server_uuid.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/t/server_uuid.test	2010-04-01 11:34:04 +0000
@@ -0,0 +1,73 @@
+##############################################################################
+# WL#4677 Unique Server Ids for Replication Topology (UUIDs)                 #
+# 
+# Each server has a UUID generated by server itself. It is stored in auto.cnf
+# in @@DATADIR directory. 
+#
+# @@SERVER_UUID is a readonly system variable, it is initialized as the
+# server's UUID when starting. Users can get the server's UUID from
+# @@SERVER_UUID.
+#
+# This test case tests whether the server's UUID can be generated, stored,
+# initialized correctly.
+##############################################################################
+
+CALL mtr.add_suppression("Master's UUID has changed, its old UUID is");
+
+--let $uuid_file= auto.cnf
+--let $original_server_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+
+--let $datadir= query_get_value(SELECT @@DATADIR, @@DATADIR, 1)
+--copy_file $datadir/$uuid_file $datadir/original_$uuid_file
+
+--echo
+--echo # Case 1:
+--echo # @@SERVER_UUID is readonly.
+--echo -----------------------------------------------------------------------------
+--error 1238
+SET GLOBAL SERVER_UUID= UUID();
+
+--echo
+--echo # Case 2:
+--echo # If the file does not exists, mysqld generates it automatically.
+--echo -----------------------------------------------------------------------------
+--remove_file $datadir/$uuid_file
+--source include/restart_mysqld.inc
+--let $server_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+if (`SELECT '$server_uuid' = ''`)
+{
+  --echo server's UUID is null
+}
+
+--echo
+--echo # Case 3:
+--echo # If there is no UUID in the file, mysqld generates it automatically.
+--echo -----------------------------------------------------------------------------
+
+--remove_file $datadir/$uuid_file
+# There is a blank line in the file
+--write_file $datadir/$uuid_file
+[auto]
+EOF
+--source include/restart_mysqld.inc
+
+--let $server_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+if (`SELECT '$server_uuid' = ''`)
+{
+  --echo server's UUID is null
+}
+
+--echo
+--echo # Case 4:
+--echo # If there is a UUID in the file, it will be loaded into SERVER_UUID.
+--echo -----------------------------------------------------------------------------
+
+--remove_file $datadir/$uuid_file
+--move_file $datadir/original_$uuid_file $datadir/$uuid_file
+--source include/restart_mysqld.inc
+
+--let $server_uuid= query_get_value(SELECT @@SERVER_UUID, @@SERVER_UUID, 1)
+if (`SELECT '$server_uuid' <> '$original_server_uuid'`)
+{
+  --echo $server_uuid<> $original_server_uuid
+}

=== modified file 'mysys/default.c'
--- a/mysys/default.c	2010-02-04 12:39:42 +0000
+++ b/mysys/default.c	2010-04-01 11:34:04 +0000
@@ -435,11 +435,12 @@ int my_load_defaults(const char *conf_fi
   MEM_ROOT alloc;
   char *ptr,**res;
   struct handle_option_ctx ctx;
-  const char **dirs;
+  const char **dirs= NULL;
   DBUG_ENTER("load_defaults");
 
   init_alloc_root(&alloc,512,0);
-  if ((dirs= init_default_directories(&alloc)) == NULL)
+  if (default_directories != NULL &&
+      (dirs= init_default_directories(&alloc)) == NULL)
     goto err;
   /*
     Check if the user doesn't want any default option processing

=== modified file 'sql/mysql_priv.h'
--- a/sql/mysql_priv.h	2010-02-09 10:30:50 +0000
+++ b/sql/mysql_priv.h	2010-04-01 11:34:04 +0000
@@ -1945,6 +1945,7 @@ extern MYSQL_PLUGIN_IMPORT uint reg_ext_
 extern char glob_hostname[FN_REFLEN], mysql_home[FN_REFLEN];
 extern char pidfile_name[FN_REFLEN], system_time_zone[30], *opt_init_file;
 extern char log_error_file[FN_REFLEN], *opt_tc_log_file;
+extern char server_uuid[UUID_LENGTH+1];
 extern ulonglong log_10_int[20];
 extern ulonglong keybuff_size;
 extern ulonglong thd_startup_options;

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-02-05 12:55:20 +0000
+++ b/sql/mysqld.cc	2010-04-01 11:34:04 +0000
@@ -563,6 +563,7 @@ const char *log_output_str= "FILE";
 
 time_t server_start_time, flush_status_time;
 
+char server_uuid[UUID_LENGTH+1];
 char mysql_home[FN_REFLEN], pidfile_name[FN_REFLEN], system_time_zone[30];
 char *default_tz_name;
 char log_error_file[FN_REFLEN], glob_hostname[FN_REFLEN];
@@ -3728,7 +3729,158 @@ static void end_ssl()
 }
 
 #endif /* EMBEDDED_LIBRARY */
+/**
+  Generate a UUID and save it into server_uuid variable.
+
+  @return Retur 0 or 1 if an error occurred.
+ */
+static int generate_server_uuid()
+{
+  THD *thd;
+  Item_func_uuid *func_uuid;
+  String uuid;
+
+  /*
+    To be able to run this from boot, we allocate a temporary THD
+   */
+  if (!(thd=new THD))
+  {
+    sql_print_error("Failed to generate a server UUID because it is failed"
+                    " to allocate the THD.");
+    return 1;
+  }
+  thd->thread_stack= (char*) &thd;
+  thd->store_globals();
+  lex_start(thd);
+  func_uuid= new (thd->mem_root) Item_func_uuid();
+  func_uuid->fixed= 1;
+  func_uuid->val_str(&uuid);
+  delete thd;
+  /* Remember that we don't have a THD */
+  my_pthread_setspecific_ptr(THR_THD,  0);
+
+  strncpy(server_uuid, uuid.c_ptr(), UUID_LENGTH);
+  server_uuid[UUID_LENGTH]= '\0';
+  return 0;
+}
+
+/**
+  Save all options which was auto-generated by server-self into the given file.
+
+  @param fname The name of the file in which the auto-generated options will b
+  e saved.
+
+  @return Return 0 or 1 if an error occurred.
+ */
+int flush_auto_options(const char* fname)
+{
+  File fd;
+  IO_CACHE io_cache;
+  int result= 0;
+
+  if ((fd= my_open((const char *)fname, O_CREAT|O_RDWR, MYF(MY_WME))) < 0)
+  {
+    sql_print_error("Failed to create file(file: '%s', errno %d)", fname, my_errno);
+    return 1;
+  }
+
+  if (init_io_cache(&io_cache, fd, IO_SIZE*2, WRITE_CACHE, 0L, 0, MYF(MY_WME)))
+  {
+    sql_print_error("Failed to create a cache on (file: %s', errno %d)", fname, my_errno);
+    my_close(fd, MYF(MY_WME));
+    return 1;
+  }
+
+  my_b_seek(&io_cache, 0L);
+  my_b_printf(&io_cache, "%s\n", "[auto]");
+  my_b_printf(&io_cache, "server-uuid=%s\n", server_uuid);
+
+  if (flush_io_cache(&io_cache) || my_sync(fd, MYF(MY_WME)))
+    result= 1;
+
+  my_close(fd, MYF(MY_WME));
+  end_io_cache(&io_cache);
+  return result;
+}
 
+/**
+  File 'auto.cnf' resides in the data directory to hold values of options that
+  server evaluates itself and that needs to be durable to sustain the server
+  restart. There is only a section ['auto'] in the file. All these options are
+  in the section. Only one option exists now, it is server_uuid.
+  Note, the user may not supply any literal value to these auto-options, and
+  only allowed to trigger (re)evaluation.
+  For instance, 'server_uuid' value will be evaluated and stored if there is
+  no corresponding line in the file.
+  Because of the specifics of the auto-options, they need a seperate storage.
+  Meanwhile, it is the 'auto.cnf' that has the same structure as 'my.cnf'.
+
+  @todo consider to implement sql-query-able persistent storage by WL#5279.
+  @return Return 0 or 1 if an error occurred.
+ */
+static int init_server_auto_options()
+{
+  bool flush= false;
+  char fname[FN_REFLEN];
+  char name[]= "auto";
+  const char *groups[]= {"auto", NULL};
+  char *uuid= 0;
+  my_option auto_options[]= {
+    {"server-uuid", 0, "", (uchar**) &uuid, (uchar **) &uuid,
+      0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+    {0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
+  };
+
+  DBUG_ENTER("init_server_auto_options");
+
+  if (NULL == fn_format(fname, "auto.cnf", mysql_data_home, "",
+                        MY_UNPACK_FILENAME | MY_SAFE_PATH))
+    DBUG_RETURN(1);
+
+  /* load_defaults require argv[0] is not null */
+  char **argv= (char **)(&name);
+  int argc= 1;
+  /* load all options in 'auto.cnf'. */
+  if (my_load_defaults(fname, groups, &argc, &argv, NULL))
+    DBUG_RETURN(1);
+
+  /*
+    Record the origial pointer allocated by my_load_defaults for free,
+    because argv will be changed by handle_options
+   */
+  char **old_argv= argv;
+  if (handle_options(&argc, &argv, auto_options, mysqld_get_one_option))
+    DBUG_RETURN(1);
+
+  if (uuid)
+  {
+    if (strlen(uuid) != UUID_LENGTH)
+    {
+      sql_print_error("Invalid UUID in the auto.cnf file");
+      goto err;
+    }
+    strcpy(server_uuid, uuid);
+  }
+  else
+  {
+    flush= TRUE;
+    /* server_uuid will be set in the function */
+    if (generate_server_uuid())
+      goto err;
+  }
+  /*
+    The uuid has been copied to server_uuid, so the memory allocated by
+    my_load_defaults can be freed now.
+   */
+  free_defaults(old_argv);
+
+  if (flush)
+    DBUG_RETURN(flush_auto_options(fname));
+  DBUG_RETURN(0);
+err:
+  free_defaults(argv);
+  DBUG_RETURN(1);
+}
 
 static int init_server_components()
 {
@@ -3989,6 +4141,16 @@ a file name for --log-bin-index option",
     }
   }
 
+  /*
+    Each server should have one UUID. We will create it automatically, if it
+    does not exist.
+   */
+  if (!opt_bootstrap && init_server_auto_options())
+  {
+    sql_print_error("Initializing server's UUID failed");
+    unireg_abort(1);
+  }
+
   /* if the errmsg.sys is not loaded, terminate to maintain behaviour */
   if (!errmesg[0][0])
     unireg_abort(1);
@@ -7736,6 +7898,7 @@ static int mysql_init_variables(void)
   opt_debug_sync_timeout= 0;
 #endif /* defined(ENABLED_DEBUG_SYNC) */
   key_map_full.set_all();
+  server_uuid[0]= 0;
 
   /* Character sets */
   system_charset_info= &my_charset_utf8_general_ci;

=== modified file 'sql/repl_failsafe.cc'
--- a/sql/repl_failsafe.cc	2010-01-22 10:58:21 +0000
+++ b/sql/repl_failsafe.cc	2010-04-01 11:34:04 +0000
@@ -680,6 +680,7 @@ bool show_slave_hosts(THD* thd)
 					   MYSQL_TYPE_LONG));
   field_list.push_back(new Item_return_int("Master_id", 10,
 					   MYSQL_TYPE_LONG));
+  field_list.push_back(new Item_empty_string("Slave_UUID", UUID_LENGTH));
 
   if (protocol->send_fields(&field_list,
                             Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
@@ -701,6 +702,11 @@ bool show_slave_hosts(THD* thd)
     protocol->store((uint32) si->port);
     protocol->store((uint32) si->rpl_recovery_rank);
     protocol->store((uint32) si->master_id);
+
+    /* get slave's UUID */
+    String slave_uuid;
+    if (get_slave_uuid(si->thd, &slave_uuid));
+      protocol->store(slave_uuid.c_ptr_safe(), &my_charset_bin);
     if (protocol->write())
     {
       pthread_mutex_unlock(&LOCK_slave_list);

=== modified file 'sql/rpl_mi.cc'
--- a/sql/rpl_mi.cc	2007-12-14 13:21:37 +0000
+++ b/sql/rpl_mi.cc	2010-04-01 11:34:04 +0000
@@ -36,6 +36,7 @@ Master_info::Master_info()
   host[0] = 0; user[0] = 0; password[0] = 0;
   ssl_ca[0]= 0; ssl_capath[0]= 0; ssl_cert[0]= 0;
   ssl_cipher[0]= 0; ssl_key[0]= 0;
+  master_uuid[0]=0;
 
   bzero((char*) &file, sizeof(file));
   pthread_mutex_init(&run_lock, MY_MUTEX_INIT_FAST);
@@ -94,8 +95,9 @@ enum {
   /* 5.1.16 added value of master_ssl_verify_server_cert */
   LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT= 15,
 
+  LINE_FOR_MASTER_UUID= 16,
   /* Number of lines currently used when saving master info file */
-  LINES_IN_MASTER_INFO= LINE_FOR_MASTER_SSL_VERIFY_SERVER_CERT
+  LINES_IN_MASTER_INFO= LINE_FOR_MASTER_UUID
 };
 
 int init_master_info(Master_info* mi, const char* master_info_fname,
@@ -282,6 +284,9 @@ file '%s')", fname);
           init_intvar_from_file(&ssl_verify_server_cert, &mi->file, 0))
         goto errwithmsg;
 
+      if (lines >= LINE_FOR_MASTER_UUID &&
+          init_strvar_from_file(mi->master_uuid, sizeof(mi->master_uuid), &mi->file, 0))
+        goto errwithmsg;
     }
 
 #ifndef HAVE_OPENSSL

=== modified file 'sql/rpl_mi.h'
--- a/sql/rpl_mi.h	2007-08-16 06:52:50 +0000
+++ b/sql/rpl_mi.h	2010-04-01 11:34:04 +0000
@@ -100,6 +100,7 @@ class Master_info : public Slave_reporti
 
   */
   long clock_diff_with_master;
+  char master_uuid[UUID_LENGTH+1];
 };
 
 void init_master_info_with_options(Master_info* mi);

=== modified file 'sql/set_var.cc'
--- a/sql/set_var.cc	2010-01-21 08:10:05 +0000
+++ b/sql/set_var.cc	2010-04-01 11:34:04 +0000
@@ -508,6 +508,10 @@ static sys_var_thd_ulong	sys_query_alloc
 static sys_var_thd_ulong	sys_query_prealloc_size(&vars, "query_prealloc_size",
 						&SV::query_prealloc_size,
 						0, fix_thd_mem_root);
+
+static sys_var_const            sys_server_uuid(&vars, "server_uuid",
+                                                OPT_GLOBAL, SHOW_CHAR,
+                                                (uchar *) server_uuid);
 #ifdef HAVE_SMEM
 /* purecov: begin tested */
 static sys_var_const    sys_shared_memory(&vars, "shared_memory",

=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2009-12-14 16:32:22 +0000
+++ b/sql/slave.cc	2010-04-01 11:34:04 +0000
@@ -141,6 +141,7 @@ static int request_table_dump(MYSQL* mys
 static int create_table_from_dump(THD* thd, MYSQL *mysql, const char* db,
                                   const char* table_name, bool overwrite);
 static int get_master_version_and_clock(MYSQL* mysql, Master_info* mi);
+static int get_master_uuid(MYSQL *mysql, Master_info *mi);
 static Log_event* next_event(Relay_log_info* rli);
 static int queue_event(Master_info* mi,const char* buf,ulong event_len);
 static int terminate_slave_thread(THD *thd,
@@ -882,6 +883,98 @@ bool is_network_error(uint errorno)
   return FALSE;   
 }
 
+/**
+  An auxiliary function extracts slave UUID.
+
+  @param[in]    thd  THD to access a user variable
+  @param[out]   value String to return UUID value.
+
+  @return       if success value is returned else NULL is returned.
+*/
+String *get_slave_uuid(THD *thd, String *value)
+{
+  uchar name[]= "slave_uuid";
+
+  if (value == NULL)
+    return NULL;
+  user_var_entry *entry=
+    (user_var_entry*) hash_search(&thd->user_vars, name, sizeof(name)-1);
+  if (entry && entry->length > 0)
+  {
+    value->copy(entry->value, entry->length, NULL);
+    return value;
+  }
+  else
+    return NULL;
+}
+
+/**
+  Get master's uuid on connecting.
+
+  @param  mysql MYSQL to request uuid from master.
+  @param  mi    Master_info to set master_uuid
+
+  @return 0: Success, 1: Fatal error, 2: Network error.
+*/
+static int get_master_uuid(MYSQL *mysql, Master_info *mi)
+{
+  const char *errmsg;
+  MYSQL_RES *master_res= NULL;
+  MYSQL_ROW master_row= NULL;
+  int ret= 0;
+
+  DBUG_SYNC_POINT("debug_lock.before_get_MASTER_UUID", 10);
+  if (!mysql_real_query(mysql,
+                        STRING_WITH_LEN("SHOW VARIABLES LIKE 'SERVER_UUID'")) &&
+      (master_res= mysql_store_result(mysql)) &&
+      (master_row= mysql_fetch_row(master_res)))
+  {
+    if (!strcmp(::server_uuid, master_row[1]) &&
+        !mi->rli.replicate_same_server_id)
+    {
+      errmsg= "The slave I/O thread stops because master and slave have equal "
+              "MySQL server UUIDs; these UUIDs must be different for replication to work.";
+      mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR), errmsg);
+      // Fatal error
+      ret= 1;
+    }
+    else
+    {
+      if (mi->master_uuid[0] != 0 && strcmp(mi->master_uuid, master_row[1]))
+        sql_print_warning("Master's UUID has changed, its old UUID is %s, "
+                          "the new one is %s", mi->master_uuid, master_row[1]);
+      strncpy(mi->master_uuid, master_row[1], UUID_LENGTH);
+      mi->master_uuid[UUID_LENGTH]= 0;
+    }
+  }
+  else if (mysql_errno(mysql))
+  {
+    if (is_network_error(mysql_errno(mysql)))
+    {
+      mi->report(WARNING_LEVEL, mysql_errno(mysql),
+                 "Get master SERVER_UUID failed with error: %s", mysql_error(mysql));
+      ret= 2;
+    }
+    else
+    {
+      /* Fatal error */
+      errmsg= "The slave I/O thread stops because a fatal error is encountered "
+        "when it try to get the value of SERVER_UUID variable from master.";
+      mi->report(ERROR_LEVEL, ER_SLAVE_FATAL_ERROR, ER(ER_SLAVE_FATAL_ERROR), errmsg);
+      ret= 1;
+    }
+  }
+  else if (!master_row && master_res)
+  {
+    mi->report(WARNING_LEVEL, ER_UNKNOWN_SYSTEM_VARIABLE,
+               "Unknown system variable 'SERVER_UUID' on master, "
+               "maybe it is a *VERY OLD MASTER*.");
+  }
+
+  if (master_res)
+    mysql_free_result(master_res);
+  return ret;
+}
 
 /*
   Note that we rely on the master's version (3.23, 4.0.14 etc) instead of
@@ -1605,6 +1698,7 @@ bool show_master_info(THD* thd, Master_i
   field_list.push_back(new Item_empty_string("Last_IO_Error", 20));
   field_list.push_back(new Item_return_int("Last_SQL_Errno", 4, MYSQL_TYPE_LONG));
   field_list.push_back(new Item_empty_string("Last_SQL_Error", 20));
+  field_list.push_back(new Item_empty_string("Master_UUID", UUID_LENGTH));
 
   if (protocol->send_fields(&field_list,
                             Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
@@ -1726,6 +1820,7 @@ bool show_master_info(THD* thd, Master_i
     protocol->store(mi->rli.last_error().number);
     // Last_SQL_Error
     protocol->store(mi->rli.last_error().message, &my_charset_bin);
+    protocol->store(mi->master_uuid, &my_charset_bin);
 
     pthread_mutex_unlock(&mi->rli.err_lock);
     pthread_mutex_unlock(&mi->err_lock);
@@ -2562,6 +2657,9 @@ connected:
   thd->slave_net = &mysql->net;
   thd_proc_info(thd, "Checking master version");
   ret= get_master_version_and_clock(mysql, mi);
+  if (!ret)
+    ret= get_master_uuid(mysql, mi);
+
   if (ret == 1)
     /* Fatal error */
     goto err;
@@ -3799,6 +3897,8 @@ static int connect_to_master(THD* thd, M
   int last_errno= -2;                           // impossible error
   ulong err_count=0;
   char llbuff[22];
+  /* if your query is larger than 128, you must increase its size */
+  char init_cmd[128];
   DBUG_ENTER("connect_to_master");
 
 #ifndef DBUG_OFF
@@ -3829,6 +3929,9 @@ static int connect_to_master(THD* thd, M
   /* This one is not strictly needed but we have it here for completeness */
   mysql_options(mysql, MYSQL_SET_CHARSET_DIR, (char *) charsets_dir);
 
+  sprintf(init_cmd, "SET @SLAVE_UUID= '%s'", server_uuid);
+  mysql_options(mysql, MYSQL_INIT_COMMAND, init_cmd);
+
   while (!(slave_was_killed = io_slave_killed(thd,mi)) &&
          (reconnect ? mysql_reconnect(mysql) != 0 :
           mysql_real_connect(mysql, mi->host, mi->user, mi->password, 0,

=== modified file 'sql/slave.h'
--- a/sql/slave.h	2009-12-14 16:32:22 +0000
+++ b/sql/slave.h	2010-04-01 11:34:04 +0000
@@ -213,6 +213,7 @@ extern char *master_ssl_cipher, *master_
        
 extern I_List<THD> threads;
 
+extern String *get_slave_uuid(THD *thd, String *value);
 #endif /* HAVE_REPLICATION */
 
 /* masks for start/stop operations on io and sql slave threads */

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2010-02-25 15:12:15 +0000
+++ b/sql/sql_parse.cc	2010-04-01 11:34:04 +0000
@@ -1405,7 +1405,7 @@ bool dispatch_command(enum enum_server_c
     {
       ulong pos;
       ushort flags;
-      uint32 slave_server_id;
+      String slave_uuid;
 
       status_var_increment(thd->status_var.com_other);
       thd->enable_slow_log= opt_log_slow_admin_statements;
@@ -1415,10 +1415,10 @@ bool dispatch_command(enum enum_server_c
       /* TODO: The following has to be changed to an 8 byte integer */
       pos = uint4korr(packet);
       flags = uint2korr(packet + 4);
-      thd->server_id=0; /* avoid suicide */
-      if ((slave_server_id= uint4korr(packet+6))) // mysqlbinlog.server_id==0
-	kill_zombie_dump_threads(slave_server_id);
-      thd->server_id = slave_server_id;
+      thd->server_id= uint4korr(packet+6);
+
+      get_slave_uuid(thd, &slave_uuid);
+      kill_zombie_dump_threads(&slave_uuid);
 
       general_log_print(thd, command, "Log: '%s'  Pos: %ld", packet+10,
                       (long) pos);

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2010-02-05 17:51:55 +0000
+++ b/sql/sql_repl.cc	2010-04-01 11:34:04 +0000
@@ -1083,24 +1083,32 @@ err:
 
   SYNOPSIS
     kill_zombie_dump_threads()
-    slave_server_id     the slave's server id
+    slave_uuid      the slave's UUID
 
 */
 
 
-void kill_zombie_dump_threads(uint32 slave_server_id)
+void kill_zombie_dump_threads(String *slave_uuid)
 {
+  if (slave_uuid->length() == 0)
+    return;
+  DBUG_ASSERT(slave_uuid->length() == UUID_LENGTH);
+
   pthread_mutex_lock(&LOCK_thread_count);
   I_List_iterator<THD> it(threads);
   THD *tmp;
 
   while ((tmp=it++))
   {
-    if (tmp->command == COM_BINLOG_DUMP &&
-       tmp->server_id == slave_server_id)
+    if (tmp != current_thd && tmp->command == COM_BINLOG_DUMP)
     {
-      pthread_mutex_lock(&tmp->LOCK_thd_data);	// Lock from delete
-      break;
+      String tmp_uuid;
+      if (get_slave_uuid(tmp, &tmp_uuid) != NULL &&
+          !strncmp(slave_uuid->c_ptr(), tmp_uuid.c_ptr(), UUID_LENGTH))
+      {
+        pthread_mutex_lock(&tmp->LOCK_thd_data);	// Lock from delete
+        break;
+      }
     }
   }
   pthread_mutex_unlock(&LOCK_thread_count);
@@ -1167,6 +1175,12 @@ bool change_master(THD* thd, Master_info
     reset binlog's name to FIRST and position to 4.
   */
 
+  if ((lex_mi->host && strcmp(lex_mi->host, mi->host)) ||
+      (lex_mi->port && lex_mi->port != mi->port))
+  {
+    mi->master_uuid[0]= 0;
+  }
+
   if ((lex_mi->host || lex_mi->port) && !lex_mi->log_file_name && !lex_mi->pos)
   {
     mi->master_log_name[0] = 0;

=== modified file 'sql/sql_repl.h'
--- a/sql/sql_repl.h	2008-03-14 17:38:54 +0000
+++ b/sql/sql_repl.h	2010-04-01 11:34:04 +0000
@@ -50,7 +50,7 @@ bool log_in_use(const char* log_name);
 void adjust_linfo_offsets(my_off_t purge_offset);
 bool show_binlogs(THD* thd);
 extern int init_master_info(Master_info* mi);
-void kill_zombie_dump_threads(uint32 slave_server_id);
+void kill_zombie_dump_threads(String *slave_uuid);
 int check_binlog_magic(IO_CACHE* log, const char** errmsg);
 
 typedef struct st_load_file_info


Attachment: [text/bzr-bundle] bzr/li-bing.song@sun.com-20100401113404-siolrebff8g9cp2v.bundle
Thread
bzr commit into mysql-5.1 branch (Li-Bing.Song:3368) Li-Bing.Song1 Apr