List:Commits« Previous MessageNext Message »
From:Magnus Blåudd Date:October 8 2009 12:40pm
Subject:bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3099)
Bug#46113
View as plain text  
#At file:///home/msvensson/mysql/bug46113/7.0/ based on revid:magnus.blaudd@stripped25-z6pwmh3n506ty7eo

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

    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-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/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-09-01 12:32:10 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp	2009-10-08 12:40:36 +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-09-16 11:12:55 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2009-10-08 12:40:36 +0000
@@ -474,6 +474,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
 
   // Scan Lock
   struct ScanLock {
+    ScanLock() {}
     Uint32 m_accLockOp;
     union {
       Uint32 nextPool;
@@ -570,6 +571,7 @@ typedef Ptr<Fragoperrec> FragoperrecPtr;
 
   struct Page_request 

   {
+    Page_request() {}
     Local_key m_key;
     Uint32 m_frag_ptr_i;
     Uint32 m_extent_info_ptr;
@@ -1301,6 +1303,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-05-27 15:21:45 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2009-10-08 12:40:36 +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.hpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2009-09-25 13:38:00 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2009-10-08 12:40:36 +0000
@@ -728,6 +728,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-20091008124036-orpg35t9d9rj3218.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:3099)Bug#46113Magnus Blåudd8 Oct