List:Commits« Previous MessageNext Message »
From:Alfranio Correia Date:December 9 2010 4:18pm
Subject:bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3240) WL#5599
View as plain text  
#At file:///home/acorreia/workspace.sun/repository.mysql.new/bzrwork/wl-5569/mysql-next-mr-wl5569/ based on revid:alfranio.correia@stripped

 3240 Alfranio Correia	2010-12-09
      WL#5599
      
      Fixed the use of the dummy repository.

    modified:
      mysql-test/suite/rpl/t/rpl_parallel-slave.opt
      sql/rpl_info_dummy.cc
      sql/rpl_info_dummy.h
      sql/rpl_info_factory.cc
      sql/rpl_info_factory.h
      sql/rpl_slave.cc
=== modified file 'mysql-test/suite/rpl/t/rpl_parallel-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_parallel-slave.opt	2010-12-07 03:05:41 +0000
+++ b/mysql-test/suite/rpl/t/rpl_parallel-slave.opt	2010-12-09 16:17:32 +0000
@@ -1 +1 @@
---relay-log-info-repository=TABLE --slave-parallel-workers=4
+--slave-parallel-workers=4

=== modified file 'sql/rpl_info_dummy.cc'
--- a/sql/rpl_info_dummy.cc	2010-12-07 03:05:41 +0000
+++ b/sql/rpl_info_dummy.cc	2010-12-09 16:17:32 +0000
@@ -16,8 +16,8 @@
 #include <my_global.h>
 #include "rpl_info_dummy.h"
 
-Rpl_info_dummy::Rpl_info_dummy()
-  :Rpl_info_handler(0)
+Rpl_info_dummy::Rpl_info_dummy(const int nparam)
+  :Rpl_info_handler(nparam)
 {
 }
 
@@ -31,6 +31,7 @@ int Rpl_info_dummy::do_prepare_info_for_
                                              __attribute__((unused)))
 {
   if (abort) DBUG_ASSERT(0);
+  cursor= 0;
   return 0;
 }
 
@@ -38,6 +39,7 @@ int Rpl_info_dummy::do_prepare_info_for_
                                               __attribute__((unused)))
 {
   if (abort) DBUG_ASSERT(0);
+  cursor= 0;
   return 0;
 }
 

=== modified file 'sql/rpl_info_dummy.h'
--- a/sql/rpl_info_dummy.h	2010-12-07 03:05:41 +0000
+++ b/sql/rpl_info_dummy.h	2010-12-09 16:17:32 +0000
@@ -30,7 +30,7 @@
 class Rpl_info_dummy : public Rpl_info_handler
 {
 public:
-  Rpl_info_dummy();
+  Rpl_info_dummy(const int nparam);
   virtual ~Rpl_info_dummy() { };
 
 private:

=== modified file 'sql/rpl_info_factory.cc'
--- a/sql/rpl_info_factory.cc	2010-12-09 13:23:19 +0000
+++ b/sql/rpl_info_factory.cc	2010-12-09 16:17:32 +0000
@@ -24,6 +24,7 @@
 */
 #define master_info_engine NULL
 #define relay_log_info_engine NULL
+#define worker_info_engine NULL
 
 #define NUMBER_OF_FIELDS_TO_IDENTIFY_COORDINATOR 1
 #define NUMBER_OF_FIELDS_TO_IDENTIFY_WORKER 2
@@ -138,7 +139,8 @@ Master_info *Rpl_info_factory::create_mi
     DBUG_RETURN(mi);
   }
 
-  if (Rpl_info_factory::create_info_dummy(mi))
+  if (Rpl_info_factory::create_info_dummy(mi,
+                                          mi->get_number_info_mi_fields()))
     goto err;
 
   DBUG_RETURN(mi);
@@ -238,7 +240,8 @@ Relay_log_info *Rpl_info_factory::create
     DBUG_RETURN(rli);
   }
 
-  if (Rpl_info_factory::create_info_dummy(rli))
+  if (Rpl_info_factory::create_info_dummy(rli,
+                                          rli->get_number_info_rli_fields()))
     goto err;
 
   DBUG_RETURN(rli);
@@ -413,7 +416,7 @@ bool Rpl_info_factory::change_engine(Rpl
   DBUG_RETURN(FALSE);
 }
 
