List:Commits« Previous MessageNext Message »
From:magnus.blaudd Date:September 25 2011 8:37pm
Subject:bzr push into mysql-trunk-cluster branch (magnus.blaudd:3356 to 3368)
View as plain text  
 3368 magnus.blaudd@stripped	2011-09-25
      Merge 5.5-cluster -> trunk-cluster

    modified:
      mysql-test/suite/innodb/r/innodb-index.result
 3367 magnus.blaudd@stripped	2011-09-25
      Bug#12664797: PFS_UPGRADE.RESULT LINE NUMBER DIFF WHEN MYSQL_SYSTEM_TABLES.SQL
      MODIFIED
       - another correction of the line numbers in .result file

    modified:
      mysql-test/suite/perfschema/r/pfs_upgrade.result
 3366 magnus.blaudd@stripped	2011-09-25
      ndb
        - fix remaining .result diffs in funcs_1 caused by new
          ndb_binglog_index schema

    modified:
      mysql-test/suite/funcs_1/r/is_columns_mysql.result
      mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result
      mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
 3365 magnus.blaudd@stripped	2011-09-23
      Merge 5.5-cluster -> trunk-cluster

    modified:
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_glue.h
      storage/ndb/CMakeLists.txt
 3364 magnus.blaudd@stripped	2011-09-23 [merge]
      Null merge trunk-cluster-merge -> trunk-cluster

 3363 magnus.blaudd@stripped	2011-09-23
      ndb
       - remove temp hack which allowed bzero in ha_ndb*
       - didn't work on Win

    modified:
      sql/ha_ndbcluster_glue.h
 3362 magnus.blaudd@stripped	2011-09-23
      Merge

    modified:
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/ha_ndbcluster_binlog.cc
 3361 magnus.blaudd@stripped	2011-09-23
      Merge

    modified:
      storage/ndb/CMakeLists.txt
 3360 magnus.blaudd@stripped	2011-09-23
      Merge

    modified:
      storage/ndb/CMakeLists.txt
 3359 magnus.blaudd@stripped	2011-09-22
      ndb no ndbclient_static in this version yet

    modified:
      storage/ndb/CMakeLists.txt
 3358 magnus.blaudd@stripped	2011-09-22
      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
 3357 magnus.blaudd@stripped	2011-09-20
      ndb - erase another copyright diff in scripts

    modified:
      scripts/mysql_config.pl.in
 3356 magnus.blaudd@stripped	2011-09-20
      ndb - erase another copyright diffs in client/

    modified:
      client/client_priv.h
=== modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result	2011-09-06 12:43:05 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.result	2011-09-25 19:36:01 +0000
@@ -111,7 +111,7 @@ def	mysql	innodb_table_stats	n_rows	4	NU
 def	mysql	innodb_table_stats	stats_timestamp	3	CURRENT_TIMESTAMP	NO	timestamp	NULL	NULL	NULL	NULL	NULL	NULL	timestamp		on update CURRENT_TIMESTAMP	select,insert,update,references	
 def	mysql	innodb_table_stats	sum_of_other_index_sizes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
 def	mysql	innodb_table_stats	table_name	2	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI		select,insert,update,references	
-def	mysql	ndb_binlog_index	deletes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned			select,insert,update,references	
+def	mysql	ndb_binlog_index	deletes	6	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	
 def	mysql	ndb_binlog_index	epoch	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned	PRI		select,insert,update,references	
 def	mysql	ndb_binlog_index	File	2	NULL	NO	varchar	255	255	NULL	NULL	latin1	latin1_swedish_ci	varchar(255)			select,insert,update,references	
 def	mysql	ndb_binlog_index	gci	10	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned			select,insert,update,references	

=== modified file 'mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result	2011-09-06 12:43:05 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result	2011-09-25 19:36:01 +0000
@@ -111,13 +111,16 @@ def	mysql	innodb_table_stats	n_rows	4	NU
 def	mysql	innodb_table_stats	stats_timestamp	3	CURRENT_TIMESTAMP	NO	timestamp	NULL	NULL	NULL	NULL	NULL	NULL	timestamp		on update CURRENT_TIMESTAMP		
 def	mysql	innodb_table_stats	sum_of_other_index_sizes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
 def	mysql	innodb_table_stats	table_name	2	NULL	NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
