List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:September 25 2008 10:21am
Subject:bzr commit into mysql-5.1 branch (jonas:2671)
View as plain text  
#At file:///home/jonas/src/telco-6.2/

 2671 Jonas Oreland	2008-09-25
      ndb - atrt
        fix replication in 6.0
        allow configurations wo/ cluster
modified:
  storage/ndb/test/run-test/db.cpp
  storage/ndb/test/run-test/main.cpp
  storage/ndb/test/run-test/setup.cpp

per-file comments:
  storage/ndb/test/run-test/db.cpp
    add debugging on SQL queries
    fix reversed argument for replication setup (6.0-style)
  storage/ndb/test/run-test/main.cpp
    allow starting configurations wo/ cluster(s)
  storage/ndb/test/run-test/setup.cpp
    remove usage of deprecated feature
    (makes it fail in 6.0)
=== modified file 'storage/ndb/test/run-test/db.cpp'
--- a/storage/ndb/test/run-test/db.cpp	2008-08-27 11:42:30 +0000
+++ b/storage/ndb/test/run-test/db.cpp	2008-09-25 10:21:14 +0000
@@ -23,6 +23,17 @@ static bool setup_repl(atrt_config&);
 
 static atrt_process* f_mysqld = 0;
 
+static
+int
+run_query(atrt_process* src, const char * query)
+{
+  g_logger.debug("%s:%s - %s",
+		 src->m_cluster->m_name.c_str(),
+		 src->m_host->m_hostname.c_str(),
+		 query);
+  return mysql_query(&src->m_mysql, query);
+}
+
 bool
 setup_db(atrt_config& config)
 {
@@ -398,16 +409,16 @@ populate_db(atrt_config& config, atrt_pr
 
 static
 bool
-setup_repl(atrt_process* src, atrt_process* dst)
+setup_repl(atrt_process* dst, atrt_process* src)
 {
-  if (mysql_query(&src->m_mysql, "STOP SLAVE"))
+  if (run_query(src, "STOP SLAVE"))
   {
     g_logger.error("Failed to stop slave: %s",
 		   mysql_error(&src->m_mysql));
     return false;
   }
 
-  if (mysql_query(&src->m_mysql, "RESET SLAVE"))
+  if (run_query(src, "RESET SLAVE"))
   {
     g_logger.error("Failed to reset slave: %s",
 		   mysql_error(&src->m_mysql));
@@ -421,7 +432,7 @@ setup_repl(atrt_process* src, atrt_proce
 	     dst->m_host->m_hostname.c_str(),
 	     atoi(find(dst, "--port=")));
   
-  if (mysql_query(&src->m_mysql, tmp.c_str()))
+  if (run_query(src, tmp.c_str()))
   {
     g_logger.error("Failed to setup repl from %s to %s: %s",
 		   src->m_host->m_hostname.c_str(),
@@ -430,7 +441,7 @@ setup_repl(atrt_process* src, atrt_proce
     return false;
   }
 
-  if (mysql_query(&src->m_mysql, "START SLAVE"))
+  if (run_query(src, "START SLAVE"))
   {
     g_logger.error("Failed to start slave: %s",
 		   mysql_error(&src->m_mysql));

=== modified file 'storage/ndb/test/run-test/main.cpp'
--- a/storage/ndb/test/run-test/main.cpp	2008-08-27 11:42:30 +0000
+++ b/storage/ndb/test/run-test/main.cpp	2008-09-25 10:21:14 +0000
@@ -767,8 +767,7 @@ wait_ndb(atrt_config& config, int goal){
     }
 
     if(handle == 0){
-      g_logger.critical("Unable to find mgm handle");
-      return false;
+      return true;
     }
     
     if(goal == NDB_MGM_NODE_STATUS_STARTED){

=== modified file 'storage/ndb/test/run-test/setup.cpp'
--- a/storage/ndb/test/run-test/setup.cpp	2008-09-04 09:43:51 +0000
+++ b/storage/ndb/test/run-test/setup.cpp	2008-09-25 10:21:14 +0000
@@ -34,10 +34,12 @@ struct proc_option f_options[] = {
   ,{ "--host=",        atrt_process::AP_CLIENT, 0 }
   ,{ "--server-id=",   atrt_process::AP_MYSQLD, PO_REP }
   ,{ "--log-bin",      atrt_process::AP_MYSQLD, PO_REP_MASTER }
+#if 0
   ,{ "--master-host=", atrt_process::AP_MYSQLD, PO_REP_SLAVE }
   ,{ "--master-port=", atrt_process::AP_MYSQLD, PO_REP_SLAVE }
   ,{ "--master-user=", atrt_process::AP_MYSQLD, PO_REP_SLAVE }
   ,{ "--master-password=", atrt_process::AP_MYSQLD, PO_REP_SLAVE }
+#endif
   ,{ "--ndb-connectstring=", atrt_process::AP_MYSQLD | atrt_process::AP_CLUSTER
      ,PO_NDB }
   ,{ "--ndbcluster", atrt_process::AP_MYSQLD, PO_NDB }

Thread
bzr commit into mysql-5.1 branch (jonas:2671) Jonas Oreland25 Sep