#At file:///home/msvensson/mysql/7.1/ based on revid:jonas@strippedt20i
3065 Magnus Blåudd 2009-10-09 [merge]
Merge
modified:
storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp
storage/ndb/include/ndb_global.h.in
storage/ndb/src/cw/cpcd/CPCD.hpp
storage/ndb/src/kernel/blocks/backup/Backup.hpp
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp
storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
storage/ndb/src/kernel/blocks/suma/Suma.hpp
storage/ndb/src/kernel/blocks/trix/Trix.hpp
storage/ndb/src/kernel/vm/DLFifoList.hpp
storage/ndb/src/kernel/vm/DLHashTable.hpp
storage/ndb/src/kernel/vm/DLList.hpp
storage/ndb/src/kernel/vm/LockQueue.hpp
storage/ndb/src/kernel/vm/SimulatedBlock.cpp
storage/ndb/src/kernel/vm/SimulatedBlock.hpp
=== modified file 'storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp'
--- a/storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp 2009-10-08 10:19:19 +0000
+++ b/storage/ndb/include/kernel/signaldata/ContinueFragmented.hpp 2009-10-09 08:15:14 +0000
@@ -57,7 +57,7 @@ private:
Uint32 cursor;
Uint32 elementsCleaned;
Uint32 callbackStart; /* Callback structure placed here */
- };
+ } cleanup;
};
};
=== modified file 'storage/ndb/include/ndb_global.h.in'
--- a/storage/ndb/include/ndb_global.h.in 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/include/ndb_global.h.in 2009-10-08 12:40:36 +0000
@@ -165,4 +165,49 @@ extern "C" {
#define NDB_ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
+
+/*
+ NDB_STATIC_ASSERT(expr)
+ - Check coding assumptions during compile time
+ by laying out code that will generate a compiler error
+ if the expression is false.
+*/
+
+#if (_MSC_VER > 1500) || (defined __GXX_EXPERIMENTAL_CXX0X__)
+
+/*
+ Prefer to use the 'static_assert' function from C++0x
+ to get best error message
+*/
+#define NDB_STATIC_ASSERT(expr) static_assert(expr, #expr)
+
+#else
+
+/*
+ Fallback to use home grown solution
+*/
+
+#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
+
+#endif
+
+
+#if (_MSC_VER > 1500) || (defined __GXX_EXPERIMENTAL_CXX0X__)
+#define HAVE_COMPILER_TYPE_TRAITS
+#endif
+
+#ifdef HAVE_COMPILER_TYPE_TRAITS
+#define ASSERT_TYPE_HAS_CONSTRUCTOR(x) \
+ NDB_STATIC_ASSERT(!__has_trivial_constructor(x))
+#else
+#define ASSERT_TYPE_HAS_CONSTRUCTOR(x)
+#endif
+
#endif
=== modified file 'storage/ndb/src/cw/cpcd/CPCD.hpp'
--- a/storage/ndb/src/cw/cpcd/CPCD.hpp 2009-10-08 04:34:10 +0000
+++ b/storage/ndb/src/cw/cpcd/CPCD.hpp 2009-10-09 08:19:44 +0000
@@ -29,8 +29,6 @@
#ifdef _WIN32
typedef DWORD pid_t;
-#else
-typedef int pid_t;
#endif
const pid_t bad_pid = -1;
=== modified file 'storage/ndb/src/kernel/blocks/backup/Backup.hpp'
--- a/storage/ndb/src/kernel/blocks/backup/Backup.hpp 2009-05-29 06:23:51 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.hpp 2009-10-08 12:40:36 +0000
@@ -185,7 +185,7 @@ public:
Uint32 nextPool;
};
typedef Ptr<Page32> Page32Ptr;
-
+
struct Fragment {
Uint64 noOfRecords;
Uint32 tableId;
=== modified file 'storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2009-10-08 12:30:55 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2009-10-09 09:29:24 +0000
@@ -501,6 +501,8 @@ public:
/* WHEN THE INDEX IS DROPPED. */
/* **************************************** */
struct TcIndexData {
+ TcIndexData() {}
+
/**
* IndexState
*/
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2009-10-08 12:30:55 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp 2009-10-09 09:29:24 +0000
@@ -475,6 +475,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
// Scan Lock
struct ScanLock {
+ ScanLock() {}
Uint32 m_accLockOp;
union {
Uint32 nextPool;
@@ -571,6 +572,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
struct Page_request
{
+ Page_request() {}
Local_key m_key;
Uint32 m_frag_ptr_i;
Uint32 m_extent_info_ptr;
@@ -1304,6 +1306,8 @@ typedef Ptr<HostBuffer> HostBufferPtr;
* Build index operation record.
*/
struct BuildIndexRec {
+ BuildIndexRec() {}
+
BuildIndxImplReq m_request;
Uint8 m_build_vs; // varsize pages
Uint32 m_indexId; // the index
=== modified file 'storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp 2009-05-27 12:11:46 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp 2009-10-08 11:41:21 +0000
@@ -24,6 +24,7 @@
struct Tup_page
{
+ Tup_page() {}
struct File_formats::Page_header m_page_header;
Uint32 m_restart_seq;
Uint32 page_state;
=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2009-06-03 06:25:51 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2009-10-08 12:40:36 +0000
@@ -357,6 +357,7 @@ private:
// ScanLock
struct ScanLock {
+ ScanLock() {}
Uint32 m_accLockOp;
union {
Uint32 nextPool;
=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.hpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.hpp 2009-10-08 11:15:24 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp 2009-10-09 09:20:33 +0000
@@ -140,6 +140,7 @@ public:
};
struct Subscriber {
+ Subscriber() {}
Uint32 m_senderRef;
Uint32 m_senderData;
Uint32 nextList;
@@ -207,6 +208,8 @@ public:
struct SubOpRecord
{
+ SubOpRecord() {}
+
enum OpType
{
R_SUB_START_REQ,
=== modified file 'storage/ndb/src/kernel/blocks/trix/Trix.hpp'
--- a/storage/ndb/src/kernel/blocks/trix/Trix.hpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/trix/Trix.hpp 2009-10-08 12:40:36 +0000
@@ -73,6 +73,7 @@ private:
// Node data needed when communicating with remote TRIX:es
struct NodeRecord {
+ NodeRecord() {}
bool alive;
BlockReference trixRef;
union {
=== modified file 'storage/ndb/src/kernel/vm/DLFifoList.hpp'
--- a/storage/ndb/src/kernel/vm/DLFifoList.hpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/vm/DLFifoList.hpp 2009-10-08 12:40:36 +0000
@@ -177,11 +177,16 @@ template <typename P, typename T, typena
inline
DLFifoListImpl<P,T,U>::Head::Head()
{
+ // Require user defined constructor on T since we fiddle
+ // with T's members
+ ASSERT_TYPE_HAS_CONSTRUCTOR(T);
+
firstItem = RNIL;
lastItem = RNIL;
#ifdef VM_TRACE
in_use = false;
#endif
+
}
template <typename P, typename T, typename U>
=== modified file 'storage/ndb/src/kernel/vm/DLHashTable.hpp'
--- a/storage/ndb/src/kernel/vm/DLHashTable.hpp 2009-05-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/vm/DLHashTable.hpp 2009-10-08 09:55:36 +0000
@@ -158,6 +158,10 @@ inline
DLHashTableImpl<P, T, U>::DLHashTableImpl(P & _pool)
: thePool(_pool)
{
+ // Require user defined constructor on T since we fiddle
+ // with T's members
+ ASSERT_TYPE_HAS_CONSTRUCTOR(T);
+
mask = 0;
hashValues = 0;
}
=== modified file 'storage/ndb/src/kernel/vm/DLList.hpp'
--- a/storage/ndb/src/kernel/vm/DLList.hpp 2009-05-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/vm/DLList.hpp 2009-10-08 09:55:36 +0000
@@ -183,6 +183,9 @@ inline
DLListImpl<P,T,U>::DLListImpl(P & _pool)
: thePool(_pool)
{
+ // Require user defined constructor on T since we fiddle
+ // with T's members
+ ASSERT_TYPE_HAS_CONSTRUCTOR(T);
}
template <typename P, typename T, typename U>
=== modified file 'storage/ndb/src/kernel/vm/LockQueue.hpp'
--- a/storage/ndb/src/kernel/vm/LockQueue.hpp 2009-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/vm/LockQueue.hpp 2009-10-08 12:40:36 +0000
@@ -34,6 +34,8 @@ public:
*/
struct LockQueueElement
{
+ LockQueueElement() {}
+
UtilLockReq m_req;
union {
Uint32 nextPool;
=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.cpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2009-10-08 12:30:55 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp 2009-10-09 09:29:24 +0000
@@ -1869,13 +1869,13 @@ SimulatedBlock::execCONTINUE_FRAGMENTED(
callbackWords);
Callback cb;
- memcpy(&cb, &sig->callbackStart, callbackWords << 2);
+ memcpy(&cb, &sig->cleanup.callbackStart, callbackWords << 2);
doNodeFailureCleanup(signal,
- sig->failedNodeId,
- sig->resource,
- sig->cursor,
- sig->elementsCleaned,
+ sig->cleanup.failedNodeId,
+ sig->cleanup.resource,
+ sig->cleanup.cursor,
+ sig->cleanup.elementsCleaned,
cb);
break;
}
@@ -2523,15 +2523,15 @@ SimulatedBlock::doNodeFailureCleanup(Sig
ContinueFragmented * sig = (ContinueFragmented*)signal->getDataPtrSend();
sig->type = ContinueFragmented::CONTINUE_CLEANUP;
- sig->failedNodeId = failedNodeId;
- sig->resource = resource;
- sig->cursor = cursor;
- sig->elementsCleaned= elementsCleaned;
+ sig->cleanup.failedNodeId = failedNodeId;
+ sig->cleanup.resource = resource;
+ sig->cleanup.cursor = cursor;
+ sig->cleanup.elementsCleaned= elementsCleaned;
Uint32 callbackWords = (sizeof(Callback) + 3) >> 2;
Uint32 sigLen = ContinueFragmented::CONTINUE_CLEANUP_FIXED_WORDS +
callbackWords;
ndbassert(sigLen <= 25); // Should be STATIC_ASSERT
- memcpy(&sig->callbackStart, &cb, callbackWords << 2);
+ memcpy(&sig->cleanup.callbackStart, &cb, callbackWords << 2);
sendSignal(reference(), GSN_CONTINUE_FRAGMENTED, signal, sigLen, JBB);
=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.hpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp 2009-10-08 12:30:55 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp 2009-10-09 09:29:24 +0000
@@ -975,6 +975,7 @@ public:
* core interface
*/
struct ActiveMutex {
+ ActiveMutex() {}
Uint32 m_gsn; // state
Uint32 m_mutexId;
Callback m_callback;
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@sun.com-20091009092924-kwrwhya3ryqg43l3.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:3065) | Magnus Blåudd | 9 Oct |