-def	mysql	ndb_binlog_index	deletes	6	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	ndb_binlog_index	deletes	6	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned				
 def	mysql	ndb_binlog_index	epoch	3	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned	PRI			
 def	mysql	ndb_binlog_index	File	2	NULL	NO	varchar	255	255	NULL	NULL	latin1	latin1_swedish_ci	varchar(255)				
-def	mysql	ndb_binlog_index	inserts	4	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	ndb_binlog_index	gci	10	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned				
+def	mysql	ndb_binlog_index	inserts	4	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned				
+def	mysql	ndb_binlog_index	orig_epoch	9	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned	PRI			
+def	mysql	ndb_binlog_index	orig_server_id	8	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned	PRI			
 def	mysql	ndb_binlog_index	Position	1	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
-def	mysql	ndb_binlog_index	schemaops	7	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
-def	mysql	ndb_binlog_index	updates	5	NULL	NO	bigint	NULL	NULL	20	0	NULL	NULL	bigint(20) unsigned				
+def	mysql	ndb_binlog_index	schemaops	7	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned				
+def	mysql	ndb_binlog_index	updates	5	NULL	NO	int	NULL	NULL	10	0	NULL	NULL	int(10) unsigned				
 def	mysql	plugin	dl	2		NO	varchar	128	384	NULL	NULL	utf8	utf8_general_ci	varchar(128)				
 def	mysql	plugin	name	1		NO	varchar	64	192	NULL	NULL	utf8	utf8_general_ci	varchar(64)	PRI			
 def	mysql	proc	body	11	NULL	NO	longblob	4294967295	4294967295	NULL	NULL	NULL	NULL	longblob				
@@ -467,10 +470,13 @@ NULL	mysql	innodb_table_stats	sum_of_oth
 NULL	mysql	ndb_binlog_index	Position	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
 1.0000	mysql	ndb_binlog_index	File	varchar	255	255	latin1	latin1_swedish_ci	varchar(255)
 NULL	mysql	ndb_binlog_index	epoch	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
-NULL	mysql	ndb_binlog_index	inserts	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
-NULL	mysql	ndb_binlog_index	updates	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
-NULL	mysql	ndb_binlog_index	deletes	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
-NULL	mysql	ndb_binlog_index	schemaops	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	ndb_binlog_index	inserts	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	ndb_binlog_index	updates	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	ndb_binlog_index	deletes	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	ndb_binlog_index	schemaops	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	ndb_binlog_index	orig_server_id	int	NULL	NULL	NULL	NULL	int(10) unsigned
+NULL	mysql	ndb_binlog_index	orig_epoch	bigint	NULL	NULL	NULL	NULL	bigint(20) unsigned
+NULL	mysql	ndb_binlog_index	gci	int	NULL	NULL	NULL	NULL	int(10) unsigned
 3.0000	mysql	plugin	name	varchar	64	192	utf8	utf8_general_ci	varchar(64)
 3.0000	mysql	plugin	dl	varchar	128	384	utf8	utf8_general_ci	varchar(128)
 3.0000	mysql	proc	db	char	64	192	utf8	utf8_bin	char(64)

=== modified file 'mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result'
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result	2011-09-06 12:43:05 +0000
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result	2011-09-25 19:36:01 +0000
@@ -36,6 +36,8 @@ def	mysql	innodb_index_stats	0	mysql	PRI
 def	mysql	innodb_table_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	innodb_table_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	ndb_binlog_index	0	mysql	PRIMARY	1	epoch	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	ndb_binlog_index	0	mysql	PRIMARY	2	orig_server_id	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	ndb_binlog_index	0	mysql	PRIMARY	3	orig_epoch	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	plugin	0	mysql	PRIMARY	1	name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	1	db	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	2	name	A	#CARD#	NULL	NULL		BTREE		
@@ -104,6 +106,8 @@ def	mysql	innodb_index_stats	0	mysql	PRI
 def	mysql	innodb_table_stats	0	mysql	PRIMARY	1	database_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	innodb_table_stats	0	mysql	PRIMARY	2	table_name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	ndb_binlog_index	0	mysql	PRIMARY	1	epoch	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	ndb_binlog_index	0	mysql	PRIMARY	2	orig_server_id	A	#CARD#	NULL	NULL		BTREE		
+def	mysql	ndb_binlog_index	0	mysql	PRIMARY	3	orig_epoch	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	plugin	0	mysql	PRIMARY	1	name	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	1	db	A	#CARD#	NULL	NULL		BTREE		
 def	mysql	proc	0	mysql	PRIMARY	2	name	A	#CARD#	NULL	NULL		BTREE		

