List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:September 22 2011 2:02pm
Subject:bzr push into mysql-trunk-cluster branch (magnus.blaudd:3357 to 3362)
View as plain text  
 3362 magnus.blaudd@stripped	2011-09-22 [merge]
      Merge

    modified:
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster_binlog.h
      sql/handler.cc
      sql/handler.h
      sql/lock.h
      sql/ndb_global_schema_lock.cc
      sql/ndb_global_schema_lock.h
      sql/sql_db.cc
      sql/sql_parse.cc
      sql/sql_rename.cc
      sql/sql_table.cc
      sql/sql_truncate.cc
      storage/ndb/CMakeLists.txt
      storage/ndb/src/common/logger/FileLogHandler.cpp
      storage/ndb/src/common/util/File.cpp
 3361 magnus.blaudd@stripped	2011-09-20 [merge]
      Merge trunk-cluster -> trunk-cluster-merge

    modified:
      scripts/mysql_config.pl.in
 3360 magnus.blaudd@stripped	2011-09-20
      ndb - set correct version

    modified:
      VERSION
 3359 magnus.blaudd@stripped	2011-09-20
      ndb 
       - revert MCP patch for bug#61708(which is added to vanilla trunk separately)

    modified:
      configure.cmake
 3358 magnus.blaudd@stripped	2011-09-20
      ndb
       - revert change to VERSION(this is no longer a MySQL Cluster branch)

    modified:
      VERSION
 3357 magnus.blaudd@stripped	2011-09-20
      ndb
       - remove MCP patch for 12762395 aka 61709

    modified:
      extra/perror.c
      plugin/auth/qa_auth_interface.c
      tests/mysql_client_test.c
=== modified file 'VERSION'
--- a/VERSION	2011-09-07 10:08:09 +0000
+++ b/VERSION	2011-09-20 14:31:23 +0000
@@ -1,4 +1,4 @@
 MYSQL_VERSION_MAJOR=5
 MYSQL_VERSION_MINOR=6
 MYSQL_VERSION_PATCH=4
-MYSQL_VERSION_EXTRA=-ndb-7.2.1-alpha
+MYSQL_VERSION_EXTRA=-m5

=== modified file 'configure.cmake'
--- a/configure.cmake	2011-09-07 10:08:09 +0000
+++ b/configure.cmake	2011-09-20 14:00:29 +0000
@@ -782,12 +782,7 @@ IF(NOT C_HAS_inline)
   static __inline int foo(){return 0;}
   int main(int argc, char *argv[]){return 0;}"
                             C_HAS___inline)
-  # MCP_BUG61708
-  IF (C_HAS___inline)
-    SET(C_INLINE __inline)
-  ELSE()
-    SET(C_INLINE)
-  ENDIF()
+  SET(C_INLINE __inline)
 ENDIF()
 
 IF(NOT CMAKE_CROSSCOMPILING AND NOT MSVC)

=== modified file 'scripts/mysql_config.pl.in'
--- a/scripts/mysql_config.pl.in	2011-09-07 10:08:09 +0000
+++ b/scripts/mysql_config.pl.in	2011-09-20 14:51:33 +0000
@@ -14,7 +14,7 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
 ##############################################################################
 #

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2011-09-07 10:08:09 +0000
+++ b/sql/ha_ndbcluster.cc	2011-09-22 14:00:22 +0000
@@ -11834,7 +11834,7 @@ static int ndbcluster_init(void *p)
   ndb_dictionary_is_mysqld= 1;
   ndb_setup_complete= 0;
   ndbcluster_hton= (handlerton *)p;
