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-09 15:10:26+02:00, mtaylor@solace.(none) +5 -0
BUG#35927 global g_eventLogger breaks dlopened libndbclient
Moved initialization of the g_eventLogger to ndb_init.
storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2008-04-09 15:10:24+02:00,
mtaylor@solace.(none) +15 -0
BUG#35927 global g_eventLogger breaks dlopened libndbclient
Moved initialization of the g_eventLogger to ndb_init.
storage/ndb/src/common/util/Makefile.am@stripped, 2008-04-09 15:10:24+02:00,
mtaylor@solace.(none) +1 -1
BUG#35927 global g_eventLogger breaks dlopened libndbclient
Moved initialization of the g_eventLogger to ndb_init.
storage/ndb/src/common/util/ndb_init.cpp@stripped, 2008-04-09 15:10:24+02:00,
mtaylor@solace.(none) +38 -7
BUG#35927 global g_eventLogger breaks dlopened libndbclient
Moved initialization of the g_eventLogger to ndb_init.
storage/ndb/src/common/util/ndb_init.cpp@stripped, 2008-04-09 14:59:40+02: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/common/util/ndb_init.c@stripped, 2008-04-09 14:58:43+02:00,
mtaylor@solace.(none) +0 -0
Rename: storage/ndb/src/common/util/ndb_init.cpp ->
storage/ndb/src/common/util/ndb_init.c
storage/ndb/src/common/util/ndb_init.cpp@stripped, 2008-04-09 14:24:42+02: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/main.cpp@stripped, 2008-04-09 15:10:24+02:00, mtaylor@solace.(none)
+1 -1
BUG#35927 global g_eventLogger breaks dlopened libndbclient
Moved initialization of the g_eventLogger to ndb_init.
storage/ndb/src/ndbapi/ndb_cluster_connection.cpp@stripped, 2008-04-09 15:10:24+02:00,
mtaylor@solace.(none) +1 -1
BUG#35927 global g_eventLogger breaks dlopened libndbclient
Moved initialization of the g_eventLogger to ndb_init.
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 14:13:04 +01:00
+++ b/storage/ndb/src/common/debugger/EventLogger.cpp 2008-04-09 15:10:24 +02:00
@@ -1263,3 +1263,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/util/Makefile.am
b/storage/ndb/src/common/util/Makefile.am
--- a/storage/ndb/src/common/util/Makefile.am 2008-02-25 13:22:41 +01:00
+++ b/storage/ndb/src/common/util/Makefile.am 2008-04-09 15:10:24 +02: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 2008-04-09 14:16:09 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,54 +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-09 15:10:24 +02:00
@@ -0,0 +1,85 @@
+/* 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);
+
+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)
+ {
+ if (my_init())
+ {
+ const char* err = "my_init() failed - exit\n";
+ write(2, err, strlen(err));
+ exit(1);
+ }
+ ndb_init_internal();
+ ndb_init_called = 1;
+ }
+ return 0;
+}
+
+void
+ndb_end_internal()
+{
+ if (g_ndb_connection_mutex)
+ NdbMutex_Destroy(g_ndb_connection_mutex);
+ if (g_eventLogger)
+ destroy_event_logger(&g_eventLogger);
+}
+
+void
+ndb_end(int flags)
+{
+ if (ndb_init_called == 1)
+ {
+ my_end(flags);
+ ndb_end_internal();
+ }
+}
+
+}
diff -Nrup a/storage/ndb/src/kernel/main.cpp b/storage/ndb/src/kernel/main.cpp
--- a/storage/ndb/src/kernel/main.cpp 2008-04-09 14:16:09 +02:00
+++ b/storage/ndb/src/kernel/main.cpp 2008-04-09 15:10:24 +02:00
@@ -44,7 +44,7 @@
#include <sys/processor.h> // For system informatio
#endif
-EventLogger * g_eventLogger = 0;
+extern EventLogger * g_eventLogger;
extern NdbMutex * theShutdownMutex;
void catchsigs(bool ignore); // for process signal handling
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 2008-04-09 14:16:13 +02:00
+++ b/storage/ndb/src/ndbapi/ndb_cluster_connection.cpp 2008-04-09 15:10:24 +02:00
@@ -37,7 +37,7 @@ NdbMutex *ndb_print_state_mutex= NULL;
#endif
#include <EventLogger.hpp>
-EventLogger *g_eventLogger = NULL;
+extern EventLogger *g_eventLogger;
static int g_ndb_connection_count = 0;
| Thread |
|---|
| • bk commit into 5.1 tree (mtaylor:1.2579) BUG#35927 | Monty Taylor | 9 Apr |