List:Commits« Previous MessageNext Message »
From:tomas Date:May 31 2006 9:24pm
Subject:bk commit into 5.1 tree (tomas:1.2181) BUG#18947
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
  1.2181 06/05/31 23:24:25 tomas@stripped +1 -0
  Bug #18947  	CRBR: order in binlog of create table and insert (on different table) not determ
  - move clear of slock until after completion of data events on the binlog

  sql/ha_ndbcluster_binlog.cc
    1.63 06/05/31 23:24:16 tomas@stripped +31 -22
    Bug #18947  	CRBR: order in binlog of create table and insert (on different table) not determ
    - move clear of slock until after completion of data events on the binlog

# 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:	poseidon.ndb.mysql.com
# Root:	/home/tomas/mysql-5.1-new-ndb

--- 1.62/sql/ha_ndbcluster_binlog.cc	2006-05-31 16:15:56 +02:00
+++ 1.63/sql/ha_ndbcluster_binlog.cc	2006-05-31 23:24:16 +02:00
@@ -1720,37 +1720,26 @@
       bitmap_init(&slock, schema->slock, 8*SCHEMA_SLOCK_SIZE, false);
       uint node_id= g_ndb_cluster_connection->node_id();
       ndbcluster_get_schema(tmp_share, schema);
+      enum SCHEMA_OP_TYPE schema_type= (enum SCHEMA_OP_TYPE)schema->type;
       DBUG_PRINT("info",
                  ("%s.%s: log query_length: %d  query: '%s'  type: %d",
                   schema->db, schema->name,
                   schema->query_length, schema->query,
-                  schema->type));
-      char key[FN_REFLEN];
-      build_table_filename(key, sizeof(key), schema->db, schema->name, "");
-      if ((enum SCHEMA_OP_TYPE)schema->type == SOT_CLEAR_SLOCK)
+                  schema_type));
+      if (schema_type == SOT_CLEAR_SLOCK)
       {
-        pthread_mutex_lock(&ndbcluster_mutex);
-        NDB_SCHEMA_OBJECT *ndb_schema_object=
-          (NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
-                                           (byte*) key, strlen(key));
-        if (ndb_schema_object)
-        {
-          pthread_mutex_lock(&ndb_schema_object->mutex);
-          memcpy(ndb_schema_object->slock, schema->slock,
-                 sizeof(ndb_schema_object->slock));
-          DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
-                    (char*)ndb_schema_object->slock_bitmap.bitmap,
-                    no_bytes_in_map(&ndb_schema_object->slock_bitmap));
-          pthread_mutex_unlock(&ndb_schema_object->mutex);
-          pthread_cond_signal(&injector_cond);
-        }
-        pthread_mutex_unlock(&ndbcluster_mutex);
+        /*
+          handle slock after epoch is completed to ensure that
+          schema events get inserted in the binlog after any data
+          events
+        */
+        post_epoch_log_list->push_back(schema, mem_root);
         DBUG_RETURN(0);
       }
       if (schema->node_id != node_id)
       {
         int log_query= 0, post_epoch_unlock= 0;
-        switch ((enum SCHEMA_OP_TYPE)schema->type)
+        switch (schema_type)
         {
         case SOT_DROP_TABLE:
           // fall through
@@ -1944,10 +1933,30 @@
                 schema->type));
     int log_query= 0;
     {
+      enum SCHEMA_OP_TYPE schema_type= (enum SCHEMA_OP_TYPE)schema->type;
       char key[FN_REFLEN];
       build_table_filename(key, sizeof(key), schema->db, schema->name, "");
+      if (schema_type == SOT_CLEAR_SLOCK)
+      {
+        pthread_mutex_lock(&ndbcluster_mutex);
+        NDB_SCHEMA_OBJECT *ndb_schema_object=
+          (NDB_SCHEMA_OBJECT*) hash_search(&ndb_schema_objects,
+                                           (byte*) key, strlen(key));
+        if (ndb_schema_object)
+        {
+          pthread_mutex_lock(&ndb_schema_object->mutex);
+          memcpy(ndb_schema_object->slock, schema->slock,
+                 sizeof(ndb_schema_object->slock));
+          DBUG_DUMP("ndb_schema_object->slock_bitmap.bitmap",
+                    (char*)ndb_schema_object->slock_bitmap.bitmap,
+                    no_bytes_in_map(&ndb_schema_object->slock_bitmap));
+          pthread_mutex_unlock(&ndb_schema_object->mutex);
+          pthread_cond_signal(&injector_cond);
+        }
+        pthread_mutex_unlock(&ndbcluster_mutex);
+        continue;
+      }
       NDB_SHARE *share= get_share(key, 0, false, false);
-      enum SCHEMA_OP_TYPE schema_type= (enum SCHEMA_OP_TYPE)schema->type;
       switch (schema_type)
       {
       case SOT_DROP_DB:
Thread
bk commit into 5.1 tree (tomas:1.2181) BUG#18947tomas31 May