List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:October 8 2009 11:41am
Subject:bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3095)
Bug#46113
View as plain text  
#At file:///home/msvensson/mysql/bug46113/6.3/ based on revid:jonas@strippeddj45t93ip5p35

 3095 Magnus Blåudd	2009-10-08 [merge]
      Merge bug#46113 to 6.3

    modified:
      storage/ndb/include/ndb_global.h.in
      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.hpp
=== modified file 'storage/ndb/include/ndb_global.h.in'
--- a/storage/ndb/include/ndb_global.h.in	2009-05-26 18:53:34 +0000
+++ b/storage/ndb/include/ndb_global.h.in	2009-10-08 09:55:36 +0000
@@ -151,4 +151,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/kernel/blocks/backup/Backup.hpp'
--- a/storage/ndb/src/kernel/blocks/backup/Backup.hpp	2009-05-27 12:11:46 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.hpp	2009-10-08 11:41:21 +0000
@@ -173,7 +173,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-09-01 12:28:53 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2009-10-08 11:41:21 +0000
@@ -488,6 +488,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-09-16 10:52:41 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2009-10-08 11:41:21 +0000
@@ -473,6 +473,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
 
   // Scan Lock
   struct ScanLock {
+    ScanLock() {}
     Uint32 m_accLockOp;
     union {
       Uint32 nextPool;
@@ -569,6 +570,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
 
   struct Page_request 
   {
+    Page_request() {}
     Local_key m_key;
     Uint32 m_frag_ptr_i;
     Uint32 m_extent_info_ptr;
@@ -1312,6 +1314,7 @@ typedef Ptr<HostBuffer> HostBufferPtr;
    * Build index operation record.
    */
   struct BuildIndexRec {
+    BuildIndexRec() {}
     // request cannot use signal class due to extra members
     Uint32 m_request[BuildIndxReq::SignalLength];
     Uint8  m_build_vs;          // varsize pages

=== 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:24:27 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp	2009-10-08 11:41:21 +0000
@@ -356,6 +356,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-05-27 12:11:46 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2009-10-08 11:41:21 +0000
@@ -135,6 +135,7 @@ public:
   };
 
   struct Subscriber {
+    Subscriber() {}
     Uint32 m_senderRef;
     Uint32 m_senderData;
     Uint32 nextList;
@@ -197,6 +198,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-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/blocks/trix/Trix.hpp	2009-10-08 09:55:36 +0000
@@ -71,6 +71,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-26 18:53:34 +0000
+++ b/storage/ndb/src/kernel/vm/DLFifoList.hpp	2009-10-08 09:55: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 12:11:46 +0000
+++ b/storage/ndb/src/kernel/vm/LockQueue.hpp	2009-10-08 11:41:21 +0000
@@ -34,6 +34,8 @@ public:
    */
   struct LockQueueElement 
   {
+    LockQueueElement() {}
+
     UtilLockReq m_req;
     union {
       Uint32 nextPool;

=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.hpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2009-09-25 11:17:18 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2009-10-08 11:41:21 +0000
@@ -545,6 +545,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-20091008114121-6z6obmg67hjwf5rp.bundle
Thread
bzr commit into mysql-5.1-telco-6.3 branch (magnus.blaudd:3095)Bug#46113Magnus Blåudd8 Oct