List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:February 9 2011 11:18am
Subject:bzr commit into mysql-5.5-telco-7.0 branch (magnus.blaudd:3199)
View as plain text  
#At file:///home/msvensson/mysql/5.5-telco-7.0-run-query/ based on revid:magnus.blaudd@strippedbzmi5pvxojcq49g

 3199 Magnus Blåudd	2011-02-09
      ndb
       - Change 'ndbcluster_reset slave' to use Ndb_local_connection to delete all rows from
        mysql.ndb_apply_status

    modified:
      sql/ha_ndbcluster_binlog.cc
=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2011-02-09 11:17:47 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2011-02-09 11:18:42 +0000
@@ -840,23 +840,29 @@ int ndbcluster_binlog_end(THD *thd)
 ****************************************************************/
 static void ndbcluster_reset_slave(THD *thd)
 {
+  int error = 0;
   if (!ndb_binlog_running)
     return;
 
   DBUG_ENTER("ndbcluster_reset_slave");
-  char buf[1024];
-  char *end= strmov(buf, "DELETE FROM " NDB_REP_DB "." NDB_APPLY_TABLE);
-  run_query(thd, buf, end, NULL, TRUE, FALSE);
-  if (thd_stmt_da(thd)->is_error() &&
-      ((thd_stmt_da(thd)->sql_errno() == ER_NO_SUCH_TABLE)))
+
+  /*
+    delete all rows from mysql.ndb_apply_status table
+    - if table does not exist ignore the error as it
+      is a consistent behavior
+  */
+  Ndb_local_connection mysqld(thd);
+  const bool ignore_no_such_table = true;
+  if(mysqld.delete_rows(STRING_WITH_LEN("mysql"),
+                        STRING_WITH_LEN("ndb_apply_status"),
+                        ignore_no_such_table,
+                        NULL))
   {
-    /*
-      If table does not exist ignore the error as it
-      is a consistant behavior
-    */
-    thd_stmt_da(thd)->reset_diagnostics_area();
+    // Failed to delete rows from table
+    error = 1;
   }
 
+  // pending fix for bug#59844 will make this function return int
   DBUG_VOID_RETURN;
 }
 

Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110209111842-5aqelsfy65qtllem.bundle
Thread
bzr commit into mysql-5.5-telco-7.0 branch (magnus.blaudd:3199) Magnus Blåudd9 Feb