3781 Jonas Oreland 2010-08-30 [merge]
ndb - merge 70 to 71
modified:
storage/ndb/include/kernel/AttributeList.hpp
storage/ndb/include/kernel/signaldata/BackupSignalData.hpp
storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp
storage/ndb/include/kernel/signaldata/CreateEvnt.hpp
storage/ndb/include/ndb_global.h
storage/ndb/include/util/Bitmask.hpp
storage/ndb/ndb_configure.m4
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
storage/ndb/src/mgmsrv/MgmtSrvr.cpp
3780 Jonas Oreland 2010-08-30 [merge]
ndb - merge 70 to 71
=== modified file 'storage/ndb/include/kernel/AttributeList.hpp'
--- a/storage/ndb/include/kernel/AttributeList.hpp 2010-03-26 07:13:06 +0000
+++ b/storage/ndb/include/kernel/AttributeList.hpp 2010-08-30 09:51:49 +0000
@@ -27,6 +27,7 @@
*/
typedef Bitmask<MAXNROFATTRIBUTESINWORDS> AttributeMask;
+typedef BitmaskPOD<MAXNROFATTRIBUTESINWORDS> AttributeMaskPOD;
template <Uint32 SZ>
struct Id_array
=== modified file 'storage/ndb/include/kernel/signaldata/BackupSignalData.hpp'
--- a/storage/ndb/include/kernel/signaldata/BackupSignalData.hpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/kernel/signaldata/BackupSignalData.hpp 2010-08-30 09:51:49 +0000
@@ -164,7 +164,7 @@ public:
private:
Uint32 senderData;
Uint32 backupId;
- NdbNodeBitmask nodes;
+ NdbNodeBitmaskPOD nodes;
};
/**
@@ -217,7 +217,7 @@ private:
Uint32 noOfRecordsLow;
Uint32 noOfLogBytes;
Uint32 noOfLogRecords;
- NdbNodeBitmask nodes;
+ NdbNodeBitmaskPOD nodes;
Uint32 noOfBytesHigh;
Uint32 noOfRecordsHigh;
};
=== modified file 'storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp'
--- a/storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/kernel/signaldata/CheckNodeGroups.hpp 2010-08-30 09:51:49 +0000
@@ -44,7 +44,7 @@ public:
Uint32 nodeId; // nodeId input for GetNodeGroupMembers
Uint32 extraNodeGroups; // For GetDefaultFragments
};
- NdbNodeBitmask mask; /* set of NDB nodes, input for ArbitCheck,
+ NdbNodeBitmaskPOD mask; /* set of NDB nodes, input for ArbitCheck,
* output for GetNodeGroupMembers
*/
Uint32 senderData; // Sender data, kept in return signal
=== modified file 'storage/ndb/include/kernel/signaldata/CreateEvnt.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp 2010-05-27 09:56:43 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateEvnt.hpp 2010-08-30 09:51:49 +0000
@@ -25,7 +25,7 @@
#include <signaldata/DictTabInfo.hpp>
#include <AttributeList.hpp>
-typedef Bitmask<MAXNROFATTRIBUTESINWORDS_OLD> AttributeMask_OLD;
+typedef BitmaskPOD<MAXNROFATTRIBUTESINWORDS_OLD> AttributeMask_OLD;
/**
* DropEvntReq.
=== modified file 'storage/ndb/include/ndb_global.h'
--- a/storage/ndb/include/ndb_global.h 2010-08-20 11:10:25 +0000
+++ b/storage/ndb/include/ndb_global.h 2010-08-30 09:51:49 +0000
@@ -176,25 +176,20 @@ extern "C" {
/*
Fallback to use home grown solution
+ (i.e use mysys version)
*/
-#define STR_CONCAT_(x, y) x##y
-#define STR_CONCAT(x, y) STR_CONCAT_(x, y)
-
-#define NDB_STATIC_ASSERT(expr) \
- enum {STR_CONCAT(static_assert_, __LINE__) = 1 / (!!(expr)) }
-
-#undef STR_CONCAT_
-#undef STR_CONCAT
+#define NDB_STATIC_ASSERT(expr) compile_time_assert(expr)
#endif
-#if (_MSC_VER > 1500) || (defined __GXX_EXPERIMENTAL_CXX0X__)
-#define HAVE_COMPILER_TYPE_TRAITS
+#if (_MSC_VER > 1500)
+#define HAVE___HAS_TRIVIAL_CONSTRUCTOR
+#define HAVE___IS_POD
#endif
-#ifdef HAVE_COMPILER_TYPE_TRAITS
+#ifdef HAVE___HAS_TRIVIAL_CONSTRUCTOR
#define ASSERT_TYPE_HAS_CONSTRUCTOR(x) \
NDB_STATIC_ASSERT(!__has_trivial_constructor(x))
#else
@@ -204,13 +199,12 @@ extern "C" {
/**
* visual studio is stricter than gcc for __is_pod, settle for __has_trivial_constructor
* until we really really made all signal data classes POD
+ *
+ * UPDATE: also gcc fails to compile our code with gcc4.4.3
*/
-#if (_MSC_VER > 1500)
+#ifdef HAVE___HAS_TRIVIAL_CONSTRUCTOR
#define NDB_ASSERT_POD(x) \
NDB_STATIC_ASSERT(__has_trivial_constructor(x))
-#elif defined __GXX_EXPERIMENTAL_CXX0X__
-#define NDB_ASSERT_POD(x) \
- NDB_STATIC_ASSERT(__is_pod(x))
#else
#define NDB_ASSERT_POD(x)
#endif
=== modified file 'storage/ndb/include/util/Bitmask.hpp'
--- a/storage/ndb/include/util/Bitmask.hpp 2010-08-30 08:40:45 +0000
+++ b/storage/ndb/include/util/Bitmask.hpp 2010-08-30 09:51:49 +0000
@@ -995,6 +995,25 @@ public:
}
return * this;
}
+
+ template<unsigned sz2> Bitmask& operator=(const BitmaskPOD<sz2>& src){
+ if (size >= sz2)
+ {
+ for (unsigned i = 0; i < sz2; i++)
+ {
+ this->rep.data[i] = src.rep.data[i];
+ }
+ }
+ else
+ {
+ assert(src.find(32*size+1) == BitmaskImpl::NotFound);
+ for (unsigned i = 0; i < size; i++)
+ {
+ this->rep.data[i] = src.rep.data[i];
+ }
+ }
+ return * this;
+ }
};
inline void
=== modified file 'storage/ndb/ndb_configure.m4'
--- a/storage/ndb/ndb_configure.m4 2010-08-30 08:54:47 +0000
+++ b/storage/ndb/ndb_configure.m4 2010-08-30 10:21:53 +0000
@@ -213,6 +213,27 @@ AC_DEFUN([MYSQL_CHECK_JAVA], [
fi
])
+AC_DEFUN([NDB_COMPILER_FEATURES],
+[
+ AC_LANG_PUSH([C++])
+ AC_MSG_CHECKING([checking __is_pod(typename)])
+ AC_TRY_COMPILE([struct A{};],[ int a = __is_pod(A)],
+ [ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE___IS_POD], [1],
+ [Compiler supports __is_pod(typename)])],
+ AC_MSG_RESULT([no])
+ )
+
+ AC_MSG_CHECKING([checking __has_trivial_constructor(typename)])
+ AC_TRY_COMPILE([struct A{};], [ int a = __has_trivial_constructor(A)],
+ [ AC_MSG_RESULT([yes])
+ AC_DEFINE([HAVE___HAS_TRIVIAL_CONSTRUCTOR], [1],
+ [Compiler supports __has_trivial_constructor(typename)])],
+ AC_MSG_RESULT([no])
+ )
+ AC_LANG_POP([C++])
+])
+
AC_DEFUN([MYSQL_CHECK_NDB_OPTIONS], [
AC_ARG_WITH([ndb-sci],
AC_HELP_STRING([--with-ndb-sci=DIR],
@@ -580,6 +601,7 @@ AC_DEFUN([MYSQL_SETUP_NDBCLUSTER], [
AC_MSG_RESULT(no))
NDBCLUSTER_WORKAROUNDS
+ NDB_COMPILER_FEATURES
MAKE_BINARY_DISTRIBUTION_OPTIONS="$MAKE_BINARY_DISTRIBUTION_OPTIONS --with-ndbcluster"
=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2010-06-15 12:52:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2010-08-30 09:51:49 +0000
@@ -1372,6 +1372,8 @@ public:
* configurable.
*/
struct LogFileRecord {
+ LogFileRecord() {}
+
enum FileChangeState {
NOT_ONGOING = 0,
BOTH_WRITES_ONGOING = 1,
@@ -3004,6 +3006,7 @@ private:
*/
struct RedoCacheLogPageRecord
{
+ RedoCacheLogPageRecord() {}
/**
* NOTE: These numbers must match page-header definition
*/
=== modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp'
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2010-08-20 10:59:14 +0000
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2010-08-30 09:51:49 +0000
@@ -3174,7 +3174,7 @@ MgmtSrvr::startBackup(Uint32& backupId,
CAST_CONSTPTR(BackupConf, signal->getDataPtr());
event.Event = BackupEvent::BackupStarted;
event.Started.BackupId = conf->backupId;
- event.Nodes = conf->nodes;
+ event.Nodes.assign(conf->nodes);
#ifdef VM_TRACE
ndbout_c("Backup(%d) master is %d", conf->backupId,
refToNode(signal->header.theSendersBlockRef));
@@ -3200,7 +3200,7 @@ MgmtSrvr::startBackup(Uint32& backupId,
event.Completed.NoOfLogRecords = rep->noOfLogRecords;
event.Completed.stopGCP = rep->stopGCP;
event.Completed.startGCP = rep->startGCP;
- event.Nodes = rep->nodes;
+ event.Nodes.assign(rep->nodes);
if (signal->header.theLength >= BackupCompleteRep::SignalLength)
{
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100830102153-qyt4n80fwa0f4avf.bundle
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.1 branch (jonas:3780 to 3781) | Jonas Oreland | 30 Aug |