List:Commits« Previous MessageNext Message »
From:Magnus Svensson Date:November 6 2008 6:38pm
Subject:bzr push into mysql-5.1 branch (msvensson:3052)
View as plain text  
 3052 Magnus Svensson	2008-11-06 [merge]
      Merge
modified:
  storage/ndb/include/util/Bitmask.hpp
  storage/ndb/src/common/portlib/NdbThread.c
  storage/ndb/src/common/util/Bitmask.cpp
  storage/ndb/src/kernel/vm/Configuration.cpp
  storage/ndb/src/mgmsrv/MgmtSrvr.cpp
  storage/ndb/src/ndbapi/Ndb.cpp

=== modified file 'BUILD/SETUP.sh'
--- a/BUILD/SETUP.sh	2008-03-20 07:57:13 +0000
+++ b/BUILD/SETUP.sh	2008-11-06 17:18:50 +0000
@@ -94,6 +94,9 @@ if [ "x$warning_mode" != "xpedantic" ]; 
   warnings="$warnings -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare"
   warnings="$warnings -Wwrite-strings -Wunused-function -Wunused-label -Wunused-value
-Wunused-variable"
 
+  # Make "printf like format specifier warnings" into error
+  #warnings="$warnings -Werror=format"
+
 # For more warnings, uncomment the following line
 # warnings="$global_warnings -Wshadow"
 

=== modified file 'storage/ndb/include/debugger/SignalLoggerManager.hpp'
--- a/storage/ndb/include/debugger/SignalLoggerManager.hpp	2008-09-30 15:07:47 +0000
+++ b/storage/ndb/include/debugger/SignalLoggerManager.hpp	2008-11-06 16:52:59 +0000
@@ -108,7 +108,8 @@ public:
   /**
    * Generic messages in the signal log
    */
-  void log(BlockNumber bno, const char * msg, ...);
+  void log(BlockNumber bno, const char * msg, ...)
+    ATTRIBUTE_FORMAT(printf, 3, 4);
   
   /**
    * LogModes

=== modified file 'storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp'
--- a/storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp	2008-09-19 22:10:17 +0000
+++ b/storage/ndb/include/kernel/signaldata/CreateTrigImpl.hpp	2008-11-06 17:17:12 +0000
@@ -25,7 +25,7 @@ struct CreateTrigImplReq
   enum RequestType
   {
     CreateTriggerOnline = 1,
-    CreateTriggerOffline = 2,
+    CreateTriggerOffline = 2
   };
 
   STATIC_CONST( SignalLength = 11 + MAXNROFATTRIBUTESINWORDS);

=== modified file 'storage/ndb/include/logger/Logger.hpp'
--- a/storage/ndb/include/logger/Logger.hpp	2008-10-05 07:12:28 +0000
+++ b/storage/ndb/include/logger/Logger.hpp	2008-11-06 16:52:59 +0000
@@ -228,7 +228,8 @@ public:
    *
    * @param pMsg the message.
    */
