MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:June 7 2007 9:05am
Subject:bk commit into 5.1 tree (tomas:1.2526)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-06-07 11:05:33+02:00, tomas@stripped +3 -0
  WL#3867 -
  as there may be 2 different events defined on a table we need to drop both

  sql/ha_ndbcluster.cc@stripped, 2007-06-07 11:05:30+02:00, tomas@stripped +5 -10
    as there may be 2 different events defined on a table we need to drop both

  sql/ha_ndbcluster_binlog.cc@stripped, 2007-06-07 11:05:30+02:00, tomas@stripped +16 -5
    as there may be 2 different events defined on a table we need to drop both

  sql/ha_ndbcluster_binlog.h@stripped, 2007-06-07 11:05:30+02:00, tomas@stripped +3 -2
    as there may be 2 different events defined on a table we need to drop both

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tomas
# Host:	whalegate.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-wl3867

--- 1.476/sql/ha_ndbcluster.cc	2007-06-06 15:59:03 +02:00
+++ 1.477/sql/ha_ndbcluster.cc	2007-06-07 11:05:30 +02:00
@@ -6492,11 +6492,8 @@
   if (!IS_TMP_PREFIX(m_tabname))
   {
     is_old_table_tmpfile= 0;
-    String event_name(INJECTOR_EVENT_LEN);
-    ndb_rep_event_name(&event_name, from + sizeof(share_prefix) - 1, 0,
-                       get_binlog_full(share));
-    ndbcluster_handle_drop_table(ndb, event_name.c_ptr(), share,
-                                 "rename table");
+    ndbcluster_handle_drop_table(ndb, share, "rename table",
+                                 from + sizeof(share_prefix) - 1);
   }
 
   if (!result && !IS_TMP_PREFIX(new_tabname))
@@ -6735,12 +6732,10 @@
 
   if (!IS_TMP_PREFIX(table_name))
   {
-    String event_name(INJECTOR_EVENT_LEN);
-    ndb_rep_event_name(&event_name, path + sizeof(share_prefix) - 1, 0,
-                       get_binlog_full(share));
     ndbcluster_handle_drop_table(ndb,
-                                 table_dropped ? event_name.c_ptr() : 0,
-                                 share, "delete table");
+                                 share, "delete table",
+                                 table_dropped ?
+                                 (path + sizeof(share_prefix) - 1) : 0);
   }
 
   if (share)

--- 1.124/sql/ha_ndbcluster_binlog.cc	2007-06-06 19:37:39 +02:00
+++ 1.125/sql/ha_ndbcluster_binlog.cc	2007-06-07 11:05:30 +02:00
@@ -3540,15 +3540,26 @@
   (unless it has already dropped... then share->op == 0)
 */
 int
-ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
-                             NDB_SHARE *share, const char *type_str)
+ndbcluster_handle_drop_table(Ndb *ndb, NDB_SHARE *share, const char *type_str,
+                             const char *event_name_prefix)
 {
   DBUG_ENTER("ndbcluster_handle_drop_table");
   THD *thd= current_thd;
 
-  NDBDICT *dict= ndb->getDictionary();
-  if (event_name && dict->dropEvent(event_name))
+  /*
+    There might be 2 types of events setup for the table, we cannot know
+    which ones are supposed to be there as they may have been created
+    differently for different mysqld's.  So we drop both
+  */
+  for (uint i= 0; event_name_prefix && i < 1; i++)
   {
+    NDBDICT *dict= ndb->getDictionary();
+    String event_name(INJECTOR_EVENT_LEN);
+    ndb_rep_event_name(&event_name, event_name_prefix, 0, i);
+
+    if (!dict->dropEvent(event_name.c_ptr()))
+      continue;
+
     if (dict->getNdbError().code != 4710)
     {
       /* drop event failed for some reason, issue a warning */
@@ -3559,7 +3570,7 @@
       /* error is not that the event did not exist */
       sql_print_error("NDB Binlog: Unable to drop event in database. "
                       "Event: %s Error Code: %d Message: %s",
-                      event_name,
+                      event_name.c_ptr(),
                       dict->getNdbError().code,
                       dict->getNdbError().message);
       /* ToDo; handle error? */

--- 1.28/sql/ha_ndbcluster_binlog.h	2007-06-06 15:59:04 +02:00
+++ 1.29/sql/ha_ndbcluster_binlog.h	2007-06-07 11:05:30 +02:00
@@ -151,9 +151,10 @@
                              const char *new_db,
                              const char *new_table_name,
                              int have_lock_open);
-int ndbcluster_handle_drop_table(Ndb *ndb, const char *event_name,
+int ndbcluster_handle_drop_table(Ndb *ndb,
                                  NDB_SHARE *share,
-                                 const char *type_str);
+                                 const char *type_str,
+                                 const char *event_name_postfix);
 void ndb_rep_event_name(String *event_name,
                         const char *db, const char *tbl, my_bool full);
 
Thread
bk commit into 5.1 tree (tomas:1.2526)tomas7 Jun