List:Commits« Previous MessageNext Message »
From:Monty Taylor Date:April 22 2008 7:36pm
Subject:bk commit into 5.1 tree (mtaylor:1.2578) BUG#35927
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of mtaylor.  When mtaylor does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-04-22 12:36:05-07:00, mtaylor@solace.(none) +30 -0
  Bug #35927  	global g_eventLogger breaks dlopened libndbclient
  
  Initialize g_eventLogger in ndb_init instead of statically. 
  Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2008-04-22 12:35:59-07:00, mtaylor@solace.(none) +15 -0
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/transporter/TCP_Transporter.cpp@stripped, 2008-04-22 12:35:59-07:00, mtaylor@solace.(none) +25 -24
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/transporter/Transporter.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +4 -4
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/transporter/TransporterRegistry.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +34 -33
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/util/Makefile.am@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +1 -1
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/util/ndb_init.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +44 -8
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/common/util/ndb_init.cpp@stripped, 2008-04-22 12:35:39-07:00, mtaylor@solace.(none) +0 -0
    Rename: storage/ndb/src/common/util/ndb_init.c -> storage/ndb/src/common/util/ndb_init.cpp

  storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +10 -10
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +4 -7
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2008-04-22 12:36:01-07:00, mtaylor@solace.(none) +59 -59
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/blocks/lgman.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +17 -17
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/blocks/suma/Suma.cpp@stripped, 2008-04-22 12:36:01-07:00, mtaylor@solace.(none) +8 -8
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/error/ErrorReporter.cpp@stripped, 2008-04-22 12:36:01-07:00, mtaylor@solace.(none) +3 -3
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/main.cpp@stripped, 2008-04-22 12:36:00-07:00, mtaylor@solace.(none) +39 -39
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/vm/Configuration.cpp@stripped, 2008-04-22 12:36:01-07:00, mtaylor@solace.(none) +1 -1
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/vm/Emulator.cpp@stripped, 2008-04-22 12:36:01-07:00, mtaylor@solace.(none) +13 -13
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/vm/SimulatedBlock.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +4 -4
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/vm/WatchDog.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +11 -11
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/vm/bench_pool.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +1 -1
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +26 -30
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +49 -48
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/mgmsrv/Services.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +2 -2
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/mgmsrv/main.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +6 -6
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/DictCache.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +26 -6
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp@stripped, 2008-04-22 12:36:02-07:00, mtaylor@solace.(none) +11 -11
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/NdbTransaction.cpp@stripped, 2008-04-22 12:36:03-07:00, mtaylor@solace.(none) +8 -8
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/Ndbif.cpp@stripped, 2008-04-22 12:36:03-07:00, mtaylor@solace.(none) +3 -3
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/Ndbinit.cpp@stripped, 2008-04-22 12:36:03-07:00, mtaylor@solace.(none) +2 -2
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/ObjectMap.cpp@stripped, 2008-04-22 12:36:03-07:00, mtaylor@solace.(none) +2 -2
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/ObjectMap.hpp@stripped, 2008-04-22 12:36:03-07:00, mtaylor@solace.(none) +3 -3
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

  storage/ndb/src/ndbapi/ndb_cluster_connection.cpp@stripped, 2008-04-22 12:36:03-07:00, mtaylor@solace.(none) +41 -37
    Bug #35927  	global g_eventLogger breaks dlopened libndbclient
    
    Initialize g_eventLogger in ndb_init instead of statically. 
    Initialize f_invalid_table and f_altered_table on first use.

diff -Nrup a/storage/ndb/src/common/debugger/EventLogger.cpp b/storage/ndb/src/common/debugger/EventLogger.cpp
--- a/storage/ndb/src/common/debugger/EventLogger.cpp	2008-02-20 05:05:19 -08:00
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp	2008-04-22 12:35:59 -07:00
@@ -1253,3 +1253,18 @@ EventLogger::setFilterLevel(int filterLe
 {
   m_filterLevel = filterLevel;
 }
+
+
+EventLogger*
+create_event_logger()
+{
+  return new EventLogger();
+}
+
+void
+destroy_event_logger(class EventLogger ** g_eventLogger)
+{
+  delete *g_eventLogger;
+  *g_eventLogger = 0;
+}
+
diff -Nrup a/storage/ndb/src/common/transporter/TCP_Transporter.cpp b/storage/ndb/src/common/transporter/TCP_Transporter.cpp
--- a/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2008-01-24 03:20:55 -08:00
+++ b/storage/ndb/src/common/transporter/TCP_Transporter.cpp	2008-04-22 12:35:59 -07:00
@@ -21,7 +21,7 @@
 #include <NdbSleep.h>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 // End of stuff to be moved
 
 #ifdef NDB_WIN32
@@ -175,8 +175,8 @@ set_get(NDB_SOCKET_TYPE fd, int level, i
 		 (char*)&val, sizeof(val)) < 0)
   {
 #ifdef DEBUG_TRANSPORTER
-    g_eventLogger.error("setsockopt(%s, %d) errno: %d %s", 
-                        optname, val, errno, strerror(errno));
+    g_eventLogger->error("setsockopt(%s, %d) errno: %d %s",
+                         optname, val, errno, strerror(errno));
 #endif
   }
   
@@ -186,8 +186,8 @@ set_get(NDB_SOCKET_TYPE fd, int level, i
       actual != val)
   {
 #ifdef DEBUG_TRANSPORTER
-    g_eventLogger.error("setsockopt(%s, %d) - actual %d default: %d", 
-                        optname, val, actual, defval);
+    g_eventLogger->error("setsockopt(%s, %d) - actual %d default: %d",
+                         optname, val, actual, defval);
 #endif
   }
 }
@@ -225,7 +225,7 @@ TCP_Transporter::setSocketNonBlocking(ND
   if(ioctlsocket(socket, FIONBIO, &ul))
   {
 #ifdef DEBUG_TRANSPORTER
-    g_eventLogger.error("Set non-blocking server error3: %d", InetErrno);
+    g_eventLogger->error("Set non-blocking server error3: %d", InetErrno);
 #endif
   }//if
   return true;
@@ -239,13 +239,13 @@ TCP_Transporter::setSocketNonBlocking(ND
   flags = fcntl(socket, F_GETFL, 0);
   if (flags < 0) {
 #ifdef DEBUG_TRANSPORTER
-    g_eventLogger.error("Set non-blocking server error1: %s", strerror(InetErrno));
+    g_eventLogger->error("Set non-blocking server error1: %s", strerror(InetErrno));
 #endif
   }//if
   flags |= NDB_NONBLOCK;
   if (fcntl(socket, F_SETFL, flags) == -1) {
 #ifdef DEBUG_TRANSPORTER
-    g_eventLogger.error("Set non-blocking server error2: %s", strerror(InetErrno));
+    g_eventLogger->error("Set non-blocking server error2: %s", strerror(InetErrno));
 #endif
   }//if
   return true;
@@ -378,12 +378,13 @@ TCP_Transporter::doSend() {
 
       // Send failed
 #if defined DEBUG_TRANSPORTER
-      g_eventLogger.error("Send Failure(disconnect==%d) to node = %d nBytesSent = %d "
-	       "errno = %d strerror = %s",
-	       DISCONNECT_ERRNO(InetErrno, nBytesSent),
-	       remoteNodeId, nBytesSent, InetErrno, 
-	       (char*)ndbstrerror(InetErrno));
-#endif   
+      g_eventLogger->error("Send Failure(disconnect==%d) to node = %d "
+                           "nBytesSent = %d "
+                           "errno = %d strerror = %s",
+                           DISCONNECT_ERRNO(InetErrno, nBytesSent),
+                           remoteNodeId, nBytesSent, InetErrno,
+                           (char*)ndbstrerror(InetErrno));
+#endif
       if(DISCONNECT_ERRNO(InetErrno, nBytesSent)){
 	doDisconnect();
 	report_disconnect(InetErrno);
@@ -413,12 +414,12 @@ TCP_Transporter::doReceive() {
       
       if(receiveBuffer.sizeOfData > receiveBuffer.sizeOfBuffer){
 #ifdef DEBUG_TRANSPORTER
-	g_eventLogger.error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)",
-		 receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer);
-	g_eventLogger.error("nBytesRead = %d", nBytesRead);
+        g_eventLogger->error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)",
+                             receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer);
+        g_eventLogger->error("nBytesRead = %d", nBytesRead);
 #endif
-	g_eventLogger.error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)",
-		 receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer);
+        g_eventLogger->error("receiveBuffer.sizeOfData(%d) > receiveBuffer.sizeOfBuffer(%d)",
+                             receiveBuffer.sizeOfData, receiveBuffer.sizeOfBuffer);
 	report_error(TE_INVALID_MESSAGE_LENGTH);
 	return 0;
       }