-  virtual void alert(const char* pMsg, ...) const;
+  virtual void alert(const char* pMsg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   virtual void alert(BaseString &pMsg) const { alert(pMsg.c_str()); };
   
   /**
@@ -236,7 +237,8 @@ public:
    *
    * @param pMsg the message.
    */
-  virtual void critical(const char* pMsg, ...) const;
+  virtual void critical(const char* pMsg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   virtual void critical(BaseString &pMsg) const { critical(pMsg.c_str()); };
 
   /**
@@ -244,7 +246,8 @@ public:
    *
    * @param pMsg the message.
    */
-  virtual void error(const char* pMsg, ...) const;
+  virtual void error(const char* pMsg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   virtual void error(BaseString &pMsg) const { error(pMsg.c_str()); };
 
   /**
@@ -252,7 +255,8 @@ public:
    *
    * @param pMsg the message.
    */
-  virtual void warning(const char* pMsg, ...) const;
+  virtual void warning(const char* pMsg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   virtual void warning(BaseString &pMsg) const { warning(pMsg.c_str()); };
 
   /**
@@ -260,7 +264,8 @@ public:
    *
    * @param pMsg the message.
    */
-  virtual void info(const char* pMsg, ...) const;
+  virtual void info(const char* pMsg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   virtual void info(BaseString &pMsg) const { info(pMsg.c_str()); };
 
   /**
@@ -268,7 +273,8 @@ public:
    *
    * @param pMsg the message.
    */
-  virtual void debug(const char* pMsg, ...) const;
+  virtual void debug(const char* pMsg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   virtual void debug(BaseString &pMsg) const { debug(pMsg.c_str()); };
 
   /*

=== modified file 'storage/ndb/include/ndbapi/Ndb.hpp'
--- a/storage/ndb/include/ndbapi/Ndb.hpp	2008-10-05 07:13:13 +0000
+++ b/storage/ndb/include/ndbapi/Ndb.hpp	2008-11-06 16:52:59 +0000
@@ -1884,7 +1884,9 @@ private:
 			     struct LinearSectionPtr ptr[3]);
   static void statusMessage(void*, Uint32, bool, bool);
 #ifdef VM_TRACE
-  void printState(const char* fmt, ...);
+#include <my_attribute.h>
+  void printState(const char* fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
 #endif
 };
 

=== modified file 'storage/ndb/include/util/BaseString.hpp'
--- a/storage/ndb/include/util/BaseString.hpp	2007-04-11 13:51:09 +0000
+++ b/storage/ndb/include/util/BaseString.hpp	2008-10-24 11:00:37 +0000
@@ -97,10 +97,12 @@ public:
 		     const BaseString &separator = BaseString(" "));
 
   /** @brief Assigns from a format string a la printf() */
-  BaseString& assfmt(const char* ftm, ...);
+  BaseString& assfmt(const char* ftm, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
 
   /** @brief Appends a format string a la printf() to the end */
-  BaseString& appfmt(const char* ftm, ...);
+  BaseString& appfmt(const char* ftm, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
 
   /**
    * Split a string into a vector of strings. Separate the string where
@@ -183,7 +185,8 @@ public:
   /**
    * snprintf on some platforms need special treatment
    */
-  static int snprintf(char *str, size_t size, const char *format, ...);
+  static int snprintf(char *str, size_t size, const char *format, ...)
+    ATTRIBUTE_FORMAT(printf, 3, 4);
   static int vsnprintf(char *str, size_t size, const char *format, va_list ap);
 private:
   char* m_chr;

=== modified file 'storage/ndb/include/util/NdbOut.hpp'
--- a/storage/ndb/include/util/NdbOut.hpp	2008-08-21 05:08:46 +0000
+++ b/storage/ndb/include/util/NdbOut.hpp	2008-11-06 16:52:59 +0000
@@ -77,8 +77,10 @@ public:
   NdbOut(OutputStream &);
   virtual ~NdbOut();
 
-  void print(const char * fmt, ...);
-  void println(const char * fmt, ...);
+  void print(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
+  void println(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   
   OutputStream * m_out;
 private:
@@ -132,7 +134,7 @@ private:
 };
 
 #else
-void ndbout_c(const char * fmt, ...);
+void ndbout_c(const char * fmt, ...) ATTRIBUTE_FORMAT(printf, 1, 2);
 #endif
 
 #endif

=== modified file 'storage/ndb/include/util/OutputStream.hpp'
--- a/storage/ndb/include/util/OutputStream.hpp	2008-09-07 22:48:48 +0000
+++ b/storage/ndb/include/util/OutputStream.hpp	2008-11-06 16:35:05 +0000
@@ -26,10 +26,12 @@ class OutputStream {
 public:
   OutputStream() {}
   virtual ~OutputStream() {}
-  virtual int print(const char * fmt, ...) = 0;
-  virtual int println(const char * fmt, ...) = 0;
-  virtual void flush() {}
-  virtual void reset_timeout() {}
+  virtual int print(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
+  virtual int println(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3) = 0;
+  virtual void flush() {};
+  virtual void reset_timeout() {};
 };
 
 class FileOutputStream : public OutputStream {
@@ -39,8 +41,10 @@ public:
   virtual ~FileOutputStream() {}
   FILE *getFile() { return f; }
 
-  int print(const char * fmt, ...);
-  int println(const char * fmt, ...);
+  int print(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
+  int println(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   void flush() { fflush(f); }
 };
 
@@ -56,8 +60,10 @@ public:
   bool timedout() { return m_timedout; }
   void reset_timeout() { m_timedout= false; m_timeout_remain= m_timeout_ms;}
 
-  int print(const char * fmt, ...);
-  int println(const char * fmt, ...);
+  int print(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
+  int println(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
 };
 
 
@@ -68,8 +74,10 @@ public:
                            unsigned write_timeout_ms = 1000);
   virtual ~BufferedSockOutputStream();
 
-  int print(const char * fmt, ...);
-  int println(const char * fmt, ...);
+  int print(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
+  int println(const char * fmt, ...)
+    ATTRIBUTE_FORMAT(printf, 2, 3);
 
   void flush();
 };

=== modified file 'storage/ndb/include/util/basestring_vsnprintf.h'
--- a/storage/ndb/include/util/basestring_vsnprintf.h	2006-12-23 19:20:40 +0000
+++ b/storage/ndb/include/util/basestring_vsnprintf.h	2008-10-24 11:00:37 +0000
@@ -15,12 +15,14 @@
 
 #ifndef BASESTRING_VSNPRINTF_H
 #define BASESTRING_VSNPRINTF_H
+#include <ndb_global.h>
 #include <stdarg.h>
 #if defined(__cplusplus)
 extern "C"
 {
 #endif
-int basestring_snprintf(char*, size_t, const char*, ...);
+int basestring_snprintf(char*, size_t, const char*, ...)
+  ATTRIBUTE_FORMAT(printf, 3, 4);
 int basestring_vsnprintf(char*,size_t, const char*,va_list);
 #if defined(__cplusplus)
 }

=== modified file 'storage/ndb/include/util/socket_io.h'
--- a/storage/ndb/include/util/socket_io.h	2007-03-22 11:35:07 +0000
+++ b/storage/ndb/include/util/socket_io.h	2008-10-24 11:00:37 +0000
@@ -35,9 +35,9 @@ extern "C" {
                    const char[], int len);
 
   int print_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time,
-                   const char *, ...);
+                   const char *, ...) ATTRIBUTE_FORMAT(printf, 4, 5);
   int println_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time,
-                     const char *, ...);
+                     const char *, ...) ATTRIBUTE_FORMAT(printf, 4, 5);
   int vprint_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time,
                     const char *, va_list);
   int vprintln_socket(NDB_SOCKET_TYPE, int timeout_ms, int *time,

=== modified file 'storage/ndb/src/common/debugger/EventLogger.cpp'
--- a/storage/ndb/src/common/debugger/EventLogger.cpp	2008-10-08 13:47:41 +0000
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp	2008-11-06 16:52:59 +0000
@@ -767,7 +767,7 @@ void getTextEventBufferStatus(QQQQ) {
   convert_unit(alloc, alloc_unit);
   convert_unit(max_, max_unit);
   BaseString::snprintf(m_text, m_text_len,
-		       "Event buffer status: used=%d%s(%d%) alloc=%d%s(%d%) "
+		       "Event buffer status: used=%d%s(%d%%) alloc=%d%s(%d%%) "
 		       "max=%d%s apply_epoch=%u/%u latest_epoch=%u/%u",
 		       used, used_unit,
 		       theData[2] ? (Uint32)((((Uint64)theData[1])*100)/theData[2]) : 0,

=== modified file 'storage/ndb/src/common/logger/Logger.cpp'
--- a/storage/ndb/src/common/logger/Logger.cpp	2008-10-05 07:12:28 +0000
+++ b/storage/ndb/src/common/logger/Logger.cpp	2008-11-06 17:17:12 +0000
@@ -391,7 +391,8 @@ int Logger::getHandlerCount() {
   if(m_pSyslogHandler) r++;
   r+=m_pHandlerList->size();
   return r;
-};
+}
+
 
 LogHandler* Logger::getHandler(int i) {
   if(i==0) return m_pConsoleHandler;

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2008-11-05 20:20:50 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2008-11-06 16:52:59 +0000
@@ -19727,7 +19727,7 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal
 	      TlcpPtr.p->lcpQueued,
 	      TlcpPtr.p->reportEmpty);
     char buf[8*_NDB_NODE_BITMASK_SIZE+1];
-    infoEvent(" m_EMPTY_LCP_REQ=%d", 
+    infoEvent(" m_EMPTY_LCP_REQ=%s",
 	      TlcpPtr.p->m_EMPTY_LCP_REQ.getText(buf));
     
     return;

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp	2008-10-07 11:24:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupStoredProcDef.cpp	2008-11-06 17:17:12 +0000
@@ -205,7 +205,7 @@ void Dbtup::releaseCopyProcedure()
   first.p->m_lastSegment= cCopyLastSeg;
   
   cCopyLastSeg= RNIL;
-};
+}
   
 
 void Dbtup::copyProcedure(Signal* signal,

=== modified file 'storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp'
--- a/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp	2008-11-06 10:17:49 +0000
+++ b/storage/ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp	2008-11-06 16:52:59 +0000
@@ -1057,7 +1057,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal
     
     for (unsigned i = 0; i < theOpenFiles.size(); i++){
       AsyncFile* file = theOpenFiles.getFile(i);
-      infoEvent("%2d (0x%x): %s", i,file, file->theFileName.c_str());
+      infoEvent("%2d (0x%lx): %s", i, (long)file, file->theFileName.c_str());
     }
     return;
   }
@@ -1066,7 +1066,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal
     
     for (unsigned i = 0; i < theFiles.size(); i++){
       AsyncFile* file = theFiles[i];
-      infoEvent("%2d (0x%x): %s", i,file, file->isOpen()?"OPEN":"CLOSED");
+      infoEvent("%2d (0x%lx): %s", i, (long)file, file->isOpen()?"OPEN":"CLOSED");
     }
     return;
   }
@@ -1075,7 +1075,7 @@ Ndbfs::execDUMP_STATE_ORD(Signal* signal
     
     for (unsigned i = 0; i < theIdleFiles.size(); i++){
       AsyncFile* file = theIdleFiles[i];
-      infoEvent("%2d (0x%x): %s", i,file, file->isOpen()?"OPEN":"CLOSED");
+      infoEvent("%2d (0x%lx): %s", i, (long)file, file->isOpen()?"OPEN":"CLOSED");
     }
     return;
   }

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2008-10-29 16:59:57 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2008-11-06 16:52:59 +0000
@@ -1210,7 +1210,7 @@ Suma::execDUMP_STATE_ORD(Signal* signal)
     for(Uint32 i = 0; i<c_no_of_buckets; i++)
     {
       Bucket* ptr= c_buckets + i;
-      infoEvent("Bucket %d %d%d-%x switch gci: %d max_acked_gci: %d max_gci: %d tail: %d
head: %d",
+      infoEvent("Bucket %d %d%d-%x switch gci: %llu max_acked_gci: %llu max_gci: %llu
tail: %d head: %d",
 		i, 
 		m_active_buckets.get(i),
 		m_switchover_buckets.get(i),
@@ -4151,7 +4151,7 @@ found:
   rep->flags = flags;
   rep->senderRef  = reference();
   rep->gcp_complete_rep_count = m_gcp_complete_rep_count;
-  
+
   if(m_gcp_complete_rep_count && !c_subscriber_nodes.isclear())
   {
     CRASH_INSERTION(13033);

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.hpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2008-10-09 19:17:11 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2008-11-06 16:52:59 +0000
@@ -210,7 +210,7 @@ public:
       R_SUB_STOP_REQ,
       R_START_ME_REQ,
       R_API_FAIL_REQ,
-      R_SUB_ABORT_START_REQ,
+      R_SUB_ABORT_START_REQ
     };
 
     Uint32 m_opType;

=== modified file 'storage/ndb/src/kernel/vm/SectionReader.cpp'
--- a/storage/ndb/src/kernel/vm/SectionReader.cpp	2008-09-10 00:32:18 +0000
+++ b/storage/ndb/src/kernel/vm/SectionReader.cpp	2008-11-06 17:17:12 +0000
@@ -197,7 +197,7 @@ SectionReader::getWordsPtr(Uint32 maxLen
   }
 
   return true;
-};
+}
 
 bool
 SectionReader::getWordsPtr(const Uint32*& readPtr,

=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.hpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2008-10-13 11:46:03 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2008-11-06 16:52:59 +0000
@@ -568,8 +568,10 @@ protected:
   /**
    * General info event (sent to cluster log)
    */
-  void infoEvent(const char * msg, ...) const ;
-  void warningEvent(const char * msg, ...) const ;
+  void infoEvent(const char * msg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
+  void warningEvent(const char * msg, ...) const
+    ATTRIBUTE_FORMAT(printf, 2, 3);
   
   /**
    * Get node state

=== modified file 'storage/ndb/src/kernel/vm/WatchDog.cpp'
--- a/storage/ndb/src/kernel/vm/WatchDog.cpp	2008-11-06 10:17:49 +0000
+++ b/storage/ndb/src/kernel/vm/WatchDog.cpp	2008-11-06 16:52:59 +0000
@@ -194,7 +194,7 @@ WatchDog::run()
       g_eventLogger->info("Watchdog: User time: %llu  System time: %llu",
                           (Uint64)my_tms.tms_utime,
                           (Uint64)my_tms.tms_stime);
-      g_eventLogger->warning("Watchdog: Warning overslept %u ms, expected %u ms.",
+      g_eventLogger->warning("Watchdog: Warning overslept %llu ms, expected %u ms.",
                              NdbTick_getMicrosPassed(last_time, now)/1000,
                              sleep_time);
     }

=== modified file 'storage/ndb/src/mgmapi/LocalConfig.cpp'
--- a/storage/ndb/src/mgmapi/LocalConfig.cpp	2008-08-21 06:32:45 +0000
+++ b/storage/ndb/src/mgmapi/LocalConfig.cpp	2008-11-06 16:52:59 +0000
@@ -286,7 +286,7 @@ LocalConfig::readConnectString(const cha
   bool return_value = parseString(connectString, err);
   if (!return_value) {
     BaseString err2;
-    err2.assfmt("Reading %d \"%s\": %s", info, connectString, err.c_str());
+    err2.assfmt("Reading %s \"%s\": %s", info, connectString, err.c_str());
     setError(0,err2.c_str());
   }
   return return_value;

=== modified file 'storage/ndb/src/mgmsrv/DirIterator.cpp'
--- a/storage/ndb/src/mgmsrv/DirIterator.cpp	2008-10-30 13:27:52 +0000
+++ b/storage/ndb/src/mgmsrv/DirIterator.cpp	2008-11-06 17:17:12 +0000
@@ -129,7 +129,7 @@ public:
 DirIterator::DirIterator() :
   m_impl(*new DirIteratorImpl())
 {
-};
+}
 
 DirIterator::~DirIterator()
 {

=== modified file 'storage/ndb/src/ndbapi/ClusterMgr.hpp'
--- a/storage/ndb/src/ndbapi/ClusterMgr.hpp	2008-11-06 16:35:32 +0000
+++ b/storage/ndb/src/ndbapi/ClusterMgr.hpp	2008-11-06 17:34:29 +0000
@@ -145,7 +145,7 @@ inline
 const ClusterMgr::Node &
 ClusterMgr::getNodeInfo(NodeId nodeId) const {
   // Check array bounds
-  assert(nodeId > 0 && nodeId < MAX_NODES);
+  assert(nodeId < MAX_NODES);
   return theNodes[nodeId];
 }
 

=== modified file 'storage/ndb/src/ndbapi/Ndb.cpp'
--- a/storage/ndb/src/ndbapi/Ndb.cpp	2008-11-06 16:35:32 +0000
+++ b/storage/ndb/src/ndbapi/Ndb.cpp	2008-11-06 17:34:29 +0000
@@ -687,7 +687,7 @@ Ndb::startTransactionLocal(Uint32 aPrior
   }//if
 #ifdef VM_TRACE
   if (tConnection->theListState != NdbTransaction::NotInList) {
-    printState("startTransactionLocal %x", tConnection);
+    printState("startTransactionLocal %lx", (long)tConnection);
     abort();
   }
 #endif

=== modified file 'storage/ndb/src/ndbapi/NdbInterpretedCode.cpp'
--- a/storage/ndb/src/ndbapi/NdbInterpretedCode.cpp	2008-10-08 02:16:47 +0000
+++ b/storage/ndb/src/ndbapi/NdbInterpretedCode.cpp	2008-11-06 16:52:59 +0000
@@ -850,7 +850,7 @@ NdbInterpretedCode::ret_sub()
   m_flags&= ~(InSubroutineDef);
 
   return add1(Interpreter::RETURN);
-};
+}
 
 /* Get a CodeMetaInfo object given a number
  * Label numbers start from 0.  Subroutine numbers start from

=== modified file 'storage/ndb/src/ndbapi/NdbScanOperation.cpp'
--- a/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2008-10-08 06:22:14 +0000
+++ b/storage/ndb/src/ndbapi/NdbScanOperation.cpp	2008-11-06 16:52:59 +0000
@@ -214,7 +214,7 @@ NdbScanOperation::addInterpretedCode()
   }
 
   return res;
-};
+}
 
 /* Method for handling scanoptions passed into 
  * NdbTransaction::scanTable or scanIndex
@@ -957,7 +957,7 @@ NdbScanOperation::readTuples(NdbScanOper
   m_savedBatchOldApi= batch;
 
   return 0;
-};
+}
 
 /* Most of the scan definition work for old + NdbRecord API scans is done here */
 int 
@@ -1340,7 +1340,7 @@ NdbScanOperation::nextResult(bool fetchA
   return nextResult(&dummyOutRowPtr,
                     fetchAllowed,
                     forceSend);
-};
+}
 
 /* nextResult() for NdbRecord operation. */
 int
@@ -2787,7 +2787,7 @@ const NdbIndexScanOperation::IndexBound*
 NdbIndexScanOperation::getIndexBoundFromRecAttr(NdbRecAttr* recAttr)
 {
   return &((OldApiScanRangeDefinition*)recAttr->aRef())->ib;
-};
+}
 
 
 /* Method called to release any resources allocated by the old 

=== modified file 'storage/ndb/src/ndbapi/NdbTransaction.cpp'
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp	2008-10-05 07:13:13 +0000
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp	2008-11-06 16:52:59 +0000
@@ -574,7 +574,7 @@ NdbTransaction::executeNoBlobs(NdbTransa
       for (unsigned i = 0; i < theNdb->theNoOfCompletedTransactions; i++)
         anyway += theNdb->theCompletedTransactionsArray[i] == this;
       if (anyway) {
-        theNdb->printState("execute %x", this);
+        theNdb->printState("execute %lx", (long)this);
         abort();
       }
 #endif
@@ -1041,7 +1041,7 @@ NdbTransaction::release(){
   theInUseState = false;
 #ifdef VM_TRACE
   if (theListState != NotInList) {
-    theNdb->printState("release %x", this);
+    theNdb->printState("release %lx", (long)this);
     abort();
   }
 #endif

=== modified file 'storage/ndb/src/ndbapi/Ndbif.cpp'
--- a/storage/ndb/src/ndbapi/Ndbif.cpp	2008-10-29 09:15:35 +0000
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp	2008-11-06 16:52:59 +0000
@@ -44,7 +44,6 @@
 #include <NdbTick.h>
 
 #include <EventLogger.hpp>
-extern EventLogger * g_eventLogger;
 
 /******************************************************************************
  * int init( int aNrOfCon, int aNrOfOp );
@@ -315,7 +314,7 @@ Ndb::abortTransactionsAfterNodeFailure(U
         localCon->theCompletionStatus = NdbTransaction::CompletedSuccess;
       } else {
 #ifdef VM_TRACE
-        printState("abortTransactionsAfterNodeFailure %x", this);
+        printState("abortTransactionsAfterNodeFailure %lx", (long)this);
         abort();
 #endif
       }

=== modified file 'storage/ndb/src/ndbapi/ObjectMap.hpp'
--- a/storage/ndb/src/ndbapi/ObjectMap.hpp	2008-04-22 19:36:05 +0000
+++ b/storage/ndb/src/ndbapi/ObjectMap.hpp	2008-10-24 11:00:37 +0000
@@ -85,7 +85,7 @@ NdbObjectIdMap::unmap(Uint32 id, void *o
       m_map[i].m_next = m_firstFree;
       m_firstFree = i;
     } else {
-      g_eventLogger->error("NdbObjectIdMap::unmap(%u, 0x%x) obj=0x%x",
+      g_eventLogger->error("NdbObjectIdMap::unmap(%u, 0x%lx) obj=0x%lx",
                            id, (long) object, (long) obj);
       DBUG_PRINT("error",("NdbObjectIdMap::unmap(%u, 0x%lx) obj=0x%lx",
                           id, (long) object, (long) obj));

=== modified file 'storage/ndb/test/ndbapi/testMgm.cpp'
--- a/storage/ndb/test/ndbapi/testMgm.cpp	2008-11-03 08:38:27 +0000
+++ b/storage/ndb/test/ndbapi/testMgm.cpp	2008-11-06 16:28:49 +0000
@@ -647,7 +647,6 @@ done:
   return result;
 }
 
-
 #include <mgmapi_internal.h>
 
 int runSetConfig(NDBT_Context* ctx, NDBT_Step* step)
@@ -847,6 +846,78 @@ done:
 }
 
 
+int runTestStatus(NDBT_Context* ctx, NDBT_Step* step)
+{
+  NdbMgmHandle h;
+
+  ndb_mgm_node_type types[2] = {
+    NDB_MGM_NODE_TYPE_NDB,
+    NDB_MGM_NODE_TYPE_UNKNOWN
+  };
+
+  NdbMgmd mgmd;
+  struct ndb_mgm_cluster_state *state;
+  const char *connectstring= mgmd.getConnectString();
+  int iterations = ctx->getNumLoops();
+  int delay = 2;
+
+  h= ndb_mgm_create_handle();
+  if ( h == 0)
+  {
+    ndbout_c("Unable to create handle");
+    return NDBT_FAILED;
+  }
+  if (ndb_mgm_set_connectstring(h, connectstring) == -1)
+  {
+    ndbout_c("Unable to set connectstring");
+    ndb_mgm_destroy_handle(&h);
+    return NDBT_FAILED;
+  }
+  if (ndb_mgm_connect(h,0,0,0))
+  {
+    ndbout_c("connect failed, %d: %s",
+             ndb_mgm_get_latest_error(h),
+             ndb_mgm_get_latest_error_msg(h));
+    ndb_mgm_destroy_handle(&h);
+    return NDBT_FAILED;
+  }
+
+  int result= NDBT_OK;
+  while (iterations-- != 0 && result == NDBT_OK)
+  {
+    state = ndb_mgm_get_status(h);
+    if(state == NULL) {
+      ndbout_c("Could not get status!");
+      result= NDBT_FAILED;
+      continue;
+    }
+    free(state);
+
+    state = ndb_mgm_get_status2(h, types);
+    if(state == NULL){
+      ndbout_c("Could not get status2!");
+      result= NDBT_FAILED;
+      continue;
+    }
+    free(state);
+
+    state = ndb_mgm_get_status2(h, 0);
+    if(state == NULL){
+      ndbout_c("Could not get status2 second time!");
+      result= NDBT_FAILED;
+      continue;
+    }
+    free(state);
+
+    NdbSleep_MilliSleep(delay);
+  }
+  // No disconnect, destroy should take care of that
+  // ndb_mgm_disconnect(h);
+  ndb_mgm_destroy_handle(&h);
+  return result;
+}
+
+
 NDBT_TESTSUITE(testMgm);
 DRIVER(DummyDriver); /* turn off use of NdbApi */
 TESTCASE("ApiSessionFailure",
@@ -897,6 +968,16 @@ TESTCASE("MgmLogRotation",
   INITIALIZER(runTestMgmLogRotation);
 
 }
+TESTCASE("TestStatus",
+	 "Test status and status2"){
+  INITIALIZER(runTestStatus);
+
+}
+TESTCASE("TestStatus200",
+	 "Test status and status2 with 200 threads"){
+  STEPS(runTestStatus, 200);
+
+}
 NDBT_TESTSUITE_END(testMgm);
 
 int main(int argc, const char** argv){

=== modified file 'storage/ndb/tools/restore/consumer_restore.cpp'
--- a/storage/ndb/tools/restore/consumer_restore.cpp	2008-10-08 08:47:03 +0000
+++ b/storage/ndb/tools/restore/consumer_restore.cpp	2008-11-06 16:52:59 +0000
@@ -1931,7 +1931,7 @@ BackupRestore::check_compat_common(const
   }
 
   return false;
-};
+}
 
 void *
 BackupRestore::convert_int8_int16(const void *old_data,

Thread
bzr push into mysql-5.1 branch (msvensson:3052) Magnus Svensson6 Nov