-  ndbcluster_global_schema_lock_init();
+  ndbcluster_global_schema_lock_init(ndbcluster_hton);
 
   {
     handlerton *h= ndbcluster_hton;

=== modified file 'sql/ha_ndbcluster_binlog.h'
--- a/sql/ha_ndbcluster_binlog.h	2011-09-07 10:08:09 +0000
+++ b/sql/ha_ndbcluster_binlog.h	2011-09-22 14:00:22 +0000
@@ -120,9 +120,6 @@ private:
 
 extern Ndb_cluster_connection* g_ndb_cluster_connection;
 
-void ndbcluster_global_schema_lock_init();
-void ndbcluster_global_schema_lock_deinit();
-
 extern unsigned char g_node_id_map[max_ndb_nodes];
 extern pthread_mutex_t LOCK_ndb_util_thread;
 extern pthread_cond_t COND_ndb_util_thread;

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2011-09-07 10:08:09 +0000
+++ b/sql/handler.cc	2011-09-22 14:00:22 +0000
@@ -4708,7 +4708,6 @@ int ha_make_pushed_joins(THD *thd, AQP::
 }
 #endif
 
-#ifdef HAVE_NDB_BINLOG
 /*
   TODO: change this into a dynamic struct
   List<handlerton> does not work as
@@ -4722,6 +4721,7 @@ struct hton_list_st
   uint sz;
 };
 
+#ifdef HAVE_NDB_BINLOG
 struct binlog_func_st
 {
   enum_binlog_func fn;
@@ -4846,6 +4846,91 @@ void ha_binlog_log_query(THD *thd, handl
 }
 #endif
 
+
+#ifndef MC_GLOBAL_SCHEMA_LOCK
+/**
+  Fill list of htons which are initialized and have the global_schema_func set
+*/
+static my_bool global_schema_func_list(THD *thd, plugin_ref plugin, void *arg)
+{
+  hton_list_st *hton_list= (hton_list_st *)arg;
+  handlerton *hton= plugin_data(plugin, handlerton *);
+  if (hton->state == SHOW_OPTION_YES && hton->global_schema_func)
+  {
+    uint sz= hton_list->sz;
+    if (sz == MAX_HTON_LIST_ST-1)
+    {
+      /* list full */
+      return FALSE;
+    }
+    hton_list->hton[sz]= hton;
+    hton_list->sz= sz+1;
+  }
+  return FALSE;
+}
+
+
+/**
+  Lock the global(distributed) schema lock
+*/
+static int ha_global_schema_lock(THD *thd, bool no_lock_queue)
+{
+  hton_list_st hton_list;
+  uint i, sz, res= 0;
+
+  hton_list.sz= 0;
+  plugin_foreach(thd, global_schema_func_list,
+                 MYSQL_STORAGE_ENGINE_PLUGIN, &hton_list);
+
+  for (i= 0, sz= hton_list.sz; i < sz ; i++)
+    res|= hton_list.hton[i]->global_schema_func(thd, true, (void*)no_lock_queue);
+  return res;
+}
+
+/**
+  Unlock the global(distributed) schema lock
+*/
+static int ha_global_schema_unlock(THD *thd)
+{
+  hton_list_st hton_list;
+  uint i, sz, res= 0;
+
+  hton_list.sz= 0;
+  plugin_foreach(thd, global_schema_func_list,
+                 MYSQL_STORAGE_ENGINE_PLUGIN, &hton_list);
+
+  for (i= 0, sz= hton_list.sz; i < sz ; i++)
+    res|= hton_list.hton[i]->global_schema_func(thd, false, NULL);
+  return res;
+}
+
+Ha_global_schema_lock_guard::Ha_global_schema_lock_guard(THD *thd)
+  : m_thd(thd), m_locked(false)
+{
+}
+
+Ha_global_schema_lock_guard::~Ha_global_schema_lock_guard()
+{
+  if (m_locked)
+    ha_global_schema_unlock(m_thd);
+}
+
+int Ha_global_schema_lock_guard::lock(bool no_lock_queue)
+{
+  /* only one lock call allowed */
+  DBUG_ASSERT(!m_locked);
+
+  /*
+    Always set m_locked, even if lock fails. Since the
+    lock/unlock calls are reference counted, the number
+    of calls to lock and unlock need to match up.
+  */
+  m_locked= true;
+
+  return ha_global_schema_lock(m_thd, no_lock_queue);
+}
+#endif
+
 /**
   Calculate cost of 'index only' scan for given index and number of records
 

=== modified file 'sql/handler.h'
--- a/sql/handler.h	2011-09-07 10:08:09 +0000
+++ b/sql/handler.h	2011-09-22 14:00:22 +0000
@@ -918,6 +918,9 @@ struct handlerton
    int (*make_pushed_join)(handlerton *hton, THD* thd,
                            AQP::Join_plan* plan);
 #endif
+#ifndef MCP_GLOBAL_SCHEMA_LOCK
+   int (*global_schema_func)(THD* thd, bool lock, void* args);
+#endif
 
    uint32 license; /* Flag for Engine License */
    void *data; /* Location for engines to keep personal structures */
@@ -2864,6 +2867,19 @@ int ha_binlog_end(THD *thd);
 #define ha_binlog_end(a)  do {} while (0)
 #endif
 
+#ifndef MCP_GLOBAL_SCHEMA_LOCK
+class Ha_global_schema_lock_guard
+{
+public:
+  Ha_global_schema_lock_guard(THD *thd);
+  ~Ha_global_schema_lock_guard();
+  int lock(bool no_lock_queue= false);
+private:
+  THD* m_thd;
+  bool m_locked;
+};
+#endif
+
 const char *get_canonical_filename(handler *file, const char *path,
                                    char *tmp_path);
 bool mysql_xa_recover(THD *thd);

=== modified file 'sql/lock.h'
--- a/sql/lock.h	2011-09-07 10:08:09 +0000
+++ b/sql/lock.h	2011-09-22 14:00:22 +0000
@@ -40,8 +40,4 @@ bool lock_schema_name(THD *thd, const ch
 bool lock_object_name(THD *thd, MDL_key::enum_mdl_namespace mdl_type,
                       const char *db, const char *name);
 
-#ifndef MCP_GLOBAL_SCHEMA_LOCK
-#include "ndb_global_schema_lock_guard.h" 
-#endif
-
 #endif /* LOCK_INCLUDED */

=== modified file 'sql/ndb_global_schema_lock.cc'
--- a/sql/ndb_global_schema_lock.cc	2011-09-06 12:43:05 +0000
+++ b/sql/ndb_global_schema_lock.cc	2011-09-22 14:00:22 +0000
@@ -177,7 +177,8 @@ private:
 
 extern ulong opt_ndb_extra_logging;
 
-static int
+static
+int
 ndbcluster_global_schema_lock(THD *thd, bool no_lock_queue,
                               bool report_cluster_disconnected)
 {
@@ -352,15 +353,30 @@ ndbcluster_global_schema_unlock(THD *thd
   DBUG_RETURN(0);
 }
 
+static
+int
+ndbcluster_global_schema_func(THD *thd, bool lock, void* args)
+{
+  if (lock)
+  {
+    bool no_lock_queue = (bool)args;
+    return ndbcluster_global_schema_lock(thd, no_lock_queue, true);
+  }
+ 
+  return ndbcluster_global_schema_unlock(thd);
+}
+
 #include "ndb_global_schema_lock.h"
 
-void ndbcluster_global_schema_lock_init(void)
+void ndbcluster_global_schema_lock_init(handlerton *hton)
 {
   assert(gsl_initialized == false);
   assert(gsl_is_locked_or_queued == 0);
   assert(gsl_no_locking_allowed == 0);
   gsl_initialized= true;
   pthread_mutex_init(&gsl_mutex, MY_MUTEX_INIT_FAST);
+
+  hton->global_schema_func= ndbcluster_global_schema_func;
 }
 
 

=== modified file 'sql/ndb_global_schema_lock.h'
--- a/sql/ndb_global_schema_lock.h	2011-03-08 22:08:44 +0000
+++ b/sql/ndb_global_schema_lock.h	2011-09-22 14:00:22 +0000
@@ -18,7 +18,7 @@
 #ifndef NDB_GLOBAL_SCHEMA_LOCK_H
 #define NDB_GLOBAL_SCHEMA_LOCK_H
 
-void ndbcluster_global_schema_lock_init(void);
+void ndbcluster_global_schema_lock_init(struct handlerton*);
 void ndbcluster_global_schema_lock_deinit(void);
 
 #endif

=== modified file 'sql/sql_db.cc'
--- a/sql/sql_db.cc	2011-09-07 10:08:09 +0000
+++ b/sql/sql_db.cc	2011-09-22 14:00:22 +0000
@@ -561,7 +561,7 @@ int mysql_create_db(THD *thd, char *db, 
   }
   
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
   (void)global_schema_lock.lock();
  #endif
 
@@ -698,7 +698,7 @@ bool mysql_alter_db(THD *thd, const char
   DBUG_ENTER("mysql_alter_db");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
   (void)global_schema_lock.lock();
 #endif
 
@@ -784,7 +784,7 @@ bool mysql_rm_db(THD *thd,char *db,bool 
   DBUG_ENTER("mysql_rm_db");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
   (void)global_schema_lock.lock();
  #endif
 

=== modified file 'sql/sql_parse.cc'
--- a/sql/sql_parse.cc	2011-09-07 10:08:09 +0000
+++ b/sql/sql_parse.cc	2011-09-22 14:00:22 +0000
@@ -2658,7 +2658,7 @@ case SQLCOM_PREPARE:
       }
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-      Ndb_global_schema_lock_guard global_schema_lock(thd);
+      Ha_global_schema_lock_guard global_schema_lock(thd);
 
       if (!(create_info.options & HA_LEX_CREATE_TMP_TABLE))
         (void)global_schema_lock.lock();

=== modified file 'sql/sql_rename.cc'
--- a/sql/sql_rename.cc	2011-09-07 10:08:09 +0000
+++ b/sql/sql_rename.cc	2011-09-22 14:00:22 +0000
@@ -49,7 +49,7 @@ bool mysql_rename_tables(THD *thd, TABLE
   DBUG_ENTER("mysql_rename_tables");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
 #endif
   /*
     Avoid problems with a rename on a table that we have locked or

=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc	2011-09-20 09:38:51 +0000
+++ b/sql/sql_table.cc	2011-09-22 14:00:22 +0000
@@ -2044,7 +2044,7 @@ bool mysql_rm_table(THD *thd,TABLE_LIST 
   DBUG_ENTER("mysql_rm_table");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
 #endif
 
   /* Disable drop of enabled log tables, must be done before name locking */
@@ -4570,7 +4570,7 @@ bool mysql_create_table(THD *thd, TABLE_
   DBUG_ENTER("mysql_create_table");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
   if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE) &&
       !create_info->frm_only)
   {
@@ -4795,7 +4795,7 @@ bool mysql_create_like_table(THD* thd, T
   DBUG_ENTER("mysql_create_like_table");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK 
-  Ndb_global_schema_lock_guard global_schema_lock(thd);
+  Ha_global_schema_lock_guard global_schema_lock(thd);
  
   if (!(create_info->options & HA_LEX_CREATE_TMP_TABLE))
     (void)global_schema_lock.lock();
@@ -7156,7 +7156,7 @@ bool mysql_alter_table(THD *thd,char *ne
   }
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
+  Ha_global_schema_lock_guard global_schema_lock_guard(thd);
   if (ha_legacy_type(table->s->db_type()) == DB_TYPE_NDBCLUSTER ||
       ha_legacy_type(create_info->db_type) == DB_TYPE_NDBCLUSTER)
   {

=== modified file 'sql/sql_truncate.cc'
--- a/sql/sql_truncate.cc	2011-07-05 23:02:21 +0000
+++ b/sql/sql_truncate.cc	2011-09-22 14:00:22 +0000
@@ -401,7 +401,7 @@ bool Sql_cmd_truncate_table::truncate_ta
   DBUG_ENTER("Sql_cmd_truncate_table::truncate_table");
 
 #ifndef MCP_GLOBAL_SCHEMA_LOCK
-  Ndb_global_schema_lock_guard global_schema_lock_guard(thd);
+  Ha_global_schema_lock_guard global_schema_lock_guard(thd);
 #endif
   DBUG_ASSERT((!table_ref->table) ||
               (table_ref->table && table_ref->table->s));

=== modified file 'storage/ndb/CMakeLists.txt'
--- a/storage/ndb/CMakeLists.txt	2011-09-02 09:16:56 +0000
+++ b/storage/ndb/CMakeLists.txt	2011-09-22 14:00:22 +0000
@@ -38,19 +38,14 @@ MACRO(NDB_CHECK_MYSQL_CLUSTER version_st
 
     # Split the cluster_version further into Y.Y.Y subcomponents
     IF(${cluster_version} MATCHES "([0-9]+)\\.([0-9]+)\\.([0-9]+)")
-      SET(MYSQL_CLUSTER_VERSION_MAJOR ${CMAKE_MATCH_1} CACHE INTERNAL
-        "MySQL Cluster Major version calculated from MySQL version" FORCE)
-      SET(MYSQL_CLUSTER_VERSION_MINOR ${CMAKE_MATCH_2} CACHE INTERNAL
-        "MySQL Cluster Minor version calculated from MySQL version" FORCE)
-      SET(MYSQL_CLUSTER_VERSION_BUILD ${CMAKE_MATCH_3} CACHE INTERNAL
-        "MySQL Cluster Build version calculated from MySQL version" FORCE)
+      SET(MYSQL_CLUSTER_VERSION_MAJOR ${CMAKE_MATCH_1})
+      SET(MYSQL_CLUSTER_VERSION_MINOR ${CMAKE_MATCH_2})
+      SET(MYSQL_CLUSTER_VERSION_BUILD ${CMAKE_MATCH_3})
     ENDIF()
 
     # Finally set MYSQL_CLUSTER_VERSION to be used as an indicator
     # that this is a MySQL Cluster build, yay!
-    SET(MYSQL_CLUSTER_VERSION ${cluster_version} CACHE INTERNAL
-      "This is MySQL Cluster" FORCE)
-
+    SET(MYSQL_CLUSTER_VERSION ${cluster_version})
   ENDIF()
 ENDMACRO()
 
@@ -64,167 +59,160 @@ IF(CMAKE_CXX_FLAGS)
   STRING(REPLACE "-Werror" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 ENDIF()
 
-IF (MYSQL_VERSION_ID LESS 50500)
-  # Use same compiler defines as MySQL Server for debug compile
-  MESSAGE(STATUS "Setting same debug compile defines")
-  SET(CMAKE_CXX_FLAGS_DEBUG
-      "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-  SET(CMAKE_C_FLAGS_DEBUG
-      "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX")
-ENDIF()
+NDB_CHECK_MYSQL_CLUSTER(${VERSION})
 
-IF(SOURCE_SUBLIBS)
-  # Sourced by libmysqld/CMakeLists.txt in 5.1 only to get
-  # NDBCLUSTER_SOURCES and NDBCLUSTER_LIBS, don't configure
-  # again
-ELSE()
+#
+# Add the ndbcluster plugin
+#
+SET(NDBCLUSTER_SOURCES
+  ../../sql/ha_ndbcluster.cc
+  ../../sql/ha_ndbcluster_cond.cc
+  ../../sql/ha_ndbcluster_push.cc
+  ../../sql/ha_ndbcluster_connection.cc
+  ../../sql/ha_ndbcluster_binlog.cc
+  ../../sql/ha_ndb_index_stat.cc
+  ../../sql/ha_ndbinfo.cc
+  ../../sql/ndb_local_connection.cc
+  ../../sql/ndb_share.cc
+  ../../sql/ndb_thd.cc
+  ../../sql/ndb_thd_ndb.cc
+  ../../sql/ndb_global_schema_lock.cc
+  ../../sql/ndb_mi.cc
+)
 
-  NDB_CHECK_MYSQL_CLUSTER(${VERSION})
+# Inlude directories used when building ha_ndbcluster
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include)
 
-  INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ndb_configure.cmake)
+# NDB is DEFAULT plugin in MySQL Cluster
+SET(is_default_plugin "")
+IF(MYSQL_CLUSTER_VERSION)
+  SET(is_default_plugin "DEFAULT")
+ENDIF()
 
-  INCLUDE_DIRECTORIES(
-    # MySQL Server includes
-    ${CMAKE_SOURCE_DIR}/include
-    ${CMAKE_BINARY_DIR}/include
-
-    # NDB includes
-    ${CMAKE_CURRENT_SOURCE_DIR}/include
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/util
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/portlib
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/debugger
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/transporter
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/kernel
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/mgmapi
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/mgmcommon
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/ndbapi
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/logger
-    ${CMAKE_CURRENT_BINARY_DIR}/include
-
-    # Util library includes
-    ${ZLIB_INCLUDE_DIR}
-    ${READLINE_INCLUDE_DIR})
-
-  # The root of storage/ndb/
-  SET(NDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-
-  OPTION(WITH_NDB_TEST
-    "Include the NDB Cluster ndbapi test programs" OFF)
-  IF(WITH_NDB_TEST)
-    MESSAGE(STATUS "Building NDB test programs")
+MYSQL_ADD_PLUGIN(ndbcluster ${NDBCLUSTER_SOURCES} STORAGE_ENGINE
+  ${is_default_plugin} STATIC_ONLY RECOMPILE_FOR_EMBEDDED
+  LINK_LIBRARIES ndbclient)
+
+IF (NOT MCP_BUG58158)
+  IF(WITH_EMBEDDED_SERVER)
+    # Kludge libndbclient into variable used when creating libmysqld
+    SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
+      ndbclient_static CACHE INTERNAL "" FORCE)
   ENDIF()
+ENDIF()
 
-  OPTION(WITH_NDB_BINLOG
-    "Disable NDB binlog" ON)
 
-  OPTION(WITH_ERROR_INSERT
-    "Enable error injection in MySQL Cluster" OFF)
+#
+# Add NDB binaries if ndbcluster is built
+#
+IF (NOT DEFINED WITH_NDBCLUSTER)
+  # Not building NDB 
+  IF(MYSQL_CLUSTER_VERSION)
+    MESSAGE(FATAL_ERROR "This is MySQL Cluster, you can't build it without the NDB engine")
+  ENDIF()
 
-  OPTION(WITH_NDB_DEBUG
-    "Disable special ndb debug features" OFF)
+  RETURN()
+ENDIF()
 
-  SET(NDB_CCFLAGS "")
-  IF(DEFINED WITH_NDB_CCFLAGS)
-    SET(NDB_CCFLAGS "${WITH_NDB_CCFLAGS}")
-  ENDIF() 
-
-  IF(WITH_NDB_DEBUG OR CMAKE_BUILD_TYPE MATCHES "Debug")
-    SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DVM_TRACE -DNDB_DEBUG -DERROR_INSERT -DARRAY_GUARD -DACC_SAFE_QUEUE -DAPI_TRACE")
-  ELSE()
-    IF(WITH_ERROR_INSERT)
-      SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DERROR_INSERT")
-    ENDIF()
-    SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DNDEBUG")
-  ENDIF()
+MESSAGE(STATUS "Building NDB")
 
-  SET(NDB_CCFLAGS "${NDB_CCFLAGS} $ENV{NDB_EXTRA_FLAGS}") 
-  MESSAGE(STATUS "Using extra FLAGS for ndb: \"${NDB_CCFLAGS}\"") 
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ndb_configure.cmake)
 
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NDB_CCFLAGS}")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NDB_CCFLAGS}")
+INCLUDE_DIRECTORIES(
+  # MySQL Server includes
+  ${CMAKE_SOURCE_DIR}/include
+  ${CMAKE_BINARY_DIR}/include
+
+  # NDB includes
+  ${CMAKE_CURRENT_SOURCE_DIR}/include
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/util
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/portlib
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/debugger
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/transporter
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/kernel
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/mgmapi
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/mgmcommon
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/ndbapi
+  ${CMAKE_CURRENT_SOURCE_DIR}/include/logger
+  ${CMAKE_CURRENT_BINARY_DIR}/include
+
+  # Util library includes
+  ${ZLIB_INCLUDE_DIR}
+  ${READLINE_INCLUDE_DIR})
+
+# The root of storage/ndb/
+SET(NDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+OPTION(WITH_NDB_TEST
+  "Include the NDB Cluster ndbapi test programs" OFF)
+IF(WITH_NDB_TEST)
+  MESSAGE(STATUS "Building NDB test programs")
+ENDIF()
 
-  # Check for Java and JDK needed by ndbjtie and clusterj
-  INCLUDE(FindJava)
-  INCLUDE(FindJNI)
-  INCLUDE("${CMAKE_SOURCE_DIR}/storage/ndb/config/type_JAVA.cmake")
-
-  IF(JAVA_COMPILE AND JAVA_ARCHIVE)
-    MESSAGE(STATUS "Found Java")
-    SET(HAVE_JAVA TRUE)
-  ELSE()
-    MESSAGE(STATUS "Could not find Java")
-    SET(HAVE_JAVA FALSE)
-  ENDIF()
+OPTION(WITH_NDB_BINLOG
+  "Disable NDB binlog" ON)
 
-  IF(JAVA_INCLUDE_PATH AND JAVA_INCLUDE_PATH2)
-    MESSAGE(STATUS "Found JDK")
-    SET(HAVE_JDK TRUE)
-  ELSE()
-    MESSAGE(STATUS "Could not find JDK")
-    SET(HAVE_JDK FALSE)
-  ENDIF()
+OPTION(WITH_ERROR_INSERT
+  "Enable error injection in MySQL Cluster" OFF)
 
-  SET(WITH_CLASSPATH ${WITH_CLASSPATH} CACHE STRING
-    "Enable the classpath for MySQL Cluster Java Connector")
+OPTION(WITH_NDB_DEBUG
+  "Disable special ndb debug features" OFF)
 
-  ADD_SUBDIRECTORY(include)
-  ADD_SUBDIRECTORY(src)
-  ADD_SUBDIRECTORY(tools)
-  ADD_SUBDIRECTORY(test)
-  IF(WITH_NDB_TEST)
-    ADD_SUBDIRECTORY(src/cw/cpcd)
-  ENDIF()
-  IF (HAVE_JDK)
-    ADD_SUBDIRECTORY(clusterj)
-  ENDIF()
+SET(NDB_CCFLAGS "")
+IF(DEFINED WITH_NDB_CCFLAGS)
+  SET(NDB_CCFLAGS "${WITH_NDB_CCFLAGS}")
+ENDIF() 
 
+IF(WITH_NDB_DEBUG OR CMAKE_BUILD_TYPE MATCHES "Debug")
+  SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DVM_TRACE -DNDB_DEBUG -DERROR_INSERT -DARRAY_GUARD -DACC_SAFE_QUEUE -DAPI_TRACE")
+ELSE()
+  IF(WITH_ERROR_INSERT)
+    SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DERROR_INSERT")
+  ENDIF()
+  SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DNDEBUG")
 ENDIF()
 
+SET(NDB_CCFLAGS "${NDB_CCFLAGS} $ENV{NDB_EXTRA_FLAGS}") 
+MESSAGE(STATUS "Using extra FLAGS for ndb: \"${NDB_CCFLAGS}\"") 
 
-IF(WITHOUT_PARTITION_STORAGE_ENGINE)
-  MESSAGE(FATAL_ERROR "NDBCLUSTER can't be compiled without PARTITION")
-ENDIF(WITHOUT_PARTITION_STORAGE_ENGINE)
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NDB_CCFLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NDB_CCFLAGS}")
 
-SET(NDBCLUSTER_SOURCES
-  ../../sql/ha_ndbcluster.cc
-  ../../sql/ha_ndbcluster_cond.cc
-  ../../sql/ha_ndbcluster_push.cc
-  ../../sql/ha_ndbcluster_connection.cc
-  ../../sql/ha_ndbcluster_binlog.cc
-  ../../sql/ha_ndb_index_stat.cc
-  ../../sql/ha_ndbinfo.cc
-  ../../sql/ndb_local_connection.cc
-  ../../sql/ndb_share.cc
-  ../../sql/ndb_thd.cc
-  ../../sql/ndb_thd_ndb.cc
-  ../../sql/ndb_global_schema_lock.cc
-  ../../sql/ndb_mi.cc
-)
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include)
+# Check for Java and JDK needed by ndbjtie and clusterj
+INCLUDE(FindJava)
+INCLUDE(FindJNI)
+INCLUDE("${CMAKE_SOURCE_DIR}/storage/ndb/config/type_JAVA.cmake")
+
+IF(JAVA_COMPILE AND JAVA_ARCHIVE)
+  MESSAGE(STATUS "Found Java")
+  SET(HAVE_JAVA TRUE)
+ELSE()
+  MESSAGE(STATUS "Could not find Java")
+  SET(HAVE_JAVA FALSE)
+ENDIF()
 
-IF(EXISTS ${CMAKE_SOURCE_DIR}/storage/mysql_storage_engine.cmake)
-  # Old plugin support on Windows only
-  INCLUDE(${CMAKE_SOURCE_DIR}/storage/mysql_storage_engine.cmake)
-  SET(NDBCLUSTER_LIBS ndbclient)
-  MYSQL_STORAGE_ENGINE(NDBCLUSTER)
+IF(JAVA_INCLUDE_PATH AND JAVA_INCLUDE_PATH2)
+  MESSAGE(STATUS "Found JDK")
+  SET(HAVE_JDK TRUE)
 ELSE()
-  # New plugin support, cross-platform
-  
-  # NDB is DEFAULT plugin in MySQL Cluster
-  SET(is_default_plugin "")
-  IF(MYSQL_CLUSTER_VERSION)
-    SET(is_default_plugin "DEFAULT")
-  ENDIF()
+  MESSAGE(STATUS "Could not find JDK")
+  SET(HAVE_JDK FALSE)
+ENDIF()
 
-  MYSQL_ADD_PLUGIN(ndbcluster ${NDBCLUSTER_SOURCES} STORAGE_ENGINE
-    ${is_default_plugin} STATIC_ONLY RECOMPILE_FOR_EMBEDDED
-    LINK_LIBRARIES ndbclient)
-
-  IF (NOT MCP_BUG58158)
-    IF(WITH_EMBEDDED_SERVER)
-      # Kludge libndbclient into variable used when creating libmysqld
-      SET (MYSQLD_STATIC_PLUGIN_LIBS ${MYSQLD_STATIC_PLUGIN_LIBS}
-	ndbclient CACHE INTERNAL "" FORCE)
-    ENDIF()
-  ENDIF()
+SET(WITH_CLASSPATH ${WITH_CLASSPATH} CACHE STRING
+  "Enable the classpath for MySQL Cluster Java Connector")
+
+ADD_SUBDIRECTORY(include)
+ADD_SUBDIRECTORY(src)
+ADD_SUBDIRECTORY(tools)
+ADD_SUBDIRECTORY(test)
+IF(WITH_NDB_TEST)
+  ADD_SUBDIRECTORY(src/cw/cpcd)
+ENDIF()
+IF (HAVE_JDK)
+  ADD_SUBDIRECTORY(clusterj)
 ENDIF()
+
+IF(WITHOUT_PARTITION_STORAGE_ENGINE)
+  MESSAGE(FATAL_ERROR "NDBCLUSTER can't be compiled without PARTITION")
+ENDIF(WITHOUT_PARTITION_STORAGE_ENGINE)

=== modified file 'storage/ndb/src/common/logger/FileLogHandler.cpp'
--- a/storage/ndb/src/common/logger/FileLogHandler.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/common/logger/FileLogHandler.cpp	2011-09-22 14:00:22 +0000
@@ -18,7 +18,7 @@
 
 #include <ndb_global.h>
 #include <FileLogHandler.hpp>
-#include <File.hpp>
+#include <util/File.hpp>
 
 //
 // PUBLIC

=== modified file 'storage/ndb/src/common/util/File.cpp'
--- a/storage/ndb/src/common/util/File.cpp	2011-07-05 12:46:07 +0000
+++ b/storage/ndb/src/common/util/File.cpp	2011-09-22 14:00:22 +0000
@@ -17,7 +17,7 @@
 
 #include <ndb_global.h>
 
-#include <File.hpp>
+#include <util/File.hpp>
 #include <NdbOut.hpp>
 
 //

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-cluster branch (magnus.blaudd:3357 to 3362) magnus.blaudd23 Sep