List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:January 14 2011 2:39pm
Subject:bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4118 to 4119)
View as plain text  
 4119 Magnus Blåudd	2011-01-14
      ndb
       - add support for compiling ha_ndbcluster against a server without
        --server-id-bits

    modified:
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_glue.h
 4118 Magnus Blåudd	2011-01-14
      ndb
       - thd->command renamed to thd->m_command and accessor function added
         in 5.6
       - write 'thd_set_command' to bridge the gap

    modified:
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_glue.h
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-01-14 14:25:18 +0000
+++ b/sql/ha_ndbcluster.cc	2011-01-14 14:37:28 +0000
@@ -67,7 +67,6 @@ static ulong opt_ndb_cache_check_time;
 static uint opt_ndb_cluster_connection_pool;
 static char* opt_ndb_connectstring;
 static uint opt_ndb_nodeid;
-extern ulong opt_server_id_mask;
 
 static MYSQL_THDVAR_UINT(
   autoincrement_prefetch_sz,         /* name */
@@ -3710,9 +3709,8 @@ ha_ndbcluster::eventSetAnyValue(THD *thd
         In future it may be useful to support *not* mapping composite
         AnyValues to/from Binlogged server-ids
       */
-      assert(thd->server_id == (thd->unmasked_server_id & opt_server_id_mask));
       options->optionsPresent |= NdbOperation::OperationOptions::OO_ANYVALUE;
-      options->anyValue = thd->unmasked_server_id;
+      options->anyValue = thd_unmasked_server_id(thd);
     }
     else if (thd_ndb->trans_options & TNTO_NO_LOGGING)
     {

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2011-01-14 14:27:09 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2011-01-14 14:37:28 +0000
@@ -47,7 +47,6 @@ extern my_bool opt_ndb_log_updated_only;
 extern my_bool opt_ndb_log_binlog_index;
 extern my_bool opt_ndb_log_apply_status;
 extern ulong opt_ndb_extra_logging;
-extern ulong opt_server_id_mask;
 
 bool ndb_log_empty_epochs(void);
 
@@ -2277,8 +2276,7 @@ int ndbcluster_log_schema_op(THD *thd,
         */
         DBUG_PRINT("info", ("Replicated schema event with original server id %d",
                             thd->server_id));
-        assert(thd->server_id == (thd->unmasked_server_id & opt_server_id_mask));
-        anyValue = thd->unmasked_server_id;
+        anyValue = thd_unmasked_server_id(thd);
       }
 
 #ifndef DBUG_OFF
@@ -7005,4 +7003,11 @@ void ndbcluster_anyvalue_set_serverid(Ui
   anyValue |= (serverId & opt_server_id_mask); 
 }
 
+#ifdef NDB_WITHOUT_SERVER_ID_BITS
+
+/* No --server-id-bits=<bits> -> implement constant opt_server_id_mask */
+ulong opt_server_id_mask = ~0;
+
+#endif
+
 #endif

=== modified file 'sql/ha_ndbcluster_glue.h'
--- a/sql/ha_ndbcluster_glue.h	2011-01-14 14:27:09 +0000
+++ b/sql/ha_ndbcluster_glue.h	2011-01-14 14:37:28 +0000
@@ -115,6 +115,28 @@ enum column_format_type {
 
 #endif
 
+#if MYSQL_VERSION_ID >= 50600
+
+/* No support for --server-id-bits and thd->unmasked_server_id, yet */
+#define NDB_WITHOUT_SERVER_ID_BITS
+
+#endif
+
+extern ulong opt_server_id_mask;
+
+static inline
+uint32 thd_unmasked_server_id(const THD* thd)
+{
+#ifndef NDB_WITHOUT_SERVER_ID_BITS
+  const uint32 unmasked_server_id = thd->unmasked_server_id;
+  assert(thd->server_id == (thd->unmasked_server_id & opt_server_id_mask));
+  return unmasked_server_id;
+#else
+  return thd->server_id;
+#endif
+}
+
+
 /* extract the bitmask of options from THD */
 static inline
 ulonglong thd_options(const THD * thd)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4118 to 4119) Magnus Blåudd14 Jan