@@ -434,11 +435,11 @@ TCP_Transporter::doReceive() {
       return nBytesRead;
     } else {
 #if defined DEBUG_TRANSPORTER
-      g_eventLogger.error("Receive Failure(disconnect==%d) to node = %d nBytesSent = %d "
-	       "errno = %d strerror = %s",
-	       DISCONNECT_ERRNO(InetErrno, nBytesRead),
-	       remoteNodeId, nBytesRead, InetErrno, 
-	       (char*)ndbstrerror(InetErrno));
+      g_eventLogger->error("Receive Failure(disconnect==%d) to node = %d nBytesSent = %d "
+                           "errno = %d strerror = %s",
+                           DISCONNECT_ERRNO(InetErrno, nBytesRead),
+                           remoteNodeId, nBytesRead, InetErrno,
+                           (char*)ndbstrerror(InetErrno));
 #endif   
       if(DISCONNECT_ERRNO(InetErrno, nBytesRead)){
 	// The remote node has closed down
diff -Nrup a/storage/ndb/src/common/transporter/Transporter.cpp b/storage/ndb/src/common/transporter/Transporter.cpp
--- a/storage/ndb/src/common/transporter/Transporter.cpp	2007-11-14 04:22:53 -08:00
+++ b/storage/ndb/src/common/transporter/Transporter.cpp	2008-04-22 12:36:00 -07:00
@@ -24,7 +24,7 @@
 #include <OutputStream.hpp>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 Transporter::Transporter(TransporterRegistry &t_reg,
 			 TransporterType _type,
@@ -204,14 +204,14 @@ Transporter::connect_client(NDB_SOCKET_T
       DBUG_PRINT("error", ("Transporter types mismatch this=%d remote=%d",
 			   m_type, remote_transporter_type));
       NDB_CLOSE_SOCKET(sockfd);
-      g_eventLogger.error("Incompatible configuration: transporter type "
-			  "mismatch with node %d", nodeId);
+      g_eventLogger->error("Incompatible configuration: transporter type "
+                           "mismatch with node %d", nodeId);
       DBUG_RETURN(false);
     }
   }
   else if (m_type == tt_SHM_TRANSPORTER)
   {
-    g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId);
+    g_eventLogger->warning("Unable to verify transporter compatability with node %d", nodeId);
   }
 
   {
diff -Nrup a/storage/ndb/src/common/transporter/TransporterRegistry.cpp b/storage/ndb/src/common/transporter/TransporterRegistry.cpp
--- a/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2007-11-14 04:22:53 -08:00
+++ b/storage/ndb/src/common/transporter/TransporterRegistry.cpp	2008-04-22 12:36:00 -07:00
@@ -47,7 +47,7 @@ extern int g_ndb_shm_signum;
 #include <mgmapi/mgmapi_debug.h>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 struct in_addr
 TransporterRegistry::get_connect_address(NodeId node_id) const
@@ -241,8 +241,8 @@ TransporterRegistry::connect_server(NDB_
     {
       DBUG_PRINT("error", ("Transporter types mismatch this=%d remote=%d",
 			   t->m_type, remote_transporter_type));
-      g_eventLogger.error("Incompatible configuration: Transporter type "
-			  "mismatch with node %d", nodeId);
+      g_eventLogger->error("Incompatible configuration: Transporter type "
+                           "mismatch with node %d", nodeId);
 
       // wait for socket close for 1 second to let message arrive at client
       {
@@ -258,7 +258,7 @@ TransporterRegistry::connect_server(NDB_
   }
   else if (t->m_type == tt_SHM_TRANSPORTER)
   {
-    g_eventLogger.warning("Unable to verify transporter compatability with node %d", nodeId);
+    g_eventLogger->warning("Unable to verify transporter compatability with node %d", nodeId);
   }
 
   // setup transporter (transporter responsible for closing sockfd)
@@ -787,7 +787,7 @@ TransporterRegistry::poll_TCP(Uint32 tim
   
   tcpReadSelectReply = select(maxSocketValue, &tcpReadset, 0, 0, &timeout);  
   if(false && tcpReadSelectReply == -1 && errno == EINTR)
-    g_eventLogger.info("woke-up by signal");
+    g_eventLogger->info("woke-up by signal");
 
 #ifdef NDB_WIN32
   if(tcpReadSelectReply == SOCKET_ERROR)
@@ -1129,19 +1129,20 @@ TransporterRegistry::start_clients_threa
 	      }
 	      else if(ndb_mgm_is_connected(m_mgm_handle))
 	      {
-		g_eventLogger.info("Failed to get dynamic port to connect to: %d", res);
+                g_eventLogger->info("Failed to get dynamic port to connect to: %d", res);
 		ndb_mgm_disconnect(m_mgm_handle);
 	      }
 	      else
 	      {
-		g_eventLogger.info("Management server closed connection early. "
-			 "It is probably being shut down (or has problems). "
-			 "We will retry the connection. %d %s %s line: %d",
-                                   ndb_mgm_get_latest_error(m_mgm_handle),
-                                   ndb_mgm_get_latest_error_desc(m_mgm_handle),
-                                   ndb_mgm_get_latest_error_msg(m_mgm_handle),
-                                   ndb_mgm_get_latest_error_line(m_mgm_handle)
-                                   );
+                g_eventLogger->info
+                  ("Management server closed connection early. "
+                   "It is probably being shut down (or has problems). "
+                   "We will retry the connection. %d %s %s line: %d",
+                   ndb_mgm_get_latest_error(m_mgm_handle),
+                   ndb_mgm_get_latest_error_desc(m_mgm_handle),
+                   ndb_mgm_get_latest_error_msg(m_mgm_handle),
+                   ndb_mgm_get_latest_error_line(m_mgm_handle)
+                   );
 	      }
 	    }
 	    /** else
@@ -1235,7 +1236,7 @@ TransporterRegistry::start_service(Socke
   DBUG_ENTER("TransporterRegistry::start_service");
   if (m_transporter_interface.size() > 0 && !nodeIdSpecified)
   {
-    g_eventLogger.error("TransporterRegistry::startReceiving: localNodeId not specified");
+    g_eventLogger->error("TransporterRegistry::startReceiving: localNodeId not specified");
     DBUG_RETURN(false);
   }
 
@@ -1261,10 +1262,10 @@ TransporterRegistry::start_service(Socke
 	 * If it wasn't a dynamically allocated port, or
 	 * our attempts at getting a new dynamic port failed
 	 */
-	g_eventLogger.error("Unable to setup transporter service port: %s:%d!\n"
-		 "Please check if the port is already used,\n"
-		 "(perhaps the node is already running)",
-		 t.m_interface ? t.m_interface : "*", t.m_s_service_port);
+        g_eventLogger->error("Unable to setup transporter service port: %s:%d!\n"
+                             "Please check if the port is already used,\n"
+                             "(perhaps the node is already running)",
+                             t.m_interface ? t.m_interface : "*", t.m_s_service_port);
 	delete transporter_service;
 	DBUG_RETURN(false);
       }
@@ -1306,9 +1307,9 @@ TransporterRegistry::startReceiving()
     if(ret != 0)
     {
       DBUG_PRINT("error",("Install failed"));
-      g_eventLogger.error("Failed to install signal handler for"
-			  " SHM transporter, signum %d, errno: %d (%s)",
-			  g_ndb_shm_signum, errno, strerror(errno));
+      g_eventLogger->error("Failed to install signal handler for"
+                           " SHM transporter, signum %d, errno: %d (%s)",
+                           g_ndb_shm_signum, errno, strerror(errno));
     }
   }
 #endif // NDB_SHM_TRANSPORTER
@@ -1358,13 +1359,13 @@ bool TransporterRegistry::connect_client
 
   if(!mgm_nodeid)
   {
-    g_eventLogger.error("%s: %d", __FILE__, __LINE__);
+    g_eventLogger->error("%s: %d", __FILE__, __LINE__);
     return false;
   }
   Transporter * t = theTransporters[mgm_nodeid];
   if (!t)
   {
-    g_eventLogger.error("%s: %d", __FILE__, __LINE__);
+    g_eventLogger->error("%s: %d", __FILE__, __LINE__);
     return false;
   }
   DBUG_RETURN(t->connect_client(connect_ndb_mgmd(h)));
@@ -1380,7 +1381,7 @@ NDB_SOCKET_TYPE TransporterRegistry::con
 
   if ( h==NULL || *h == NULL )
   {
-    g_eventLogger.error("%s: %d", __FILE__, __LINE__);
+    g_eventLogger->error("%s: %d", __FILE__, __LINE__);
     return NDB_INVALID_SOCKET;
   }
 
@@ -1393,10 +1394,10 @@ NDB_SOCKET_TYPE TransporterRegistry::con
 				   m_transporter_interface[i].m_s_service_port,
 				   &mgm_reply) < 0)
     {
-      g_eventLogger.error("Error: %s: %d",
-	       ndb_mgm_get_latest_error_desc(*h),
-	       ndb_mgm_get_latest_error(*h));
-      g_eventLogger.error("%s: %d", __FILE__, __LINE__);
+      g_eventLogger->error("Error: %s: %d",
+                           ndb_mgm_get_latest_error_desc(*h),
+                           ndb_mgm_get_latest_error(*h));
+      g_eventLogger->error("%s: %d", __FILE__, __LINE__);
       ndb_mgm_destroy_handle(h);
       return NDB_INVALID_SOCKET;
     }
@@ -1408,10 +1409,10 @@ NDB_SOCKET_TYPE TransporterRegistry::con
   NDB_SOCKET_TYPE sockfd= ndb_mgm_convert_to_transporter(h);
   if ( sockfd == NDB_INVALID_SOCKET)
   {
-    g_eventLogger.error("Error: %s: %d",
-	     ndb_mgm_get_latest_error_desc(*h),
-	     ndb_mgm_get_latest_error(*h));
-    g_eventLogger.error("%s: %d", __FILE__, __LINE__);
+    g_eventLogger->error("Error: %s: %d",
+                         ndb_mgm_get_latest_error_desc(*h),
+                         ndb_mgm_get_latest_error(*h));
+    g_eventLogger->error("%s: %d", __FILE__, __LINE__);
     ndb_mgm_destroy_handle(h);
   }
   return sockfd;
diff -Nrup a/storage/ndb/src/common/util/Makefile.am b/storage/ndb/src/common/util/Makefile.am
--- a/storage/ndb/src/common/util/Makefile.am	2007-09-25 03:05:25 -07:00
+++ b/storage/ndb/src/common/util/Makefile.am	2008-04-22 12:36:00 -07:00
@@ -23,7 +23,7 @@ libgeneral_la_SOURCES = \
 	    NdbSqlUtil.cpp new.cpp \
             uucode.c random.c version.c \
             strdup.c \
-            ConfigValues.cpp ndb_init.c basestring_vsnprintf.c \
+            ConfigValues.cpp ndb_init.cpp basestring_vsnprintf.c \
             Bitmask.cpp \
 	    ndb_rand.c
 
diff -Nrup a/storage/ndb/src/common/util/ndb_init.c b/storage/ndb/src/common/util/ndb_init.c
--- a/storage/ndb/src/common/util/ndb_init.c	2006-12-23 11:20:13 -08:00
+++ /dev/null	Wed Dec 31 16:00:00 196900
@@ -1,53 +0,0 @@
-/* Copyright (C) 2003 MySQL AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
-
-#include <ndb_global.h>
-#include <my_sys.h>
-#include <NdbMutex.h>
-
-NdbMutex *g_ndb_connection_mutex = NULL;
-
-void
-ndb_init_internal()
-{
-  if (!g_ndb_connection_mutex)
-    g_ndb_connection_mutex = NdbMutex_Create();
-}
-
-int
-ndb_init()
-{
-  if (my_init()) {
-    const char* err = "my_init() failed - exit\n";
-    write(2, err, strlen(err));
-    exit(1);
-  }
-  ndb_init_internal();
-  return 0;
-}
-
-void
-ndb_end_internal()
-{
-  if (g_ndb_connection_mutex)
-    NdbMutex_Destroy(g_ndb_connection_mutex);
-}
-
-void
-ndb_end(int flags)
-{
-  my_end(flags);
-  ndb_end_internal();
-}
diff -Nrup a/storage/ndb/src/common/util/ndb_init.cpp b/storage/ndb/src/common/util/ndb_init.cpp
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/storage/ndb/src/common/util/ndb_init.cpp	2008-04-22 12:36:00 -07:00
@@ -0,0 +1,89 @@
+/* Copyright (C) 2003 MySQL AB
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; version 2 of the License.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include <ndb_global.h>
+#include <my_sys.h>
+#include <NdbMutex.h>
+
+class EventLogger *g_eventLogger = NULL;
+
+NdbMutex *g_ndb_connection_mutex = NULL;
+
+extern class EventLogger * create_event_logger();
+extern void destroy_event_logger(class EventLogger ** g_eventLogger);
+
+static int ndb_init_called = 0;
+
+extern "C"
+{
+
+void
+ndb_init_internal()
+{
+  if (!g_ndb_connection_mutex)
+    g_ndb_connection_mutex = NdbMutex_Create();
+  if (!g_eventLogger)
+    g_eventLogger = create_event_logger();
+  if ((g_ndb_connection_mutex == NULL) || (g_eventLogger == NULL))
+  {
+    {
+      const char* err = "ndb_init() failed - exit\n";
+      write(2, err, strlen(err));
+      exit(1);
+    }
+  }
+}
+
+int
+ndb_init()
+{
+  if (ndb_init_called == 0)
+  {
+    ndb_init_called = 1;
+    if (my_init())
+    {
+      const char* err = "my_init() failed - exit\n";
+      write(2, err, strlen(err));
+      exit(1);
+    }
+    ndb_init_internal();
+  }
+  return 0;
+}
+
+void
+ndb_end_internal()
+{
+  if (g_ndb_connection_mutex) 
+  {
+    NdbMutex_Destroy(g_ndb_connection_mutex);
+    g_ndb_connection_mutex=NULL;
+  }
+  if (g_eventLogger)
+    destroy_event_logger(&g_eventLogger);
+}
+
+void
+ndb_end(int flags)
+{
+  if (ndb_init_called == 1)
+  {
+    my_end(flags);
+    ndb_end_internal();
+    ndb_init_called = 0;
+  }
+}
+
+} /* extern "C" */
diff -Nrup a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
--- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2007-11-23 02:06:27 -08:00
+++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp	2008-04-22 12:36:00 -07:00
@@ -43,7 +43,7 @@
 #include <SafeCounter.hpp>
 
 // Used here only to print event reports on stdout/console.
-EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 extern int simulate_error_during_shutdown;
 
 Cmvmi::Cmvmi(Block_context& ctx) :
@@ -241,8 +241,8 @@ void Cmvmi::execEVENT_REP(Signal* signal
   }
 
   // Print the event info
-  g_eventLogger.log(eventReport->getEventType(), 
-		    signal->theData, signal->getLength(), 0, 0);
+  g_eventLogger->log(eventReport->getEventType(), 
+                     signal->theData, signal->getLength(), 0, 0);
   
   return;
 }//execEVENT_REP()
@@ -421,7 +421,7 @@ void Cmvmi::execSTTOR(Signal* signal)
     {
       int res = NdbMem_MemLockAll(0);
       if(res != 0){
-	g_eventLogger.warning("Failed to memlock pages");
+        g_eventLogger->warning("Failed to memlock pages");
 	warningEvent("Failed to memlock pages");
       }
     }
@@ -854,12 +854,12 @@ Cmvmi::execSTART_ORD(Signal* signal) {
       int res = NdbMem_MemLockAll(1);
       if(res != 0)
       {
-	g_eventLogger.warning("Failed to memlock pages");
+        g_eventLogger->warning("Failed to memlock pages");
 	warningEvent("Failed to memlock pages");
       }
       else
       {
-	g_eventLogger.info("Locked future allocations");
+        g_eventLogger->info("Locked future allocations");
       }
     }
     
