List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:July 20 2011 10:26am
Subject:bzr push into mysql-trunk branch (alfranio.correia:3281 to 3282)
View as plain text  
 3282 Alfranio Correia	2011-07-20 [merge]
      merge mysql-5.5 --> mysql-trunk

    modified:
      mysql-test/extra/rpl_tests/rpl_reset_slave.test
      mysql-test/suite/rpl/r/rpl_row_reset_slave.result
      mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
      sql/rpl_mi.cc
      sql/rpl_mi.h
      sql/rpl_slave.cc
      sql/sql_lex.h
      sql/sql_yacc.yy
 3281 Alfranio Correia	2011-07-20 [merge]
      merge mysql-trunk (local) --> mysql-trunk

    modified:
      sql/ha_ndbcluster.cc
      sql/log_event.cc
=== modified file 'mysql-test/extra/rpl_tests/rpl_reset_slave.test'
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test	2010-12-19 17:22:30 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test	2011-07-20 10:24:14 +0000
@@ -80,5 +80,31 @@ reset slave;
 source include/check_slave_no_error.inc;
 change master to master_user='root';
 
---let $rpl_only_running_threads= 1
+
+#
+# BUG#11809016 - NO WAY TO DISCOVER AN INSTANCE IS NO LONGER A SLAVE FOLLOWING MYSQL BUG#28796
+#
+
+reset slave;
+--source include/start_slave.inc
+
+--source include/stop_slave.inc
+--let $_slave_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+--let $_slave_master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
+--let $_slave_master_port= query_get_value(SHOW SLAVE STATUS, Master_Port, 1)
+
+reset slave all;
+--error ER_BAD_SLAVE
+start slave;
+
+--let $_show_master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1)
+if ($_show_master_host != No such row)
+{
+  die;
+}
+
+--replace_result $_slave_master_host MASTER_HOST $_slave_master_user MASTER_USER $_slave_master_port MASTER_PORT
+--eval CHANGE MASTER TO MASTER_HOST= '$_slave_master_host', MASTER_USER= '$_slave_master_user', MASTER_PORT= $_slave_master_port
+--source include/start_slave.inc
+
 --source include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_row_reset_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result	2011-07-20 10:24:14 +0000
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
 reset slave;
 include/check_slave_no_error.inc
 change master to master_user='root';
+reset slave;
+include/start_slave.inc
+include/stop_slave.inc
+reset slave all;
+start slave;
+ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
+include/start_slave.inc
 include/rpl_end.inc

=== modified file 'mysql-test/suite/rpl/r/rpl_stm_reset_slave.result'
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result	2010-12-19 17:22:30 +0000
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result	2011-07-20 10:24:14 +0000
@@ -41,4 +41,12 @@ include/stop_slave_sql.inc
 reset slave;
 include/check_slave_no_error.inc
 change master to master_user='root';
+reset slave;
+include/start_slave.inc
+include/stop_slave.inc
+reset slave all;
+start slave;
+ERROR HY000: The server is not configured as slave; fix in config file or with CHANGE MASTER TO
+CHANGE MASTER TO MASTER_HOST= 'MASTER_HOST', MASTER_USER= 'MASTER_USER', MASTER_PORT= MASTER_PORT;
+include/start_slave.inc
 include/rpl_end.inc

=== modified file 'sql/rpl_mi.cc'
--- a/sql/rpl_mi.cc	2011-06-30 15:50:45 +0000
+++ b/sql/rpl_mi.cc	2011-07-20 10:24:14 +0000
@@ -152,6 +152,16 @@ bool Master_info::shall_ignore_server_id
       != NULL;
 }
 
+void Master_info::clear_in_memory_info(bool all)
+{
+  init_master_log_pos();
+  if (all)
+  {
+    port= MYSQL_PORT;
+    host[0] = 0; user[0] = 0; password[0] = 0;
+  }
+}
+
 void Master_info::init_master_log_pos()
 {
   DBUG_ENTER("Master_info::init_master_log_pos");

=== modified file 'sql/rpl_mi.h'
--- a/sql/rpl_mi.h	2011-06-30 15:50:45 +0000
+++ b/sql/rpl_mi.h	2011-07-20 10:24:14 +0000
@@ -119,7 +119,8 @@ protected:
   my_off_t master_log_pos;
 
 public:
-  void init_master_log_pos();
+  void clear_in_memory_info(bool all);
+
   inline const char* get_master_log_name() { return master_log_name; }
   inline ulonglong get_master_log_pos() { return master_log_pos; }
   inline void set_master_log_name(const char *log_file_name)
@@ -137,6 +138,8 @@ public:
   size_t get_number_info_mi_fields();
 
 private:
+  void init_master_log_pos();
+
   bool read_info(Rpl_info_handler *from);
   bool write_info(Rpl_info_handler *to, bool force);
 

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-07-05 16:45:26 +0000
+++ b/sql/rpl_slave.cc	2011-07-20 10:24:14 +0000
@@ -5729,8 +5729,8 @@ int reset_slave(THD *thd, Master_info* m
     goto err;
   }
 
-  /* Clear master's log coordinates */
-  mi->init_master_log_pos();
+  /* Clear master's log coordinates and associated information */
+  mi->clear_in_memory_info(thd->lex->reset_slave_info.all);
 
   if (remove_info(mi))
   {

=== modified file 'sql/sql_lex.h'
--- a/sql/sql_lex.h	2011-07-07 09:45:10 +0000
+++ b/sql/sql_lex.h	2011-07-20 10:24:14 +0000
@@ -228,6 +228,10 @@ typedef struct st_lex_master_info
   void set_unspecified();
 } LEX_MASTER_INFO;
 
+typedef struct st_lex_reset_slave
+{
+  bool all;
+} LEX_RESET_SLAVE;
 
 enum sub_select_type
 {
@@ -2127,6 +2131,7 @@ struct LEX: public Query_tables_list
   LEX_MASTER_INFO mi;				// used by CHANGE MASTER
   LEX_SERVER_OPTIONS server_options;
   USER_RESOURCES mqh;
+  LEX_RESET_SLAVE reset_slave_info;
   ulong type;
   /*
     This variable is used in post-parse stage to declare that sum-functions,

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2011-07-14 08:05:12 +0000
+++ b/sql/sql_yacc.yy	2011-07-20 10:24:14 +0000
@@ -11541,10 +11541,16 @@ reset_options:
 
 reset_option:
           SLAVE               { Lex->type|= REFRESH_SLAVE; }
+          slave_reset_options { }
         | MASTER_SYM          { Lex->type|= REFRESH_MASTER; }
         | QUERY_SYM CACHE_SYM { Lex->type|= REFRESH_QUERY_CACHE;}
         ;
 
+slave_reset_options:
+          /* empty */ { Lex->reset_slave_info.all= false; }
+        | ALL         { Lex->reset_slave_info.all= true; }
+        ;
+
 purge:
           PURGE
           {

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (alfranio.correia:3281 to 3282) Alfranio Correia20 Jul