-Slave_worker *Rpl_info_factory::create_worker(uint worker_option, Relay_log_info *rli, uint worker_id)
+Slave_worker *Rpl_info_factory::create_worker(uint worker_option, uint worker_id)
 {
   DBUG_ENTER("Rpl_info_factory::create_worker");
 
@@ -472,15 +475,16 @@ Slave_worker *Rpl_info_factory::create_w
                           worker_option == MI_REPOSITORY_TABLE, &msg))
       goto err;
 
-    if ((worker_option == RLI_REPOSITORY_TABLE) &&
+    if ((worker_option == WORKER_REPOSITORY_TABLE) &&
          change_engine(static_cast<Rpl_info_table *>(w_table),
-                       relay_log_info_engine, &msg))
+                       worker_info_engine, &msg))
       goto err;
 
     DBUG_RETURN(worker);
   }
 
-  if (Rpl_info_factory::create_info_dummy(rli))
+  if (Rpl_info_factory::create_info_dummy(worker,
+                                          worker->get_number_worker_fields()))
     goto err;
 
   DBUG_RETURN(worker);
@@ -506,13 +510,13 @@ err:
   DBUG_RETURN(NULL);
 }
 
-bool Rpl_info_factory::create_info_dummy(Rpl_info *rpl)
+bool Rpl_info_factory::create_info_dummy(Rpl_info *rpl, uint nfields)
 {
   DBUG_ENTER("Rpl_info_factory::create_info_dummy");
 
   Rpl_info_dummy* rpl_dummy= NULL;
 
-  if (!(rpl_dummy= new Rpl_info_dummy()))
+  if (!(rpl_dummy= new Rpl_info_dummy(nfields)))
     DBUG_RETURN(TRUE);
 
   rpl->set_rpl_info_handler(rpl_dummy);

=== modified file 'sql/rpl_info_factory.h'
--- a/sql/rpl_info_factory.h	2010-12-09 13:23:19 +0000
+++ b/sql/rpl_info_factory.h	2010-12-09 16:17:32 +0000
@@ -64,8 +64,7 @@ class Rpl_info_factory
 
   static bool create_coordinators(uint mi_option, Master_info **mi,
                                   uint rli_option, Relay_log_info **rli);
-  static Slave_worker *create_worker(uint rli_option, Relay_log_info *rli,
-                                     uint worker_id);
+  static Slave_worker *create_worker(uint rli_option, uint worker_id);
   static Master_info *create_mi(uint rli_option);
   static Relay_log_info *create_rli(uint rli_option, bool is_slave_recovery);
   static bool decide_repository(Rpl_info *info,
@@ -74,6 +73,6 @@ class Rpl_info_factory
                                 const char **msg);
   static bool change_engine(Rpl_info_table *table, const char *engine,
                             const char **msg);
- static bool create_info_dummy(Rpl_info *rpl);
+ static bool create_info_dummy(Rpl_info *rpl, uint nfields);
 };
 #endif

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2010-12-09 13:23:19 +0000
+++ b/sql/rpl_slave.cc	2010-12-09 16:17:32 +0000
@@ -3922,7 +3922,7 @@ int slave_start_single_worker(Relay_log_
   uint k;
   pthread_t th;
   Slave_worker *w=
-    Rpl_info_factory::create_worker(opt_worker_repository_id, rli, i);
+    Rpl_info_factory::create_worker(opt_worker_repository_id, i);
   Slave_job_item empty= {NULL};
 
   w->c_rli= rli;
@@ -3932,7 +3932,7 @@ int slave_start_single_worker(Relay_log_
   // fixme: experimenting to make Workers to run ev->update_pos(w->w_rli)
   // fixme: a real hack! part of Rpl_info_factory::create_rli(RLI_REPOSITORY_FILE, FALSE);
   w->w_rli= new Relay_log_info(FALSE);
-  Rpl_info_dummy *dummy_handler= new Rpl_info_dummy();
+  Rpl_info_dummy *dummy_handler= new Rpl_info_dummy(rli->get_number_info_rli_fields());
   w->w_rli->set_rpl_info_handler(dummy_handler);
   w->init_info();
 


Attachment: [text/bzr-bundle] bzr/alfranio.correia@oracle.com-20101209161732-ell5slb2wphfuu2q.bundle
Thread
bzr commit into mysql-next-mr-wl5569 branch (alfranio.correia:3240) WL#5599Alfranio Correia9 Dec