=== modified file 'mysql-test/suite/innodb/r/innodb-index.result'
--- a/mysql-test/suite/innodb/r/innodb-index.result	2011-09-07 10:08:09 +0000
+++ b/mysql-test/suite/innodb/r/innodb-index.result	2011-09-25 20:20:21 +0000
@@ -880,7 +880,7 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 explain select * from t1 where b like 'adfd%';
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	b	b	769	NULL	11	Using where
+1	SIMPLE	t1	ALL	b	NULL	NULL	NULL	15	Using where
 drop table t1;
 set global innodb_file_per_table=on;
 set global innodb_file_format='Barracuda';

=== modified file 'mysql-test/suite/perfschema/r/pfs_upgrade.result'
--- a/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-09-06 12:43:05 +0000
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade.result	2011-09-25 19:39:25 +0000
@@ -56,7 +56,7 @@ ERROR 1050 (42S01) at line 1026: Table '
 ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
 ERROR 1050 (42S01) at line 1044: Table 'users' already exists
 ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1644 (HY000) at line 1679: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_table";
 Tables_in_performance_schema (user_table)
@@ -117,7 +117,7 @@ ERROR 1050 (42S01) at line 1026: Table '
 ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
 ERROR 1050 (42S01) at line 1044: Table 'users' already exists
 ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1644 (HY000) at line 1679: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 show tables like "user_view";
 Tables_in_performance_schema (user_view)
@@ -176,7 +176,7 @@ ERROR 1050 (42S01) at line 1026: Table '
 ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
 ERROR 1050 (42S01) at line 1044: Table 'users' already exists
 ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1644 (HY000) at line 1679: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -235,7 +235,7 @@ ERROR 1050 (42S01) at line 1026: Table '
 ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
 ERROR 1050 (42S01) at line 1044: Table 'users' already exists
 ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1644 (HY000) at line 1679: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.proc where db='performance_schema';
 name
@@ -294,7 +294,7 @@ ERROR 1050 (42S01) at line 1026: Table '
 ERROR 1050 (42S01) at line 1035: Table 'hosts' already exists
 ERROR 1050 (42S01) at line 1044: Table 'users' already exists
 ERROR 1050 (42S01) at line 1054: Table 'accounts' already exists
-ERROR 1644 (HY000) at line 1474: Unexpected content found in the performance_schema database.
+ERROR 1644 (HY000) at line 1679: Unexpected content found in the performance_schema database.
 FATAL ERROR: Upgrade failed
 select name from mysql.event where db='performance_schema';
 name

=== 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-23 12:53:33 +0000
@@ -341,7 +341,7 @@ ndbcluster_partition_flags()
           HA_CAN_PARTITION_UNIQUE | HA_USE_AUTO_PARTITION);
 }
 
-#ifndef MCP_WL3749
+#ifndef NDB_WITHOUT_ONLINE_ALTER
 static uint
 ndbcluster_alter_table_flags(uint flags)
 {
@@ -351,13 +351,6 @@ ndbcluster_alter_table_flags(uint flags)
     return (HA_PARTITION_FUNCTION_SUPPORTED);
 }
 #else
-#ifndef NDB_WITHOUT_ONLINE_ALTER
-static uint
-ndbcluster_alter_partition_flags()
-{
-  return HA_PARTITION_FUNCTION_SUPPORTED;
-}
-#else
 static uint
 ndbcluster_alter_table_flags(uint flags)
 {
@@ -383,7 +376,6 @@ ndbcluster_alter_table_flags(uint flags)
   return f;
 }
 #endif
-#endif
 
 #define NDB_AUTO_INCREMENT_RETRIES 100
 #define BATCH_FLUSH_SIZE (32768)
@@ -1347,8 +1339,8 @@ Thd_ndb::Thd_ndb(THD* thd) :
   m_pushed_queries_dropped= 0;
   m_pushed_queries_executed= 0;
   m_pushed_reads= 0;
-  bzero(m_transaction_no_hint_count, sizeof(m_transaction_no_hint_count));
-  bzero(m_transaction_hint_count, sizeof(m_transaction_hint_count));
+  memset(m_transaction_no_hint_count, 0, sizeof(m_transaction_no_hint_count));
+  memset(m_transaction_hint_count, 0, sizeof(m_transaction_hint_count));
   global_schema_lock_trans= NULL;
   global_schema_lock_count= 0;
   global_schema_lock_error= 0;