@@ -1027,15 +1027,15 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal
   {
     SubscriberPtr ptr;
     subscribers.first(ptr);  
-    g_eventLogger.info("List subscriptions:");
+    g_eventLogger->info("List subscriptions:");
     while(ptr.i != RNIL)
     {
-      g_eventLogger.info("Subscription: %u, nodeId: %u, ref: 0x%x",
-                         ptr.i,  refToNode(ptr.p->blockRef), ptr.p->blockRef);
+      g_eventLogger->info("Subscription: %u, nodeId: %u, ref: 0x%x",
+                          ptr.i,  refToNode(ptr.p->blockRef), ptr.p->blockRef);
       for(Uint32 i = 0; i < LogLevel::LOGLEVEL_CATEGORIES; i++)
       {
         Uint32 level = ptr.p->logLevel.getLogLevel((LogLevel::EventCategory)i);
-        g_eventLogger.info("Category %u Level %u", i, level);
+        g_eventLogger->info("Category %u Level %u", i, level);
       }
       subscribers.next(ptr);
     }
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2008-04-03 05:46:00 -07:00
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2008-04-22 12:36:00 -07:00
@@ -83,15 +83,12 @@
 #include <signaldata/ApiBroadcast.hpp>
 #include <signaldata/DictLock.hpp>
 
-#include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
-
 #include <signaldata/DropObj.hpp>
 #include <signaldata/CreateObj.hpp>
 #include <SLList.hpp>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 #define ZNOT_FOUND 626
 #define ZALREADYEXIST 630
@@ -14146,14 +14143,14 @@ Dbdict::execDICT_LOCK_REQ(Signal* signal
     if (c_outstanding_sub_startstop)
     {
       jam();
-      g_eventLogger.info("refing dict lock to %u", refToNode(req.userRef));
+      g_eventLogger->info("refing dict lock to %u", refToNode(req.userRef));
       sendDictLockRef(signal, req, DictLockRef::TooManyRequests);
       return;
     }
 
     c_sub_startstop_lock.set(refToNode(req.userRef));
 
-    g_eventLogger.info("granting dict lock to %u", refToNode(req.userRef));
+    g_eventLogger->info("granting dict lock to %u", refToNode(req.userRef));
     DictLockConf* conf = (DictLockConf*)signal->getDataPtrSend();
     conf->userPtr = req.userPtr;
     conf->lockType = req.lockType;
@@ -14270,7 +14267,7 @@ Dbdict::execDICT_UNLOCK_ORD(Signal* sign
   if (ord->lockType ==  DictLockReq::SumaStartMe)
   {
     ndbassert(signal->getLength() == DictUnlockOrd::SignalLengthSuma);
-    g_eventLogger.info("clearing dict lock for %u", refToNode(ord->senderRef));
+    g_eventLogger->info("clearing dict lock for %u", refToNode(ord->senderRef));
     c_sub_startstop_lock.clear(refToNode(ord->senderRef));
     return;
   }
diff -Nrup a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2008-03-12 02:29:09 -07:00
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2008-04-22 12:36:01 -07:00
@@ -72,7 +72,7 @@
 #include <signaldata/Upgrade.hpp>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 #define SYSFILE ((Sysfile *)&sysfileData[0])
 
@@ -2064,8 +2064,8 @@ ref:
   if (getNodeStatus(nodeId) != NodeRecord::DEAD)
   {
     jam();
-    g_eventLogger.error("nodeStatus in START_PERMREQ = %u",
-                        (Uint32) getNodeStatus(nodeId));
+    g_eventLogger->error("nodeStatus in START_PERMREQ = %u",
+                         (Uint32) getNodeStatus(nodeId));
     goto ref;
   }//if
 
@@ -4597,9 +4597,9 @@ void Dbdih::checkCopyTab(Signal* signal,
     jam();
     break;
   default:
-    g_eventLogger.error("outstanding gsn: %s(%d)", 
-                        getSignalName(c_nodeStartMaster.m_outstandingGsn), 
-                        c_nodeStartMaster.m_outstandingGsn);
+    g_eventLogger->error("outstanding gsn: %s(%d)",
+                         getSignalName(c_nodeStartMaster.m_outstandingGsn),
+                         c_nodeStartMaster.m_outstandingGsn);
     ndbrequire(false);
   }
   
@@ -5067,10 +5067,10 @@ void Dbdih::failedNodeLcpHandling(Signal
       failedNodePtr.p->activeStatus = Sysfile::NS_NotActive_NotTakenOver;
       break;
     default:
-      g_eventLogger.error("activeStatus = %u "
-                          "at failure after NODE_FAILREP of node = %u",
-                          (Uint32) failedNodePtr.p->activeStatus,
-                          failedNodePtr.i);
+      g_eventLogger->error("activeStatus = %u "
+                           "at failure after NODE_FAILREP of node = %u",
+                           (Uint32) failedNodePtr.p->activeStatus,
+                           failedNodePtr.i);
       ndbrequire(false);
       break;
     }//switch
@@ -5233,7 +5233,7 @@ Dbdih::startLcpMasterTakeOver(Signal* si
     /**
      * Node failure during master take over...
      */
-    g_eventLogger.info("Nodefail during master take over (old: %d)", oldNode);
+    g_eventLogger->info("Nodefail during master take over (old: %d)", oldNode);
   }
   
   NodeRecordPtr nodePtr;
@@ -5510,8 +5510,8 @@ void Dbdih::execMASTER_GCPCONF(Signal* s
   if (latestLcpId > SYSFILE->latestLCP_ID) {
     jam();
 #if 0
-    g_eventLogger.info("Dbdih: Setting SYSFILE->latestLCP_ID to %d",
-                       latestLcpId);
+    g_eventLogger->info("Dbdih: Setting SYSFILE->latestLCP_ID to %d",
+                        latestLcpId);
     SYSFILE->latestLCP_ID = latestLcpId;
 #endif
     SYSFILE->keepGCI = oldestKeepGci;
@@ -6114,10 +6114,10 @@ Dbdih::checkLocalNodefailComplete(Signal
 
   if (ERROR_INSERTED(7030))
   {
-    g_eventLogger.info("Reenable GCP_PREPARE");
+    g_eventLogger->info("Reenable GCP_PREPARE");
     CLEAR_ERROR_INSERT_VALUE;
   }
-  
+
   NFCompleteRep * const nf = (NFCompleteRep *)&signal->theData[0];
   nf->blockNo = DBDIH;
   nf->nodeId = cownNodeId;
@@ -6305,7 +6305,7 @@ Dbdih::sendMASTER_LCPCONF(Signal * signa
     c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__);
 #if 0
     if(c_copyGCISlave.m_copyReason == CopyGCIReq::LOCAL_CHECKPOINT){
-      g_eventLogger.info("Dbdih: Also resetting c_copyGCISlave");
+      g_eventLogger->info("Dbdih: Also resetting c_copyGCISlave");
       c_copyGCISlave.m_copyReason = CopyGCIReq::IDLE;
       c_copyGCISlave.m_expectedNextWord = 0;
     }
@@ -6390,7 +6390,7 @@ Dbdih::sendMASTER_LCPCONF(Signal * signa
 
   if(c_lcpState.lcpStatus == LCP_TAB_SAVED){
 #ifdef VM_TRACE
-    g_eventLogger.info("Sending extra GSN_LCP_COMPLETE_REP to new master");    
+    g_eventLogger->info("Sending extra GSN_LCP_COMPLETE_REP to new master");    
 #endif
     sendLCP_COMPLETE_REP(signal);
   }
@@ -6557,7 +6557,7 @@ void Dbdih::execMASTER_LCPCONF(Signal* s
   CRASH_INSERTION(7180);
   
 #ifdef VM_TRACE
-  g_eventLogger.info("MASTER_LCPCONF");
+  g_eventLogger->info("MASTER_LCPCONF");
   printMASTER_LCP_CONF(stdout, &signal->theData[0], 0, 0);
 #endif  
 
@@ -6634,7 +6634,7 @@ void Dbdih::MASTER_LCPhandling(Signal* s
     // protocol.
     /* --------------------------------------------------------------------- */
 #ifdef VM_TRACE
-    g_eventLogger.info("MASTER_LCPhandling:: LMTOS_ALL_IDLE -> checkLcpStart");
+    g_eventLogger->info("MASTER_LCPhandling:: LMTOS_ALL_IDLE -> checkLcpStart");
 #endif
     checkLcpStart(signal, __LINE__);
     break;
@@ -6645,7 +6645,7 @@ void Dbdih::MASTER_LCPhandling(Signal* s
     // protocol by calculating the keep gci and storing the new lcp id.
     /* --------------------------------------------------------------------- */
 #ifdef VM_TRACE
-    g_eventLogger.info("MASTER_LCPhandling:: LMTOS_COPY_ONGOING -> storeNewLcpId");
+    g_eventLogger->info("MASTER_LCPhandling:: LMTOS_COPY_ONGOING -> storeNewLcpId");
 #endif
     if (c_lcpState.lcpStatus == LCP_STATUS_ACTIVE) {
       jam();
@@ -6656,7 +6656,7 @@ void Dbdih::MASTER_LCPhandling(Signal* s
       /*---------------------------------------------------------------------*/
       Uint32 lcpId = SYSFILE->latestLCP_ID;
 #ifdef VM_TRACE
-      g_eventLogger.info("Decreasing latestLCP_ID from %d to %d", lcpId, lcpId - 1);
+      g_eventLogger->info("Decreasing latestLCP_ID from %d to %d", lcpId, lcpId - 1);
 #endif
       SYSFILE->latestLCP_ID--;
     }//if
@@ -6673,10 +6673,10 @@ void Dbdih::MASTER_LCPhandling(Signal* s
        * complete before finalising the LCP process.
        * ------------------------------------------------------------------ */
 #ifdef VM_TRACE
-      g_eventLogger.info("MASTER_LCPhandling:: LMTOS_ALL_ACTIVE -> "
-                         "startLcpRoundLoopLab(table=%u, fragment=%u)",
-                         c_lcpMasterTakeOverState.minTableId, 
-                         c_lcpMasterTakeOverState.minFragId);
+      g_eventLogger->info("MASTER_LCPhandling:: LMTOS_ALL_ACTIVE -> "
+                          "startLcpRoundLoopLab(table=%u, fragment=%u)",
+                          c_lcpMasterTakeOverState.minTableId,
+                          c_lcpMasterTakeOverState.minFragId);
 #endif
     
       c_lcpState.keepGci = SYSFILE->keepGCI;
@@ -8540,7 +8540,7 @@ void Dbdih::GCP_SAVEhandling(Signal* sig
      getNodeState().startLevel == NodeState::SL_STARTED){
     jam();
 #if 0
-    g_eventLogger.info("Dbdih: Clearing initial start ongoing");
+    g_eventLogger->info("Dbdih: Clearing initial start ongoing");
 #endif
     Sysfile::clearInitialStartOngoing(SYSFILE->systemRestartBits);
   }
@@ -8562,7 +8562,7 @@ void Dbdih::execGCP_PREPARE(Signal* sign
   if (ERROR_INSERTED(7030))
   {
     cgckptflag = true;
-    g_eventLogger.info("Delayed GCP_PREPARE 5s");
+    g_eventLogger->info("Delayed GCP_PREPARE 5s");
     sendSignalWithDelay(reference(), GSN_GCP_PREPARE, signal, 5000,
 			signal->getLength());
     return;
@@ -8620,7 +8620,7 @@ void Dbdih::execGCP_PREPARE(Signal* sign
 
   if (ERROR_INSERTED(7031))
   {
-    g_eventLogger.info("Crashing delayed in GCP_PREPARE 3s");
+    g_eventLogger->info("Crashing delayed in GCP_PREPARE 3s");
     signal->theData[0] = 9999;
     sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 3000, 1);
     return;
@@ -9319,7 +9319,7 @@ void Dbdih::initLcpLab(Signal* signal, U
      * This is LCP master takeover
      */
 #ifdef VM_TRACE
-    g_eventLogger.info("initLcpLab aborted due to LCP master takeover - 1");
+    g_eventLogger->info("initLcpLab aborted due to LCP master takeover - 1");
 #endif
     c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__);
     sendMASTER_LCPCONF(signal);
@@ -9332,7 +9332,7 @@ void Dbdih::initLcpLab(Signal* signal, U
      * Master take over but has not yet received MASTER_LCPREQ
      */
 #ifdef VM_TRACE
-    g_eventLogger.info("initLcpLab aborted due to LCP master takeover - 2");
+    g_eventLogger->info("initLcpLab aborted due to LCP master takeover - 2");
 #endif
     return;
   }
@@ -10641,10 +10641,10 @@ void Dbdih::checkTcCounterLab(Signal* si
 {
   CRASH_INSERTION(7009);
   if (c_lcpState.lcpStatus != LCP_STATUS_IDLE) {
-    g_eventLogger.error("lcpStatus = %u"
-                        "lcpStatusUpdatedPlace = %d",
-                        (Uint32) c_lcpState.lcpStatus,
-                        c_lcpState.lcpStatusUpdatedPlace);
+    g_eventLogger->error("lcpStatus = %u"
+                         "lcpStatusUpdatedPlace = %d",
+                         (Uint32) c_lcpState.lcpStatus,
+                         c_lcpState.lcpStatusUpdatedPlace);
     ndbrequire(false);
     return;
   }//if
@@ -11237,8 +11237,8 @@ void Dbdih::execLCP_FRAG_REP(Signal* sig
 
     if(tabPtr.p->tabStatus == TabRecord::TS_DROPPING){
       jam();
-      g_eventLogger.info("TS_DROPPING - Neglecting to save Table: %d Frag: %d - ",
-                         tableId, fragId);
+      g_eventLogger->info("TS_DROPPING - Neglecting to save Table: %d Frag: %d - ",
+                          tableId, fragId);
     } else {
       jam();
       /**
@@ -11375,7 +11375,7 @@ void Dbdih::findReplica(ReplicaRecordPtr
   };
 
 #ifdef VM_TRACE
-  g_eventLogger.info("Fragment Replica(node=%d) not found", nodeId);
+  g_eventLogger->info("Fragment Replica(node=%d) not found", nodeId);
   replicaPtr.i = fragPtrP->oldStoredReplicas;
   while(replicaPtr.i != RNIL){
     ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
@@ -11388,9 +11388,9 @@ void Dbdih::findReplica(ReplicaRecordPtr
     }//if
   };
   if(replicaPtr.i != RNIL){
-    g_eventLogger.info("...But was found in oldStoredReplicas");
+    g_eventLogger->info("...But was found in oldStoredReplicas");
   } else {
-    g_eventLogger.info("...And wasn't found in oldStoredReplicas");
+    g_eventLogger->info("...And wasn't found in oldStoredReplicas");
   }
 #endif
   ndbrequire(false);
@@ -11455,8 +11455,8 @@ Dbdih::reportLcpCompletion(const LcpFrag
   if(lcpNo != replicaPtr.p->nextLcp){
     if (handle_invalid_lcp_no(lcpReport, replicaPtr))
     {
-      g_eventLogger.error("lcpNo = %d replicaPtr.p->nextLcp = %d",
-                          lcpNo, replicaPtr.p->nextLcp);
+      g_eventLogger->error("lcpNo = %d replicaPtr.p->nextLcp = %d",
+                           lcpNo, replicaPtr.p->nextLcp);
       ndbrequire(false);
     }
   }
@@ -11492,7 +11492,7 @@ Dbdih::reportLcpCompletion(const LcpFrag
       // Not all fragments in table have been checkpointed.
       /* ----------------------------------------------------------------- */
       if(0)
-	g_eventLogger.info("reportLcpCompletion: fragment %d not ready", fid);
+        g_eventLogger->info("reportLcpCompletion: fragment %d not ready", fid);
       return false;
     }//if
   }//for
@@ -11627,7 +11627,7 @@ void Dbdih::execLCP_COMPLETE_REP(Signal*
   CRASH_INSERTION(7191);
 
 #if 0
-  g_eventLogger.info("LCP_COMPLETE_REP"); 
+  g_eventLogger->info("LCP_COMPLETE_REP"); 
   printLCP_COMPLETE_REP(stdout, 
 			signal->getDataPtr(),
 			signal->length(), number());
@@ -11713,7 +11713,7 @@ void Dbdih::allNodesLcpCompletedLab(Sign
   if(c_lcpMasterTakeOverState.state != LMTOS_IDLE){
     jam();
 #ifdef VM_TRACE
-    g_eventLogger.info("Exiting from allNodesLcpCompletedLab");
+    g_eventLogger->info("Exiting from allNodesLcpCompletedLab");
 #endif
     return;
   }
@@ -14446,9 +14446,9 @@ void Dbdih::setLcpActiveStatusEnd()
       nodePtr.i = getOwnNodeId();
       ptrAss(nodePtr, nodeRecord);
       ndbrequire(nodePtr.p->activeStatus == Sysfile::NS_Active);
-      g_eventLogger.info("NR: setLcpActiveStatusEnd - m_participatingLQH");
+      g_eventLogger->info("NR: setLcpActiveStatusEnd - m_participatingLQH");
     } else {
-      g_eventLogger.info("NR: setLcpActiveStatusEnd - !m_participatingLQH");
+      g_eventLogger->info("NR: setLcpActiveStatusEnd - !m_participatingLQH");
     }
   }
   
@@ -15228,9 +15228,9 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal
     warningEvent("gsn: %d block: %s, length: %d theData: %s", 
 		 gsn, getBlockName(block, "UNKNOWN"), length, buf);
 
-    g_eventLogger.warning("-- SENDING CUSTOM SIGNAL --");
-    g_eventLogger.warning("gsn: %d block: %s, length: %d theData: %s", 
-			  gsn, getBlockName(block, "UNKNOWN"), length, buf);
+    g_eventLogger->warning("-- SENDING CUSTOM SIGNAL --");
+    g_eventLogger->warning("gsn: %d block: %s, length: %d theData: %s", 
+                           gsn, getBlockName(block, "UNKNOWN"), length, buf);
   }
   
   if(arg == DumpStateOrd::DihDumpLCPState){
@@ -15291,8 +15291,8 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal
   }
 
   if(arg == DumpStateOrd::EnableUndoDelayDataWrite){
-    g_eventLogger.info("Dbdih:: delay write of datapages for table = %d", 
-                       dumpState->args[1]);
+    g_eventLogger->info("Dbdih:: delay write of datapages for table = %d", 
+                        dumpState->args[1]);
     // Send this dump to ACC and TUP
     EXECUTE_DIRECT(DBACC, GSN_DUMP_STATE_ORD, signal, 2);
     EXECUTE_DIRECT(DBTUP, GSN_DUMP_STATE_ORD, signal, 2);
@@ -15309,13 +15309,13 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal
   }//if
   if (signal->theData[0] == DumpStateOrd::DihMinTimeBetweenLCP) {
     // Set time between LCP to min value
-    g_eventLogger.info("Set time between LCP to min value");
+    g_eventLogger->info("Set time between LCP to min value");
     c_lcpState.clcpDelay = 0; // TimeBetweenLocalCheckpoints.min
     return;
   }
   if (signal->theData[0] == DumpStateOrd::DihMaxTimeBetweenLCP) {
     // Set time between LCP to max value
-    g_eventLogger.info("Set time between LCP to max value");
+    g_eventLogger->info("Set time between LCP to max value");
     c_lcpState.clcpDelay = 31; // TimeBetweenLocalCheckpoints.max
     return;
   }
@@ -15353,7 +15353,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal
       tmp = signal->theData[1];
     }
     m_gcp_save.m_master.m_time_between_gcp = tmp;
-    g_eventLogger.info("Setting time between gcp : %d", tmp);
+    g_eventLogger->info("Setting time between gcp : %d", tmp);
   }
 
   if (arg == 7021 && signal->getLength() == 2)
@@ -15487,7 +15487,7 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* sig
 	while(index < count){
 	  if(nodePtr.p->queuedChkpt[index].tableId == tabPtr.i){
 	    jam();
-	    //	    g_eventLogger.info("Unqueuing %d", index);
+	    //	    g_eventLogger->info("Unqueuing %d", index);
 	    
 	    count--;
 	    for(Uint32 i = index; i<count; i++){
@@ -15527,7 +15527,7 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* sig
       if(checkLcpAllTablesDoneInLqh()){
 	jam();
 	
-	g_eventLogger.info("This is the last table");
+        g_eventLogger->info("This is the last table");
 	
 	/**
 	 * Then check if saving of tab info is done for all tables
@@ -15535,9 +15535,9 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* sig
 	LcpStatus a = c_lcpState.lcpStatus;
 	checkLcpCompletedLab(signal);
 	
-	if(a != c_lcpState.lcpStatus){
-	  g_eventLogger.info("And all tables are written to already written disk");
-	}
+        if(a != c_lcpState.lcpStatus){
+          g_eventLogger->info("And all tables are written to already written disk");
+        }
       }
       break;
     }
diff -Nrup a/storage/ndb/src/kernel/blocks/lgman.cpp b/storage/ndb/src/kernel/blocks/lgman.cpp
--- a/storage/ndb/src/kernel/blocks/lgman.cpp	2008-02-08 06:18:57 -08:00
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp	2008-04-22 12:36:00 -07:00
@@ -30,7 +30,7 @@
 #include "dbtup/Dbtup.hpp"
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 #include <record_types.hpp>
 
@@ -2434,9 +2434,9 @@ Lgman::find_log_head_in_file(Signal* sig
     infoEvent("Undo head - %s page: %d lsn: %lld",
 	      fs->get_filename(file_ptr.p->m_fd), 
 	      tail, file_ptr.p->m_online.m_lsn);
-    g_eventLogger.info("Undo head - %s page: %d lsn: %lld",
-		       fs->get_filename(file_ptr.p->m_fd), 
-		       tail, file_ptr.p->m_online.m_lsn);
+    g_eventLogger->info("Undo head - %s page: %d lsn: %lld",
+                        fs->get_filename(file_ptr.p->m_fd),
+                        tail, file_ptr.p->m_online.m_lsn);
     
     for(files.prev(file_ptr); !file_ptr.isNull(); files.prev(file_ptr))
     {
@@ -2444,9 +2444,9 @@ Lgman::find_log_head_in_file(Signal* sig
 		fs->get_filename(file_ptr.p->m_fd), 
 		file_ptr.p->m_online.m_lsn);
 
-      g_eventLogger.info("   - next - %s(%lld)", 
-			 fs->get_filename(file_ptr.p->m_fd), 
-			 file_ptr.p->m_online.m_lsn);
+      g_eventLogger->info("   - next - %s(%lld)", 
+                          fs->get_filename(file_ptr.p->m_fd),
+                          file_ptr.p->m_online.m_lsn);
     }
   }
   
@@ -3001,17 +3001,17 @@ Lgman::stop_run_undo_log(Signal* signal)
 	m_file_pool.getPtr(tf, tail.m_ptr_i);
 	m_file_pool.getPtr(hf,  ptr.p->m_file_pos[HEAD].m_ptr_i);
 	infoEvent("Logfile group: %d ", ptr.p->m_logfile_group_id);
-	g_eventLogger.info("Logfile group: %d ", ptr.p->m_logfile_group_id);
+        g_eventLogger->info("Logfile group: %d ", ptr.p->m_logfile_group_id);
 	infoEvent("  head: %s page: %d",
-		  fs->get_filename(hf.p->m_fd), 
-		  ptr.p->m_file_pos[HEAD].m_idx);
-	g_eventLogger.info("  head: %s page: %d",
-			   fs->get_filename(hf.p->m_fd), 
-			   ptr.p->m_file_pos[HEAD].m_idx);
+                  fs->get_filename(hf.p->m_fd),
+                  ptr.p->m_file_pos[HEAD].m_idx);
+        g_eventLogger->info("  head: %s page: %d",
+                            fs->get_filename(hf.p->m_fd),
+                            ptr.p->m_file_pos[HEAD].m_idx);
 	infoEvent("  tail: %s page: %d",
 		  fs->get_filename(tf.p->m_fd), tail.m_idx);
-	g_eventLogger.info("  tail: %s page: %d",
-			   fs->get_filename(tf.p->m_fd), tail.m_idx);
+        g_eventLogger->info("  tail: %s page: %d",
+                            fs->get_filename(tf.p->m_fd), tail.m_idx);
       }
     }
     
@@ -3033,7 +3033,7 @@ Lgman::stop_run_undo_log(Signal* signal)
   }
   
   infoEvent("Flushing page cache after undo completion");
-  g_eventLogger.info("Flushing page cache after undo completion");
+  g_eventLogger->info("Flushing page cache after undo completion");
 
   /**
    * Start flushing pages (local, LCP)
@@ -3098,7 +3098,7 @@ Lgman::execEND_LCP_CONF(Signal* signal)
     ptr.p->m_last_synced_lsn = last_lsn;
   
   infoEvent("Flushing complete");
-  g_eventLogger.info("Flushing complete");
+  g_eventLogger->info("Flushing complete");
 
   signal->theData[0] = reference();
   sendSignal(DBLQH_REF, GSN_START_RECCONF, signal, 1, JBB);
diff -Nrup a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2008-02-20 12:59:20 -08:00
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2008-04-22 12:36:01 -07:00
@@ -53,7 +53,7 @@
 #include <../dbdih/Dbdih.hpp>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 //#define HANDOVER_DEBUG
 //#define NODEFAIL_DEBUG
@@ -2636,8 +2636,8 @@ Suma::report_sub_start_conf(Signal* sign
       else
       {
         jam();
-        g_eventLogger.warning("Node %u failed in report_sub_start_conf",
-                              nodeId);
+        g_eventLogger->warning("Node %u failed in report_sub_start_conf",
+                               nodeId);
         sendSubStartRef(signal,
                         senderRef, senderData, SubStartRef::NodeDied);
 
@@ -3754,8 +3754,8 @@ Suma::execSUB_GCP_COMPLETE_REP(Signal* s
     {
       char buf[100];
       c_subscriber_nodes.getText(buf);
-      g_eventLogger.error("c_gcp_list.seize() failed: gci: %d nodes: %s",
-                          gci, buf);
+      g_eventLogger->error("c_gcp_list.seize() failed: gci: %d nodes: %s",
+                           gci, buf);
     }
   }
   
@@ -4009,9 +4009,9 @@ Suma::execSUB_GCP_COMPLETE_ACK(Signal* s
   
   if(gcp.isNull())
   {
-    g_eventLogger.warning("ACK wo/ gcp record (gci: %u/%u) ref: %.8x from: %.8x",
-                          Uint32(gci >> 32), Uint32(gci),
-                          senderRef, signal->getSendersBlockRef());
+    g_eventLogger->warning("ACK wo/ gcp record (gci: %u/%u) ref: %.8x from: %.8x",
+                           Uint32(gci >> 32), Uint32(gci),
+                           senderRef, signal->getSendersBlockRef());
   }
   else
   {
diff -Nrup a/storage/ndb/src/kernel/error/ErrorReporter.cpp b/storage/ndb/src/kernel/error/ErrorReporter.cpp
--- a/storage/ndb/src/kernel/error/ErrorReporter.cpp	2007-02-05 07:44:42 -08:00
+++ b/storage/ndb/src/kernel/error/ErrorReporter.cpp	2008-04-22 12:36:01 -07:00
@@ -40,7 +40,7 @@ static void dumpJam(FILE* jamStream, 
 		    Uint32 thrdTheEmulatedJamIndex, 
 		    Uint8 thrdTheEmulatedJam[]);
 
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 const char*
 ErrorReporter::formatTimeStampString(){
   TimeModule DateTime;          /* To create "theDateTimeString" */
@@ -197,8 +197,8 @@ ErrorReporter::handleError(int messageID
   WriteMessage(messageID, problemData,
 	       objRef, theEmulatedJamIndex, theEmulatedJam);
 
-  g_eventLogger.info(problemData);
-  g_eventLogger.info(objRef);
+  g_eventLogger->info(problemData);
+  g_eventLogger->info(objRef);
 
   childReportError(messageID);
 
diff -Nrup a/storage/ndb/src/kernel/main.cpp b/storage/ndb/src/kernel/main.cpp
--- a/storage/ndb/src/kernel/main.cpp	2007-01-05 16:21:21 -08:00
+++ b/storage/ndb/src/kernel/main.cpp	2008-04-22 12:36:00 -07:00
@@ -44,7 +44,7 @@
 #include <sys/processor.h> // For system informatio
 #endif
 
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 extern NdbMutex * theShutdownMutex;
 
 void catchsigs(bool ignore); // for process signal handling
@@ -180,8 +180,8 @@ int reportShutdown(class Configuration *
 
   { // Log event
     const EventReport * const eventReport = (EventReport *)&theData[0];
-    g_eventLogger.log(eventReport->getEventType(), theData, length,
-		      eventReport->getNodeId(), 0);
+    g_eventLogger->log(eventReport->getEventType(), theData, length,
+                       eventReport->getNodeId(), 0);
   }
 
   for (unsigned n = 0; n < config->m_mgmds.size(); n++)
@@ -208,13 +208,13 @@ handle_error:
       BaseString tmp(ndb_mgm_get_latest_error_msg(h));
       tmp.append(" : ");
       tmp.append(ndb_mgm_get_latest_error_desc(h));
-      g_eventLogger.warning("Unable to report shutdown reason to %s: %s",
-			    config->m_mgmds[n].c_str(), tmp.c_str());
+      g_eventLogger->warning("Unable to report shutdown reason to %s: %s",
+                             config->m_mgmds[n].c_str(), tmp.c_str());
     }
     else
     {
-      g_eventLogger.error("Unable to report shutdown reason to %s",
-			  config->m_mgmds[n].c_str());
+      g_eventLogger->error("Unable to report shutdown reason to %s",
+                           config->m_mgmds[n].c_str());
     }
 do_next:
     if (h)
@@ -230,14 +230,14 @@ int main(int argc, char** argv)
 {
   NDB_INIT(argv[0]);
   // Print to stdout/console
-  g_eventLogger.createConsoleHandler();
-  g_eventLogger.setCategory("ndbd");
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_INFO);
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL);
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING);
+  g_eventLogger->createConsoleHandler();
+  g_eventLogger->setCategory("ndbd");
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_INFO);
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_CRITICAL);
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_ERROR);
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_WARNING);
 
-  g_eventLogger.m_logLevel.setLogLevel(LogLevel::llStartUp, 15);
+  g_eventLogger->m_logLevel.setLogLevel(LogLevel::llStartUp, 15);
 
   globalEmulatorData.create();
 
@@ -278,21 +278,21 @@ int main(int argc, char** argv)
     int filedes[2];
     if (pipe(filedes))
     {
-      g_eventLogger.error("pipe() failed with errno=%d (%s)",
-			  errno, strerror(errno));
+      g_eventLogger->error("pipe() failed with errno=%d (%s)",
+                           errno, strerror(errno));
       return 1;
     }
     else
     {
       if (!(child_info_file_w= fdopen(filedes[1],"w")))
       {
-	g_eventLogger.error("fdopen() failed with errno=%d (%s)",
-			    errno, strerror(errno));
+        g_eventLogger->error("fdopen() failed with errno=%d (%s)",
+                             errno, strerror(errno));
       }
       if (!(child_info_file_r= fdopen(filedes[0],"r")))
       {
-	g_eventLogger.error("fdopen() failed with errno=%d (%s)",
-			    errno, strerror(errno));
+        g_eventLogger->error("fdopen() failed with errno=%d (%s)",
+                             errno, strerror(errno));
       }
     }
 
@@ -319,7 +319,7 @@ int main(int argc, char** argv)
     if(WIFEXITED(status)){
       switch(WEXITSTATUS(status)){
       case NRT_Default:
-	g_eventLogger.info("Angel shutting down");
+        g_eventLogger->info("Angel shutting down");
 	reportShutdown(theConfig, 0, 0);
 	exit(0);
 	break;
@@ -360,7 +360,7 @@ int main(int argc, char** argv)
       else
       {
 	signum = 127;
-	g_eventLogger.info("Unknown exit reason. Stopped.");
+        g_eventLogger->info("Unknown exit reason. Stopped.");
       }
       if(theConfig->stopOnError()){
 	/**
@@ -381,25 +381,25 @@ int main(int argc, char** argv)
       /**
        * Error shutdown && stopOnError()
        */
-      g_eventLogger.alert("Ndbd has failed %u consecutive startups. "
-			  "Not restarting", failed_startups);
+      g_eventLogger->alert("Ndbd has failed %u consecutive startups. "
+                           "Not restarting", failed_startups);
       reportShutdown(theConfig, error_exit, 0);
       exit(0);
     }
     failed_startup_flag = false;
     reportShutdown(theConfig, error_exit, 1);
-    g_eventLogger.info("Ndb has terminated (pid %d) restarting", child);
+    g_eventLogger->info("Ndb has terminated (pid %d) restarting", child);
     theConfig->fetch_configuration();
   }
 
   if (child >= 0)
-    g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
+    g_eventLogger->info("Angel pid: %d ndb pid: %d", getppid(), getpid());
   else if (child > 0)
-    g_eventLogger.info("Ndb pid: %d", getpid());
+    g_eventLogger->info("Ndb pid: %d", getpid());
   else
-    g_eventLogger.info("Ndb started in foreground");
+    g_eventLogger->info("Ndb started in foreground");
 #else
-  g_eventLogger.info("Ndb started");
+  g_eventLogger->info("Ndb started");
 #endif
   theConfig->setupConfiguration();
   systemInfo(* theConfig, * theConfig->m_logLevel); 
@@ -511,19 +511,19 @@ systemInfo(const Configuration & config,
 #endif
   
   if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){
-    g_eventLogger.info("NDB Cluster -- DB node %d", globalData.ownId);
-    g_eventLogger.info("%s --", NDB_VERSION_STRING);
+    g_eventLogger->info("NDB Cluster -- DB node %d", globalData.ownId);
+    g_eventLogger->info("%s --", NDB_VERSION_STRING);
     if (config.get_mgmd_host())
-      g_eventLogger.info("Configuration fetched at %s port %d",
-			 config.get_mgmd_host(), config.get_mgmd_port());
+      g_eventLogger->info("Configuration fetched at %s port %d",
+                          config.get_mgmd_host(), config.get_mgmd_port());
 #ifdef NDB_SOLARIS // ok
-    g_eventLogger.info("NDB is running on a machine with %d processor(s) at %d MHz",
-		       processor, speed);
+    g_eventLogger->info("NDB is running on a machine with %d processor(s) at %d MHz",
+                        processor, speed);
 #endif
   }
   if(logLevel.getLogLevel(LogLevel::llStartUp) > 3){
     Uint32 t = config.timeBetweenWatchDogCheck();
-    g_eventLogger.info("WatchDog timer is set to %d ms", t);
+    g_eventLogger->info("WatchDog timer is set to %d ms", t);
   }
 
 }
@@ -601,7 +601,7 @@ catchsigs(bool ignore){
 extern "C"
 void 
 handler_shutdown(int signum){
-  g_eventLogger.info("Received signal %d. Performing stop.", signum);
+  g_eventLogger->info("Received signal %d. Performing stop.", signum);
   childReportError(0);
   childReportSignal(signum);
   globalData.theRestartFlag = perform_stop;
@@ -627,7 +627,7 @@ handler_error(int signum){
     while(true)
       NdbSleep_MilliSleep(10);
   thread_id= my_thread_id();
-  g_eventLogger.info("Received signal %d. Running error handler.", signum);
+  g_eventLogger->info("Received signal %d. Running error handler.", signum);
   childReportSignal(signum);
   // restart the system
   char errorData[64], *info= 0;
@@ -648,5 +648,5 @@ handler_sigusr1(int signum)
     failed_startups++;
     failed_startup_flag = true;
   }
-  g_eventLogger.info("Angel received ndbd startup failure count %u.", failed_startups);
+  g_eventLogger->info("Angel received ndbd startup failure count %u.", failed_startups);
 }
diff -Nrup a/storage/ndb/src/kernel/vm/Configuration.cpp b/storage/ndb/src/kernel/vm/Configuration.cpp
--- a/storage/ndb/src/kernel/vm/Configuration.cpp	2007-07-02 09:26:39 -07:00
+++ b/storage/ndb/src/kernel/vm/Configuration.cpp	2008-04-22 12:36:01 -07:00
@@ -43,7 +43,7 @@ extern "C" {
 }
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 enum ndbd_options {
   OPT_INITIAL = NDB_STD_OPTIONS_LAST,
diff -Nrup a/storage/ndb/src/kernel/vm/Emulator.cpp b/storage/ndb/src/kernel/vm/Emulator.cpp
--- a/storage/ndb/src/kernel/vm/Emulator.cpp	2006-12-23 11:20:19 -08:00
+++ b/storage/ndb/src/kernel/vm/Emulator.cpp	2008-04-22 12:36:01 -07:00
@@ -41,7 +41,7 @@ void childAbort(int code, Uint32 current
 extern "C" {
   extern void (* ndb_new_handler)();
 }
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 extern my_bool opt_core;
 // instantiated and updated in NdbcntrMain.cpp
 extern Uint32 g_currentStartPhase;
@@ -155,26 +155,26 @@ NdbShutdown(NdbShutdownType type,
     
     switch(type){
     case NST_Normal:
-      g_eventLogger.info("Shutdown initiated");
+      g_eventLogger->info("Shutdown initiated");
       break;
     case NST_Watchdog:
-      g_eventLogger.info("Watchdog %s system", shutting);
+      g_eventLogger->info("Watchdog %s system", shutting);
       break;
     case NST_ErrorHandler:
-      g_eventLogger.info("Error handler %s system", shutting);
+      g_eventLogger->info("Error handler %s system", shutting);
       break;
     case NST_ErrorHandlerSignal:
-      g_eventLogger.info("Error handler signal %s system", shutting);
+      g_eventLogger->info("Error handler signal %s system", shutting);
       break;
     case NST_ErrorHandlerStartup:
-      g_eventLogger.info("Error handler startup %s system", shutting);
+      g_eventLogger->info("Error handler startup %s system", shutting);
       break;
     case NST_Restart:
-      g_eventLogger.info("Restarting system");
+      g_eventLogger->info("Restarting system");
       break;
     default:
-      g_eventLogger.info("Error handler %s system (unknown type: %u)",
-			 shutting, (unsigned)type);
+      g_eventLogger->info("Error handler %s system (unknown type: %u)",
+                          shutting, (unsigned)type);
       type = NST_ErrorHandler;
       break;
     }
@@ -189,7 +189,7 @@ NdbShutdown(NdbShutdownType type,
       /**
        * Very serious, don't attempt to free, just die!!
        */
-      g_eventLogger.info("Watchdog shutdown completed - %s", exitAbort);
+      g_eventLogger->info("Watchdog shutdown completed - %s", exitAbort);
       if (opt_core)
       {
 	childAbort(-1,g_currentStartPhase);
@@ -248,7 +248,7 @@ NdbShutdown(NdbShutdownType type,
       // Signal parent that error occured during startup
       if (type == NST_ErrorHandlerStartup)
 	kill(getppid(), SIGUSR1);
-      g_eventLogger.info("Error handler shutdown completed - %s", exitAbort);
+      g_eventLogger->info("Error handler shutdown completed - %s", exitAbort);
       if (opt_core)
       {
 	childAbort(-1,g_currentStartPhase);
@@ -266,7 +266,7 @@ NdbShutdown(NdbShutdownType type,
       childExit(restartType,g_currentStartPhase);
     }
     
-    g_eventLogger.info("Shutdown completed - exiting");
+    g_eventLogger->info("Shutdown completed - exiting");
   } else {
     /**
      * Shutdown is already in progress
@@ -276,7 +276,7 @@ NdbShutdown(NdbShutdownType type,
      * If this is the watchdog, kill system the hard way
      */
     if (type== NST_Watchdog){
-      g_eventLogger.info("Watchdog is killing system the hard way");
+      g_eventLogger->info("Watchdog is killing system the hard way");
 #if defined VM_TRACE
       childAbort(-1,g_currentStartPhase);
 #else
diff -Nrup a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2008-02-20 01:04:24 -08:00
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2008-04-22 12:36:02 -07:00
@@ -40,7 +40,7 @@
 #include <NdbSqlUtil.hpp>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 #define ljamEntry() jamEntryLine(30000 + __LINE__)
 #define ljam() jamLine(30000 + __LINE__)
@@ -710,9 +710,9 @@ SimulatedBlock::allocRecordAligned(const
       *unaligned_buffer = p;
       p = (void *)(((UintPtr)p + over_alloc) & ~(UintPtr)(over_alloc));
 #ifdef VM_TRACE
-      g_eventLogger.info("'%s' (%u) %llu %llu, alignment correction %u bytes",
-                         type, align, (Uint64)p, (Uint64)p+n*s,
-                         (Uint32)((UintPtr)p - (UintPtr)*unaligned_buffer));
+      g_eventLogger->info("'%s' (%u) %llu %llu, alignment correction %u bytes",
+                          type, align, (Uint64)p, (Uint64)p+n*s,
+                          (Uint32)((UintPtr)p - (UintPtr)*unaligned_buffer));
 #endif
     }
   }
diff -Nrup a/storage/ndb/src/kernel/vm/WatchDog.cpp b/storage/ndb/src/kernel/vm/WatchDog.cpp
--- a/storage/ndb/src/kernel/vm/WatchDog.cpp	2007-06-08 22:25:44 -07:00
+++ b/storage/ndb/src/kernel/vm/WatchDog.cpp	2008-04-22 12:36:02 -07:00
@@ -27,7 +27,7 @@
 
 #include <NdbTick.h>
 
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 extern "C" 
 void* 
@@ -136,12 +136,12 @@ WatchDog::run()
     {
       struct tms my_tms;
       times(&my_tms);
-      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.",
-                            NdbTick_getMicrosPassed(last_time, now)/1000,
-                            sleep_time);
+      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.",
+                             NdbTick_getMicrosPassed(last_time, now)/1000,
+                             sleep_time);
     }
     last_time = now;
 
@@ -171,13 +171,13 @@ WatchDog::run()
       if (warn)
       {
         const char *last_stuck_action = get_action(oldIPValue);
-        g_eventLogger.warning("Ndb kernel is stuck in: %s", last_stuck_action);
+        g_eventLogger->warning("Ndb kernel is stuck in: %s", last_stuck_action);
         {
           struct tms my_tms;
           times(&my_tms);
-          g_eventLogger.info("Watchdog: User time: %llu  System time: %llu",
-                             (Uint64)my_tms.tms_utime,
-                             (Uint64)my_tms.tms_stime);
+          g_eventLogger->info("Watchdog: User time: %llu  System time: %llu",
+                              (Uint64)my_tms.tms_utime,
+                              (Uint64)my_tms.tms_stime);
         }
         if (elapsed > 3 * theInterval)
         {
diff -Nrup a/storage/ndb/src/kernel/vm/bench_pool.cpp b/storage/ndb/src/kernel/vm/bench_pool.cpp
--- a/storage/ndb/src/kernel/vm/bench_pool.cpp	2006-12-23 11:33:30 -08:00
+++ b/storage/ndb/src/kernel/vm/bench_pool.cpp	2008-04-22 12:36:02 -07:00
@@ -416,7 +416,7 @@ void test_wo(Uint32 cnt, Uint32 loop)
 }
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 int
 main(int argc, char **argv)
diff -Nrup a/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp b/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp
--- a/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp	2008-02-08 06:21:05 -08:00
+++ b/storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp	2008-04-22 12:36:02 -07:00
@@ -19,11 +19,7 @@
 #include <ndb_global.h>
 #include <EventLogger.hpp>
 
-#ifndef UNIT_TEST
-extern EventLogger g_eventLogger;
-#else
-extern EventLogger g_eventLogger;
-#endif
+extern EventLogger * g_eventLogger;
 
 static int f_method_idx = 0;
 #ifdef NDBD_MALLOC_METHOD_SBRK
@@ -174,7 +170,7 @@ Ndbd_mem_manager::Ndbd_mem_manager()
   
   if (sizeof(Free_page_data) != (4 * (1 << FPD_2LOG)))
   {
-    g_eventLogger.error("Invalid build, ndbd_malloc_impl.cpp:%d", __LINE__);
+    g_eventLogger->error("Invalid build, ndbd_malloc_impl.cpp:%d", __LINE__);
     abort();
   }
 }
@@ -266,11 +262,11 @@ Ndbd_mem_manager::init(bool alloc_less_m
     m_resource_limit[0].m_min = pages;
   }
   
-  g_eventLogger.info("Ndbd_mem_manager::init(%d) min: %dMb initial: %dMb",
-		     alloc_less_memory,
-		     (sizeof(Alloc_page)*m_resource_limit[0].m_min)>>20,
-		     (sizeof(Alloc_page)*pages)>>20);
-  
+  g_eventLogger->info("Ndbd_mem_manager::init(%d) min: %dMb initial: %dMb",
+                      alloc_less_memory,
+                      (sizeof(Alloc_page)*m_resource_limit[0].m_min)>>20,
+                      (sizeof(Alloc_page)*pages)>>20);
+
   if (pages == 0)
   {
     return 0;
@@ -318,21 +314,21 @@ Ndbd_mem_manager::init(bool alloc_less_m
   
   if (allocated < m_resource_limit[0].m_min)
   {
-    g_eventLogger.
+    g_eventLogger->
       error("Unable to alloc min memory from OS: min: %lldMb "
-	    " allocated: %lldMb", 
-	    (Uint64)(sizeof(Alloc_page)*m_resource_limit[0].m_min) >> 20,
-	    (Uint64)(sizeof(Alloc_page)*allocated) >> 20);
+            " allocated: %lldMb",
+            (Uint64)(sizeof(Alloc_page)*m_resource_limit[0].m_min) >> 20,
+            (Uint64)(sizeof(Alloc_page)*allocated) >> 20);
     return false;
   }
   else if (allocated < pages)
   {
-    g_eventLogger.
+    g_eventLogger->
       warning("Unable to alloc requested memory from OS: min: %lldMb"
-	      " requested: %lldMb allocated: %lldMb",
-	      (Uint64)(sizeof(Alloc_page)*m_resource_limit[0].m_min)>>20,
-	      (Uint64)(sizeof(Alloc_page)*m_resource_limit[0].m_max)>>20,
-	      (Uint64)(sizeof(Alloc_page)*allocated)>>20);
+              " requested: %lldMb allocated: %lldMb",
+              (Uint64)(sizeof(Alloc_page)*m_resource_limit[0].m_min)>>20,
+              (Uint64)(sizeof(Alloc_page)*m_resource_limit[0].m_max)>>20,
+              (Uint64)(sizeof(Alloc_page)*allocated)>>20);
     if (!alloc_less_memory)
       return false;
   }
@@ -402,10 +398,10 @@ Ndbd_mem_manager::grow(Uint32 start, Uin
 	     " - Unable to use due to bitmap pages missaligned!!",
 	     __LINE__, start, cnt, start, (start_bmp << BPP_2LOG),
 	     (cnt >> (20 - 15)));
-    g_eventLogger.error("ndbd_malloc_impl.cpp:%d:grow(%d, %d) not using %uMb"
-			" - Unable to use due to bitmap pages missaligned!!",
-			__LINE__, start, cnt,
-			(cnt >> (20 - 15)));
+    g_eventLogger->error("ndbd_malloc_impl.cpp:%d:grow(%d, %d) not using %uMb"
+                         " - Unable to use due to bitmap pages missaligned!!",
+                         __LINE__, start, cnt,
+                         (cnt >> (20 - 15)));
 
     dump();
     return;
@@ -881,12 +877,12 @@ main(int argc, char** argv)
   Timer timer[4];
   printf("Startar modul test av Page Manager %dMb %ds\n", 
 	 (sz >> 5), run_time);
-  g_eventLogger.createConsoleHandler();
-  g_eventLogger.setCategory("keso");
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_INFO);
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_CRITICAL);
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_WARNING);
+  g_eventLogger->createConsoleHandler();
+  g_eventLogger->setCategory("keso");
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_INFO);
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_CRITICAL);
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_ERROR);
+  g_eventLogger->enable(Logger::LL_ON, Logger::LL_WARNING);
   
 #define DEBUG 0
 
diff -Nrup a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp
--- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2008-03-14 06:32:47 -07:00
+++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2008-04-22 12:36:02 -07:00
@@ -102,7 +102,7 @@ MgmtSrvr::logLevelThread_C(void* m)
   return 0;
 }
 
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 #ifdef NOT_USED
 static NdbOut&
@@ -223,7 +223,7 @@ MgmtSrvr::startEventLog() 
 {
   NdbMutex_Lock(m_configMutex);
 
-  g_eventLogger.setCategory("MgmSrvr");
+  g_eventLogger->setCategory("MgmSrvr");
 
   ndb_mgm_configuration_iterator 
     iter(* _config->m_configValues, CFG_SECTION_NODE);
@@ -250,7 +250,7 @@ MgmtSrvr::startEventLog() 
 		   clusterLog);
   }
   errStr[0]='\0';
-  if(!g_eventLogger.addHandler(logdest, &err, sizeof(errStr), errStr)) {
+  if(!g_eventLogger->addHandler(logdest, &err, sizeof(errStr), errStr)) {
     ndbout << "Warning: could not add log destination \""
            << logdest.c_str() << "\". Reason: ";
     if(err)
@@ -266,7 +266,7 @@ MgmtSrvr::startEventLog() 
 void
 MgmtSrvr::stopEventLog()
 {
-  g_eventLogger.close();
+  g_eventLogger->close();
 }
 
 bool
@@ -274,21 +274,21 @@ MgmtSrvr::setEventLogFilter(int severity
 {
   Logger::LoggerLevel level = (Logger::LoggerLevel)severity;
   if (enable > 0) {
-    g_eventLogger.enable(level);
+    g_eventLogger->enable(level);
   } else if (enable == 0) {
-    g_eventLogger.disable(level);
-  } else if (g_eventLogger.isEnable(level)) {
-    g_eventLogger.disable(level);
+    g_eventLogger->disable(level);
+  } else if (g_eventLogger->isEnable(level)) {
+    g_eventLogger->disable(level);
   } else {
-    g_eventLogger.enable(level);
+    g_eventLogger->enable(level);
   }
-  return g_eventLogger.isEnable(level);
+  return g_eventLogger->isEnable(level);
 }
 
 bool 
 MgmtSrvr::isEventLogFilterEnabled(int severity) 
 {
-  return g_eventLogger.isEnable((Logger::LoggerLevel)severity);
+  return g_eventLogger->isEnable((Logger::LoggerLevel)severity);
 }
 
 int MgmtSrvr::translateStopRef(Uint32 errCode)
@@ -693,11 +693,11 @@ int MgmtSrvr::okToSendTo(NodeId nodeId, 
 
 void report_unknown_signal(SimpleSignal *signal)
 {
-  g_eventLogger.error("Unknown signal received. SignalNumber: "
-		      "%i from (%d, %x)",
-		      signal->readSignalNumber(),
-		      refToNode(signal->header.theSendersBlockRef),
-		      refToBlock(signal->header.theSendersBlockRef));
+  g_eventLogger->error("Unknown signal received. SignalNumber: "
+                       "%i from (%d, %x)",
+                       signal->readSignalNumber(),
+                       refToNode(signal->header.theSendersBlockRef),
+                       refToBlock(signal->header.theSendersBlockRef));
 }
 
 /*****************************************************************************
@@ -2012,13 +2012,13 @@ MgmtSrvr::handleReceivedSignal(NdbApiSig
     break;
 
   default:
-    g_eventLogger.error("Unknown signal received. SignalNumber: "
-			"%i from (%d, %x)",
-			gsn,
-			refToNode(signal->theSendersBlockRef),
-			refToBlock(signal->theSendersBlockRef));
+    g_eventLogger->error("Unknown signal received. SignalNumber: "
+                         "%i from (%d, %x)",
+                         gsn,
+                         refToNode(signal->theSendersBlockRef),
+                         refToBlock(signal->theSendersBlockRef));
   }
-  
+
   if (theWaitState == NO_WAIT) {
     NdbCondition_Signal(theMgmtWaitForResponseCondPtr);
   }
@@ -2367,11 +2367,12 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
       ndb_error_string(res, buf, sizeof(buf));
       error_string.appfmt("Cluster refused allocation of id %d. Error: %d (%s).",
 			  save_id_found, res, buf);
-      g_eventLogger.warning("Cluster refused allocation of id %d. "
-                            "Connection from ip %s. "
-                            "Returned error string \"%s\"", save_id_found,
-                            inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr),
-                            error_string.c_str());
+      g_eventLogger->warning("Cluster refused allocation of id %d. "
+                             "Connection from ip %s. "
+                             "Returned error string \"%s\"", save_id_found,
+                             inet_ntoa(((struct sockaddr_in *)
+                                        (client_addr))->sin_addr),
+                             error_string.c_str());
       DBUG_RETURN(false);
     }
   }
@@ -2411,9 +2412,9 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
     
     char tmp_str[128];
     m_reserved_nodes.getText(tmp_str);
-    g_eventLogger.info("Mgmt server state: nodeid %d reserved for ip %s, "
-                       "m_reserved_nodes %s.",
-                       id_found, get_connect_address(id_found), tmp_str);
+    g_eventLogger->info("Mgmt server state: nodeid %d reserved for ip %s, "
+                        "m_reserved_nodes %s.",
+                        id_found, get_connect_address(id_found), tmp_str);
     DBUG_RETURN(true);
   }
 
@@ -2509,14 +2510,14 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
 
   if (log_event || error_code == NDB_MGM_ALLOCID_CONFIG_MISMATCH)
   {
-    g_eventLogger.warning("Allocate nodeid (%d) failed. Connection from ip %s."
-                          " Returned error string \"%s\"",
-                          *nodeId,
-                          client_addr != 0
-                          ? inet_ntoa(((struct sockaddr_in *)
-                                       (client_addr))->sin_addr)
-                          : "<none>",
-                          error_string.c_str());
+    g_eventLogger->warning("Allocate nodeid (%d) failed. Connection from ip %s."
+			   " Returned error string \"%s\"",
+			   *nodeId,
+			   client_addr != 0
+			   ? inet_ntoa(((struct sockaddr_in *)
+					(client_addr))->sin_addr)
+			   : "<none>",
+			   error_string.c_str());
 
     NodeBitmask connected_nodes2;
     get_connected_nodes(connected_nodes2);
@@ -2534,11 +2535,11 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId,
       }
     }
     if (tmp_connected.length() > 0)
-      g_eventLogger.info("Mgmt server state: node id's %s connected but not reserved", 
-			 tmp_connected.c_str());
+      g_eventLogger->info("Mgmt server state: node id's %s connected but not reserved", 
+			  tmp_connected.c_str());
     if (tmp_not_connected.length() > 0)
-      g_eventLogger.info("Mgmt server state: node id's %s not connected but reserved",
-			 tmp_not_connected.c_str());
+      g_eventLogger->info("Mgmt server state: node id's %s not connected but reserved",
+			  tmp_not_connected.c_str());
   }
   DBUG_RETURN(false);
 }
@@ -2570,8 +2571,8 @@ MgmtSrvr::eventReport(const Uint32 * the
   NodeId nodeId = eventReport->getNodeId();
   Ndb_logevent_type type = eventReport->getEventType();
   // Log event
-  g_eventLogger.log(type, theData, len, nodeId, 
-		    &m_event_listner[0].m_logLevel);  
+  g_eventLogger->log(type, theData, len, nodeId, 
+                     &m_event_listner[0].m_logLevel);
   m_event_listner.log(type, theData, len, nodeId);
 }
 
@@ -2769,8 +2770,8 @@ MgmtSrvr::Allocated_resources::~Allocate
 
     char tmp_str[128];
     m_mgmsrv.m_reserved_nodes.getText(tmp_str);
-    g_eventLogger.info("Mgmt server state: nodeid %d freed, m_reserved_nodes %s.",
-		       get_nodeid(), tmp_str);
+    g_eventLogger->info("Mgmt server state: nodeid %d freed, m_reserved_nodes %s.",
+                        get_nodeid(), tmp_str);
   }
 }
 
@@ -2786,8 +2787,8 @@ MgmtSrvr::Allocated_resources::is_timed_
 {
   if (m_alloc_timeout && tick > m_alloc_timeout)
   {
-    g_eventLogger.info("Mgmt server state: nodeid %d timed out.",
-                       get_nodeid());
+    g_eventLogger->info("Mgmt server state: nodeid %d timed out.",
+                        get_nodeid());
     return true;
   }
   return false;
diff -Nrup a/storage/ndb/src/mgmsrv/Services.cpp b/storage/ndb/src/mgmsrv/Services.cpp
--- a/storage/ndb/src/mgmsrv/Services.cpp	2008-03-13 08:52:16 -07:00
+++ b/storage/ndb/src/mgmsrv/Services.cpp	2008-04-22 12:36:02 -07:00
@@ -36,7 +36,7 @@
 
 extern bool g_StopServer;
 extern bool g_RestartServer;
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 static const unsigned int MAX_READ_TIMEOUT = 1000 ;
 static const unsigned int MAX_WRITE_TIMEOUT = 100 ;
@@ -548,7 +548,7 @@ MgmApiSession::get_nodeid(Parser_t::Cont
   m_allocated_resources->reserve_node(tmp, timeout*1000);
   
   if (name)
-    g_eventLogger.info("Node %d: %s", tmp, name);
+    g_eventLogger->info("Node %d: %s", tmp, name);
 
   return;
 }
diff -Nrup a/storage/ndb/src/mgmsrv/main.cpp b/storage/ndb/src/mgmsrv/main.cpp
--- a/storage/ndb/src/mgmsrv/main.cpp	2007-08-30 02:29:26 -07:00
+++ b/storage/ndb/src/mgmsrv/main.cpp	2008-04-22 12:36:02 -07:00
@@ -128,7 +128,7 @@ static MgmGlobals *glob= 0;
  */
 bool g_StopServer;
 bool g_RestartServer;
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 enum ndb_mgmd_options {
   OPT_INTERACTIVE = NDB_STD_OPTIONS_LAST,
@@ -317,14 +317,14 @@ start:
   BaseString::snprintf(msg, sizeof(msg),
 	   "NDB Cluster Management Server. %s", NDB_VERSION_STRING);
   ndbout_c(msg);
-  g_eventLogger.info(msg);
+  g_eventLogger->info(msg);
 
   BaseString::snprintf(msg, 256, "Id: %d, Command port: %s:%d",
                        glob->localNodeId, 
                        _bind_address ? _bind_address : "*",
                        glob->port);
   ndbout_c(msg);
-  g_eventLogger.info(msg);
+  g_eventLogger->info(msg);
   
   g_StopServer = false;
   g_RestartServer= false;
@@ -345,13 +345,13 @@ start:
   }
 
   if(g_RestartServer)
-    g_eventLogger.info("Restarting server...");
+    g_eventLogger->info("Restarting server...");
   else
-    g_eventLogger.info("Shutting down server...");
+    g_eventLogger->info("Shutting down server...");
   glob->socketServer->stopServer();
   // We disconnect from the ConfigRetreiver mgmd when we delete glob below
   glob->socketServer->stopSessions(true);
-  g_eventLogger.info("Shutdown complete");
+  g_eventLogger->info("Shutdown complete");
  the_end:
   delete glob;
   if(g_RestartServer)
diff -Nrup a/storage/ndb/src/ndbapi/DictCache.cpp b/storage/ndb/src/ndbapi/DictCache.cpp
--- a/storage/ndb/src/ndbapi/DictCache.cpp	2008-04-08 01:29:09 -07:00
+++ b/storage/ndb/src/ndbapi/DictCache.cpp	2008-04-22 12:36:02 -07:00
@@ -20,8 +20,10 @@
 #include <NdbCondition.h>
 #include <NdbSleep.h>
 
-static NdbTableImpl f_invalid_table;
-static NdbTableImpl f_altered_table;
+static NdbTableImpl * f_invalid_table = 0;
+static NdbTableImpl * f_altered_table = 0;
+
+static int ndb_dict_cache_count = 0;
 
 Ndb_local_table_info *
 Ndb_local_table_info::create(NdbTableImpl *table_impl, Uint32 sz)
@@ -93,11 +95,29 @@ GlobalDictCache::GlobalDictCache(){
   DBUG_ENTER("GlobalDictCache::GlobalDictCache");
   m_tableHash.createHashTable();
   m_waitForTableCondition = NdbCondition_Create();
+  if (f_invalid_table == NULL)
+    f_invalid_table = new NdbTableImpl();
+  if (f_altered_table == NULL)
+    f_altered_table = new NdbTableImpl();
+  ndb_dict_cache_count++;
   DBUG_VOID_RETURN;
 }
 
 GlobalDictCache::~GlobalDictCache(){
   DBUG_ENTER("GlobalDictCache::~GlobalDictCache");
+  if (--ndb_dict_cache_count == 0)
+  {
+    if (f_invalid_table)
+    {
+      delete f_invalid_table;
+      f_invalid_table = 0;
+    }
+    if (f_altered_table)
+    {
+      delete f_altered_table;
+      f_altered_table = 0;
+    }
+  }
   NdbElement_t<Vector<TableVersion> > * curr = m_tableHash.getNext(0);
   while(curr != 0){
     Vector<TableVersion> * vers = curr->theData;
@@ -254,7 +274,7 @@ GlobalDictCache::put(const char * name, 
   TableVersion & ver = vers->back();
   if(ver.m_status != RETREIVING || 
      !(ver.m_impl == 0 || 
-       ver.m_impl == &f_invalid_table || ver.m_impl == &f_altered_table) || 
+       ver.m_impl == f_invalid_table || ver.m_impl == f_altered_table) || 
      ver.m_version != 0 || 
      ver.m_refCount == 0){
     abort();
@@ -271,7 +291,7 @@ GlobalDictCache::put(const char * name, 
     ver.m_version = tab->m_version;
     ver.m_status = OK;
   } 
-  else if (ver.m_impl == &f_invalid_table) 
+  else if (ver.m_impl == f_invalid_table) 
   {
     DBUG_PRINT("info", ("Table DROPPED invalid"));
     ver.m_impl = tab;
@@ -279,7 +299,7 @@ GlobalDictCache::put(const char * name, 
     ver.m_status = DROPPED;
     ver.m_impl->m_status = NdbDictionary::Object::Invalid;    
   }
-  else if(ver.m_impl == &f_altered_table)
+  else if(ver.m_impl == f_altered_table)
   {
     DBUG_PRINT("info", ("Table DROPPED altered"));
     ver.m_impl = tab;
@@ -440,7 +460,7 @@ GlobalDictCache::alter_table_rep(const c
 
     if(i == sz - 1 && ver.m_status == RETREIVING)
     {
-      ver.m_impl = altered ? &f_altered_table : &f_invalid_table;
+      ver.m_impl = altered ? f_altered_table : f_invalid_table;
       DBUG_VOID_RETURN;
     } 
   }
diff -Nrup a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2008-04-01 10:09:23 -07:00
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp	2008-04-22 12:36:02 -07:00
@@ -44,7 +44,7 @@
 #include "ndb_internal.hpp"
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 static Gci_container_pod g_empty_gci_container;
 
@@ -1220,8 +1220,8 @@ NdbEventBuffer::flushIncompleteEvents(Ui
   Uint32 minpos = m_min_gci_index;
   Uint32 maxpos = m_max_gci_index;
 
-  g_eventLogger.info("Flushing incomplete GCI:s < %u/%u",
-                     Uint32(gci >> 32), Uint32(gci));
+  g_eventLogger->info("Flushing incomplete GCI:s < %u/%u",
+                      Uint32(gci >> 32), Uint32(gci));
   while (minpos != maxpos && array[minpos] < gci)
   {
     Gci_container* tmp = find_bucket(array[minpos]);
@@ -1929,11 +1929,11 @@ NdbEventBuffer::execSUB_GCP_COMPLETE_REP
         goto do_complete;
       }
       /** out of order something */
-      g_eventLogger.info("out of order bucket: %d gci: %u/%u minGCI: %u/%u m_latestGCI: %u/%u",
-                         (int)(bucket-(Gci_container*)m_active_gci.getBase()),
-                         Uint32(gci >> 32), Uint32(gci),
-                         Uint32(minGCI >> 32), Uint32(minGCI),
-                         Uint32(m_latestGCI >> 32), Uint32(m_latestGCI));
+      g_eventLogger->info("out of order bucket: %d gci: %u/%u minGCI: %u/%u m_latestGCI: %u/%u",
+                          (int)(bucket-(Gci_container*)m_active_gci.getBase()),
+                          Uint32(gci >> 32), Uint32(gci),
+                          Uint32(minGCI >> 32), Uint32(minGCI),
+                          Uint32(m_latestGCI >> 32), Uint32(m_latestGCI));
       bucket->m_state = Gci_container::GC_COMPLETE;
       bucket->m_gcp_complete_rep_count = 1; // Prevent from being reused
       m_latest_complete_GCI = gci;
@@ -1957,9 +1957,9 @@ NdbEventBuffer::complete_outof_order_gci
   Uint64 stop_gci = m_latest_complete_GCI;
 
   Uint64 start_gci = array[minpos];
-  g_eventLogger.info("complete_outof_order_gcis from: %u/%u to: %u/%u",
-                     Uint32(start_gci >> 32), Uint32(start_gci),
-                     Uint32(stop_gci >> 32), Uint32(stop_gci));
+  g_eventLogger->info("complete_outof_order_gcis from: %u/%u to: %u/%u",
+                      Uint32(start_gci >> 32), Uint32(start_gci),
+                      Uint32(stop_gci >> 32), Uint32(stop_gci));
 
   assert(start_gci <= stop_gci);
   do
diff -Nrup a/storage/ndb/src/ndbapi/NdbTransaction.cpp b/storage/ndb/src/ndbapi/NdbTransaction.cpp
--- a/storage/ndb/src/ndbapi/NdbTransaction.cpp	2008-04-07 05:05:20 -07:00
+++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp	2008-04-22 12:36:03 -07:00
@@ -524,14 +524,14 @@ NdbTransaction::executeNoBlobs(NdbTransa
          * We behave rather similarly in both places.
          * Hitting this is certainly a bug though...
          */
-        g_eventLogger.error("WARNING: Timeout in executeNoBlobs() waiting for "
-                            "response from NDB data nodes. This should NEVER "
-                            "occur. You have likely hit a NDB Bug. Please "
-                            "file a bug.");
+        g_eventLogger->error("WARNING: Timeout in executeNoBlobs() waiting for "
+                             "response from NDB data nodes. This should NEVER "
+                             "occur. You have likely hit a NDB Bug. Please "
+                             "file a bug.");
         DBUG_PRINT("error",("This timeout should never occure, execute()"));
-        g_eventLogger.error("Forcibly trying to rollback txn (%p"
-                            ") to try to clean up data node resources.",
-                            this);
+        g_eventLogger->error("Forcibly trying to rollback txn (%p"
+                             ") to try to clean up data node resources.",
+                             this);
         executeNoBlobs(NdbTransaction::Rollback);
         theError.code = 4012;
         theError.status= NdbError::PermanentError;
@@ -935,7 +935,7 @@ NdbTransaction::sendROLLBACK()      // S
     tSignal.setData(tTransId2, 3);
     if(theError.code == 4012)
     {
-      g_eventLogger.error("Sending TCROLLBACKREQ with Bad flag");
+      g_eventLogger->error("Sending TCROLLBACKREQ with Bad flag");
       tSignal.setLength(tSignal.getLength() + 1); // + flags
       tSignal.setData(0x1, 4); // potentially bad data
     }
diff -Nrup a/storage/ndb/src/ndbapi/Ndbif.cpp b/storage/ndb/src/ndbapi/Ndbif.cpp
--- a/storage/ndb/src/ndbapi/Ndbif.cpp	2007-09-12 04:30:25 -07:00
+++ b/storage/ndb/src/ndbapi/Ndbif.cpp	2008-04-22 12:36:03 -07:00
@@ -44,7 +44,7 @@
 #include <NdbTick.h>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 /******************************************************************************
  * int init( int aNrOfCon, int aNrOfOp );
@@ -743,8 +743,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* 
 
     if (unlikely(op == 0 || op->m_magic_number != NDB_EVENT_OP_MAGIC_NUMBER))
     {
-      g_eventLogger.error("dropped GSN_SUB_TABLE_DATA due to wrong magic "
-			  "number");
+      g_eventLogger->error("dropped GSN_SUB_TABLE_DATA due to wrong magic "
+                           "number");
       return ;
     }
 
diff -Nrup a/storage/ndb/src/ndbapi/Ndbinit.cpp b/storage/ndb/src/ndbapi/Ndbinit.cpp
--- a/storage/ndb/src/ndbapi/Ndbinit.cpp	2008-03-26 07:27:55 -07:00
+++ b/storage/ndb/src/ndbapi/Ndbinit.cpp	2008-04-22 12:36:03 -07:00
@@ -35,7 +35,7 @@
 #include "NdbEventOperationImpl.hpp"
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 Ndb::Ndb( Ndb_cluster_connection *ndb_cluster_connection,
 	  const char* aDataBase , const char* aSchema)
@@ -142,7 +142,7 @@ Ndb::~Ndb()
   for (NdbEventOperationImpl *op= theImpl->m_ev_op; op; op=op->m_next)
   {
     if (op->m_state == NdbEventOperation::EO_EXECUTING && op->stop())
-      g_eventLogger.error("stopping NdbEventOperation failed in Ndb destructor");
+      g_eventLogger->error("stopping NdbEventOperation failed in Ndb destructor");
     op->m_magic_number= 0;
   }
   doDisconnect();
diff -Nrup a/storage/ndb/src/ndbapi/ObjectMap.cpp b/storage/ndb/src/ndbapi/ObjectMap.cpp
--- a/storage/ndb/src/ndbapi/ObjectMap.cpp	2007-04-11 08:22:12 -07:00
+++ b/storage/ndb/src/ndbapi/ObjectMap.cpp	2008-04-22 12:36:03 -07:00
@@ -53,8 +53,8 @@ int NdbObjectIdMap::expand(Uint32 incSiz
   else
   {
     NdbMutex_Unlock(m_mutex);
-    g_eventLogger.error("NdbObjectIdMap::expand: realloc(%u*%u) failed",
-                        newSize, sizeof(MapEntry));
+    g_eventLogger->error("NdbObjectIdMap::expand: realloc(%u*%u) failed",
+                         newSize, sizeof(MapEntry));
     return -1;
   }
   NdbMutex_Unlock(m_mutex);
diff -Nrup a/storage/ndb/src/ndbapi/ObjectMap.hpp b/storage/ndb/src/ndbapi/ObjectMap.hpp
--- a/storage/ndb/src/ndbapi/ObjectMap.hpp	2007-04-11 06:51:06 -07:00
+++ b/storage/ndb/src/ndbapi/ObjectMap.hpp	2008-04-22 12:36:03 -07:00
@@ -21,7 +21,7 @@
 #include <NdbOut.hpp>
 
 #include <EventLogger.hpp>
-extern EventLogger g_eventLogger;
+extern EventLogger * g_eventLogger;
 
 //#define DEBUG_OBJECTMAP
 
@@ -85,8 +85,8 @@ 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",
-                          id, (long) object, (long) obj);
+      g_eventLogger->error("NdbObjectIdMap::unmap(%u, 0x%x) obj=0x%x",
+                           id, (long) object, (long) obj);
       DBUG_PRINT("error",("NdbObjectIdMap::unmap(%u, 0x%lx) obj=0x%lx",
                           id, (long) object, (long) obj));
       return 0;
diff -Nrup a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp
--- a/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2007-04-12 07:04:43 -07:00
+++ b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp	2008-04-22 12:36:03 -07:00
@@ -31,14 +31,14 @@
 #include <mgmapi_internal.h>
 #include <md5_hash.hpp>
 
-#include <EventLogger.hpp>
-EventLogger g_eventLogger;
-
 #include <NdbMutex.h>
 #ifdef VM_TRACE
 NdbMutex *ndb_print_state_mutex= NULL;
 #endif
 
+#include <EventLogger.hpp>
+extern EventLogger *g_eventLogger;
+
 static int g_ndb_connection_count = 0;
 
 /*
@@ -285,13 +285,46 @@ Ndb_cluster_connection_impl(const char *
   DBUG_ENTER("Ndb_cluster_connection");
   DBUG_PRINT("enter",("Ndb_cluster_connection this=0x%lx", (long) this));
 
+  NdbMutex_Lock(g_ndb_connection_mutex);
+  if(g_ndb_connection_count++ == 0){
+    NdbDictionary::Column::FRAGMENT= 
+      NdbColumnImpl::create_pseudo("NDB$FRAGMENT");
+    NdbDictionary::Column::FRAGMENT_FIXED_MEMORY= 
+      NdbColumnImpl::create_pseudo("NDB$FRAGMENT_FIXED_MEMORY");
+    NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY= 
+      NdbColumnImpl::create_pseudo("NDB$FRAGMENT_VARSIZED_MEMORY");
+    NdbDictionary::Column::ROW_COUNT= 
+      NdbColumnImpl::create_pseudo("NDB$ROW_COUNT");
+    NdbDictionary::Column::COMMIT_COUNT= 
+      NdbColumnImpl::create_pseudo("NDB$COMMIT_COUNT");
+    NdbDictionary::Column::ROW_SIZE=
+      NdbColumnImpl::create_pseudo("NDB$ROW_SIZE");
+    NdbDictionary::Column::RANGE_NO= 
+      NdbColumnImpl::create_pseudo("NDB$RANGE_NO");
+    NdbDictionary::Column::DISK_REF= 
+      NdbColumnImpl::create_pseudo("NDB$DISK_REF");
+    NdbDictionary::Column::RECORDS_IN_RANGE= 
+      NdbColumnImpl::create_pseudo("NDB$RECORDS_IN_RANGE");
+    NdbDictionary::Column::ROWID= 
+      NdbColumnImpl::create_pseudo("NDB$ROWID");
+    NdbDictionary::Column::ROW_GCI= 
+      NdbColumnImpl::create_pseudo("NDB$ROW_GCI");
+    NdbDictionary::Column::ANY_VALUE= 
+      NdbColumnImpl::create_pseudo("NDB$ANY_VALUE");
+    NdbDictionary::Column::COPY_ROWID= 
+      NdbColumnImpl::create_pseudo("NDB$COPY_ROWID");
+
+    g_eventLogger->createConsoleHandler();
+    g_eventLogger->setCategory("NdbApi");
+    g_eventLogger->enable(Logger::LL_ON, Logger::LL_ERROR);
+
+  }
+  NdbMutex_Unlock(g_ndb_connection_mutex);
+
   if (!m_event_add_drop_mutex)
     m_event_add_drop_mutex= NdbMutex_Create();
   m_new_delete_ndb_mutex = NdbMutex_Create();
-  
-  g_eventLogger.createConsoleHandler();
-  g_eventLogger.setCategory("NdbApi");
-  g_eventLogger.enable(Logger::LL_ON, Logger::LL_ERROR);
+
 
   m_connect_thread= 0;
   m_connect_callback= 0;
@@ -327,36 +360,6 @@ Ndb_cluster_connection_impl(const char *
       new TransporterFacade(m_main_connection->m_impl.m_globalDictCache);
   }
 
-  NdbMutex_Lock(g_ndb_connection_mutex);
-  if(g_ndb_connection_count++ == 0){
-    NdbDictionary::Column::FRAGMENT= 
-      NdbColumnImpl::create_pseudo("NDB$FRAGMENT");
-    NdbDictionary::Column::FRAGMENT_FIXED_MEMORY= 
-      NdbColumnImpl::create_pseudo("NDB$FRAGMENT_FIXED_MEMORY");
-    NdbDictionary::Column::FRAGMENT_VARSIZED_MEMORY= 
-      NdbColumnImpl::create_pseudo("NDB$FRAGMENT_VARSIZED_MEMORY");
-    NdbDictionary::Column::ROW_COUNT= 
-      NdbColumnImpl::create_pseudo("NDB$ROW_COUNT");
-    NdbDictionary::Column::COMMIT_COUNT= 
-      NdbColumnImpl::create_pseudo("NDB$COMMIT_COUNT");
-    NdbDictionary::Column::ROW_SIZE=
-      NdbColumnImpl::create_pseudo("NDB$ROW_SIZE");
-    NdbDictionary::Column::RANGE_NO= 
-      NdbColumnImpl::create_pseudo("NDB$RANGE_NO");
-    NdbDictionary::Column::DISK_REF= 
-      NdbColumnImpl::create_pseudo("NDB$DISK_REF");
-    NdbDictionary::Column::RECORDS_IN_RANGE= 
-      NdbColumnImpl::create_pseudo("NDB$RECORDS_IN_RANGE");
-    NdbDictionary::Column::ROWID= 
-      NdbColumnImpl::create_pseudo("NDB$ROWID");
-    NdbDictionary::Column::ROW_GCI= 
-      NdbColumnImpl::create_pseudo("NDB$ROW_GCI");
-    NdbDictionary::Column::ANY_VALUE= 
-      NdbColumnImpl::create_pseudo("NDB$ANY_VALUE");
-    NdbDictionary::Column::COPY_ROWID= 
-      NdbColumnImpl::create_pseudo("NDB$COPY_ROWID");
-  }
-  NdbMutex_Unlock(g_ndb_connection_mutex);
 
   DBUG_VOID_RETURN;
 }
@@ -429,6 +432,7 @@ Ndb_cluster_connection_impl::~Ndb_cluste
 
     delete NdbDictionary::Column::COPY_ROWID;
     NdbDictionary::Column::COPY_ROWID = 0;
+    
   }
   NdbMutex_Unlock(g_ndb_connection_mutex);
 
Thread
bk commit into 5.1 tree (mtaylor:1.2578) BUG#35927Monty Taylor22 Apr