@@ -6195,7 +6187,7 @@ void ha_ndbcluster::unpack_record(uchar 
             production code.
           */
           if (actual_length < field->pack_length())
-            bzero(field->ptr + actual_length,
+            memset(field->ptr + actual_length, 0,
                   field->pack_length() - actual_length);
 #endif
           field->move_field_offset(-dst_offset);
@@ -6259,7 +6251,7 @@ static void get_default_value(void *def_
           memcpy(def_val, src_ptr, actual_length);
 #ifdef HAVE_purify
           if (actual_length < field->pack_length())
-            bzero(((char*)def_val) + actual_length,
+            memset(((char*)def_val) + actual_length, 0,
                   field->pack_length() - actual_length);
 #endif
         }
@@ -7068,7 +7060,7 @@ void ha_ndbcluster::get_dynamic_partitio
 {
   DBUG_PRINT("info", ("ha_ndbcluster::get_dynamic_partition_info"));
 
-  memset((char*) stat_info, 0, sizeof(PARTITION_STATS));
+  memset(stat_info, 0, sizeof(PARTITION_STATS));
   int error = 0;
   THD *thd = table->in_use;
 
@@ -11834,7 +11826,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;
@@ -11849,18 +11841,8 @@ static int ndbcluster_init(void *p)
     h->show_status=      ndbcluster_show_status;    /* Show status */
     h->alter_tablespace= ndbcluster_alter_tablespace;    /* Show status */
     h->partition_flags=  ndbcluster_partition_flags; /* Partition flags */
-#ifndef MCP_WL3749
-    h->alter_table_flags=
-      ndbcluster_alter_table_flags;                 /* Alter table flags */
-#else
-#ifndef NDB_WITHOUT_ONLINE_ALTER
-    h->alter_partition_flags=
-      ndbcluster_alter_partition_flags;             /* Alter partition flags */
-#else
     h->alter_table_flags=
       ndbcluster_alter_table_flags;                 /* Alter table flags */
-#endif
-#endif
 #if MYSQL_VERSION_ID >= 50501
     h->fill_is_table=    ndbcluster_fill_is_table;
 #else
@@ -12404,13 +12386,9 @@ ulonglong ha_ndbcluster::table_flags(voi
     HA_HAS_OWN_BINLOGGING |
     HA_BINLOG_ROW_CAPABLE |
     HA_HAS_RECORDS |
-#ifndef MCP_WL3749
-    HA_ONLINE_ALTER |
-#else
 #ifndef NDB_WITHOUT_ONLINE_ALTER
     HA_ONLINE_ALTER |
 #endif
-#endif
     0;
 
   /*
@@ -15485,7 +15463,7 @@ ha_ndbcluster::set_up_partition_info(par
   DBUG_RETURN(0);
 }
 
-#ifndef MCP_WL3749
+#ifndef NDB_WITHOUT_ONLINE_ALTER
 static
 HA_ALTER_FLAGS supported_alter_operations()
 {

=== modified file 'sql/ha_ndbcluster.h'
--- a/sql/ha_ndbcluster.h	2011-09-07 10:08:09 +0000
+++ b/sql/ha_ndbcluster.h	2011-09-23 12:53:33 +0000
@@ -216,7 +216,7 @@ struct Ndb_local_table_statistics {
 #include "ndb_thd_ndb.h"
 
 struct st_ndb_status {
-  st_ndb_status() { bzero(this, sizeof(struct st_ndb_status)); }
+  st_ndb_status() { memset(this, 0, sizeof(struct st_ndb_status)); }
   long cluster_node_id;
   const char * connected_host;
   long connected_port;
@@ -448,7 +448,7 @@ static void set_tabname(const char *path
                                      qc_engine_callback *engine_callback,
                                      ulonglong *engine_data);
 
-#ifndef MCP_WL3749
+#ifndef NDB_WITHOUT_ONLINE_ALTER
   int check_if_supported_alter(TABLE *altered_table,
                                HA_CREATE_INFO *create_info,
                                Alter_info *alter_info,
@@ -562,7 +562,7 @@ private:
 
   int ndb_optimize_table(THD* thd, uint delay);
 
-#ifndef MCP_WL3749
+#ifndef NDB_WITHOUT_ONLINE_ALTER
   int alter_frm(THD *thd, const char *file, NDB_ALTER_DATA *alter_data);
 #endif
 

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2011-09-07 10:08:09 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2011-09-23 12:53:33 +0000
@@ -339,7 +339,13 @@ ndb_binlog_open_shadow_table(THD *thd, N
   if ((error= open_table_def(thd, shadow_table_share, 0)) ||
       (error= open_table_from_share(thd, shadow_table_share, "", 0,
                                     (uint) (OPEN_FRM_FILE_ONLY | DELAYED_OPEN | READ_ALL),
-                                    0, shadow_table, OTM_OPEN)))
+                                    0, shadow_table,
+#ifdef NDB_WITHOUT_ONLINE_ALTER
+                                    false
+#else
+                                    OTM_OPEN
+#endif
+                                    )))
   {
     DBUG_PRINT("error", ("failed to open shadow table, error: %d my_errno: %d",
                          error, my_errno));
@@ -2887,7 +2893,7 @@ ndb_binlog_thread_handle_schema_event_po
         }
         {
           TABLE_LIST table_list;
-          bzero((char*) &table_list,sizeof(table_list));
+          memset(&table_list, 0, sizeof(table_list));
           table_list.db= schema->db;
           table_list.alias= table_list.table_name= schema->name;
           close_cached_tables(thd, &table_list, FALSE, FALSE, FALSE);
@@ -2992,7 +2998,7 @@ ndb_binlog_thread_handle_schema_event_po
           remote on-line alter table
         */
         TABLE_LIST table_list;
-        bzero((char*) &table_list,sizeof(table_list));
+        memset(&table_list, 0, sizeof(table_list));
         table_list.db= (char *)schema->db;
         table_list.alias= table_list.table_name= (char *)schema->name;
         close_cached_tables(thd, &table_list, TRUE, FALSE, FALSE);
@@ -3504,7 +3510,7 @@ inline void slave_reset_conflict_fn(NDB_
   NDB_CONFLICT_FN_SHARE *cfn_share= share->m_cfn_share;
   if (cfn_share)
   {
-    bzero((char*)cfn_share, sizeof(*cfn_share));
+    memset(cfn_share, 0, sizeof(*cfn_share));
   }
 }
 
@@ -5828,7 +5834,7 @@ ndb_find_binlog_index_row(ndb_binlog_ind
       if (row == NULL)
       {
         row= (ndb_binlog_index_row*)sql_alloc(sizeof(ndb_binlog_index_row));
-        bzero((char*)row, sizeof(ndb_binlog_index_row));
+        memset(row, 0, sizeof(ndb_binlog_index_row));
         row->next= first;
         *rows= row;
         if (found_id)
@@ -6895,7 +6901,7 @@ restart_cluster_failure:
         DBUG_PRINT("info", ("Initializing transaction"));
         inj->new_trans(thd, &trans);
         rows= &_row;
-        bzero((char*)&_row, sizeof(_row));
+        memset(&_row, 0, sizeof(_row));
         thd->variables.character_set_client= &my_charset_latin1;
         goto commit_to_binlog;
       }

=== 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/ha_ndbcluster_glue.h'
--- a/sql/ha_ndbcluster_glue.h	2011-09-06 12:43:05 +0000
+++ b/sql/ha_ndbcluster_glue.h	2011-09-23 12:53:33 +0000
@@ -64,9 +64,6 @@ bool close_cached_tables(THD *thd, TABLE
   return close_cached_tables(thd, tables, wait_for_refresh, LONG_TIMEOUT);
 }
 
-/* Online alter table not supported */
-#define NDB_WITHOUT_ONLINE_ALTER
-
 /* thd has no version field anymore */
 #define NDB_THD_HAS_NO_VERSION
 
@@ -76,15 +73,6 @@ bool close_cached_tables(THD *thd, TABLE
 /* No mysql_rm_table_part2 anymore in 5.5.8 */
 #define NDB_NO_MYSQL_RM_TABLE_PART2
 
-#ifdef MCP_WL3749
-/*
-  The enum open_table_mode has been removed in 5.5.7 and 'open_table_from_share'
-  now takes "bool is_create_table" instead of the enum type. Define OTM_OPEN
-  to false since it's not a create table
-*/
-#define OTM_OPEN false
-#endif
-
 #endif
 
 extern ulong opt_server_id_mask;
@@ -250,15 +238,4 @@ uint partition_info_num_subparts(const p
 
 #endif
 
-#if MYSQL_VERSION_ID >= 50603
-
-/*
-  Allow use of bzero although MySQL header files redefine
-  it to an invalid symbol, will actually fix this by replacing bzero
-  with memset in sql/ha_ndb*
-*/
-#undef bzero
-#include <strings.h>
-#endif
-
 #endif

=== modified file 'sql/handler.cc'
--- a/sql/handler.cc	2011-09-07 10:08:09 +0000
+++ b/sql/handler.cc	2011-09-23 10:44:30 +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-23 10:44:30 +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-23 10:44:30 +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-23 10:44:30 +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-23 12:53:33 +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,127 +59,11 @@ 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()
-
-IF(SOURCE_SUBLIBS)
-  # Sourced by libmysqld/CMakeLists.txt in 5.1 only to get
-  # NDBCLUSTER_SOURCES and NDBCLUSTER_LIBS, don't configure
-  # again
-ELSE()
-
-  NDB_CHECK_MYSQL_CLUSTER(${VERSION})
-
-  INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ndb_configure.cmake)
-
-  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()
-
-  OPTION(WITH_NDB_BINLOG
-    "Disable NDB binlog" ON)
-
-  OPTION(WITH_ERROR_INSERT
-    "Enable error injection in MySQL Cluster" OFF)
-
-  OPTION(WITH_NDB_DEBUG
-    "Disable special ndb debug features" OFF)
-
-  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}\"") 
-
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NDB_CCFLAGS}")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NDB_CCFLAGS}")
-
-  # 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(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()
-
-  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()
-
-ENDIF()
-
-
-IF(WITHOUT_PARTITION_STORAGE_ENGINE)
-  MESSAGE(FATAL_ERROR "NDBCLUSTER can't be compiled without PARTITION")
-ENDIF(WITHOUT_PARTITION_STORAGE_ENGINE)
+NDB_CHECK_MYSQL_CLUSTER(${VERSION})
 
+#
+# Add the ndbcluster plugin
+#
 SET(NDBCLUSTER_SOURCES
   ../../sql/ha_ndbcluster.cc
   ../../sql/ha_ndbcluster_cond.cc
@@ -200,31 +79,133 @@ SET(NDBCLUSTER_SOURCES
   ../../sql/ndb_global_schema_lock.cc
   ../../sql/ndb_mi.cc
 )
+
+# Inlude directories used when building ha_ndbcluster
 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/storage/ndb/include)
 
-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(NOT MYSQL_CLUSTER_VERSION)
+ # Online alter table not supported in non MySQL Cluster
+ # versions yet, compile ndbcluster without online alter support
+ ADD_DEFINITIONS(-DNDB_WITHOUT_ONLINE_ALTER)
+ENDIF()
+
+# NDB is DEFAULT plugin in MySQL Cluster
+SET(is_default_plugin "")
+IF(MYSQL_CLUSTER_VERSION)
+  SET(is_default_plugin "DEFAULT")
+ENDIF()
+
+MYSQL_ADD_PLUGIN(ndbcluster ${NDBCLUSTER_SOURCES} STORAGE_ENGINE
+  ${is_default_plugin} STATIC_ONLY RECOMPILE_FOR_EMBEDDED
+  LINK_LIBRARIES ndbclient)
+
+#
+# Add NDB binaries if ndbcluster is built
+#
+IF (NOT DEFINED WITH_NDBCLUSTER)
+  # Not building NDB 
+  RETURN()
+ENDIF()
+
+MESSAGE(STATUS "Building NDB")
+
+INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/ndb_configure.cmake)
+
+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()
+
+OPTION(WITH_NDB_BINLOG
+  "Disable NDB binlog" ON)
+
+OPTION(WITH_ERROR_INSERT
+  "Enable error injection in MySQL Cluster" OFF)
+
+OPTION(WITH_NDB_DEBUG
+  "Disable special ndb debug features" OFF)
+
+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()
-  # 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")
+  IF(WITH_ERROR_INSERT)
+    SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DERROR_INSERT")
   ENDIF()
+  SET(NDB_CCFLAGS "${NDB_CCFLAGS} -DNDEBUG")
+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(NDB_CCFLAGS "${NDB_CCFLAGS} $ENV{NDB_EXTRA_FLAGS}") 
+MESSAGE(STATUS "Using extra FLAGS for ndb: \"${NDB_CCFLAGS}\"") 
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${NDB_CCFLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${NDB_CCFLAGS}")
+
+# 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(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()
+
+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:3356 to 3368) magnus.blaudd26 Sep