summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2005-01-19 07:37:42 +0100
committerunknown <joreland@mysql.com>2005-01-19 07:37:42 +0100
commit7cbe4d19e4f152fcb5c7b0e2cb3da116132b8aef (patch)
treef254fa19624bbd4b2781b2a8bf2cf8433c04a84e /ndb
parent0eb1a8107f2b245b6bbcdc78d0a49a78996df3c9 (diff)
parentbfe74e69903583f1bb9b4ad803c137d6487afa74 (diff)
downloadmariadb-git-7cbe4d19e4f152fcb5c7b0e2cb3da116132b8aef.tar.gz
Merge mysql.com:/home/jonas/src/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0-ndb ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/mysqld.cc: Auto merged
Diffstat (limited to 'ndb')
-rw-r--r--ndb/docs/Makefile.am4
-rw-r--r--ndb/include/util/ndb_opts.h2
-rw-r--r--ndb/src/common/portlib/NdbThread.c22
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp16
-rw-r--r--ndb/src/mgmsrv/Services.cpp1
-rw-r--r--ndb/src/ndbapi/NdbDictionaryImpl.cpp4
-rw-r--r--ndb/tools/restore/Restore.hpp33
7 files changed, 58 insertions, 24 deletions
diff --git a/ndb/docs/Makefile.am b/ndb/docs/Makefile.am
index cfcab70af9c..6d4cdc12cf6 100644
--- a/ndb/docs/Makefile.am
+++ b/ndb/docs/Makefile.am
@@ -43,7 +43,7 @@ ndbapidoc-pdf: ndbapi.pdf
ndbapi.html: $(noinst_HEADERS)
@set -x; \
- export NDB_RELEASE=$(NDB_RELEASE) \
+ export NDB_RELEASE=$(NDB_RELEASE); \
@RM@ -f ndbapi.pdf ndbapi.html; \
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
mkdir -p $(DOXYTMP) $(DOXYOUT); \
@@ -70,7 +70,7 @@ mgmapidoc-pdf: mgmapi.pdf
mgmapi.html: $(noinst_HEADERS)
@set -x; \
- export NDB_RELEASE=$(NDB_RELEASE) \
+ export NDB_RELEASE=$(NDB_RELEASE); \
@RM@ -f mgmapi.pdf mgmapi.html; \
@RM@ -rf $(DOXYTMP) $(DOXYOUT); \
mkdir -p $(DOXYTMP) $(DOXYOUT); \
diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h
index dc95149f706..9151aee6cf2 100644
--- a/ndb/include/util/ndb_opts.h
+++ b/ndb/include/util/ndb_opts.h
@@ -34,7 +34,7 @@ OPT_NDB_OPTIMIZED_NODE_SELECTION
#define OPT_NDB_CONNECTSTRING 'c'
-#if defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
+#if defined(NOT_ENOUGH_TESTED) && defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
#define OPT_NDB_SHM_DEFAULT 1
#else
#define OPT_NDB_SHM_DEFAULT 0
diff --git a/ndb/src/common/portlib/NdbThread.c b/ndb/src/common/portlib/NdbThread.c
index d4f6617d2f5..8cd6c306514 100644
--- a/ndb/src/common/portlib/NdbThread.c
+++ b/ndb/src/common/portlib/NdbThread.c
@@ -28,8 +28,24 @@ struct NdbThread
{
pthread_t thread;
char thread_name[MAX_THREAD_NAME];
+ NDB_THREAD_FUNC * func;
+ void * object;
};
+static
+void*
+ndb_thread_wrapper(void* _ss){
+ void * ret;
+ struct NdbThread * ss = (struct NdbThread *)_ss;
+#ifdef NDB_SHM_TRANSPORTER
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+#endif
+ ret= (* ss->func)(ss->object);
+ return ret;
+}
struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
@@ -67,10 +83,12 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
#ifdef PTHREAD_CREATE_JOINABLE /* needed on SCO */
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
#endif
+ tmpThread->func= p_thread_func;
+ tmpThread->object= p_thread_arg;
result = pthread_create(&tmpThread->thread,
&thread_attr,
- p_thread_func,
- p_thread_arg);
+ ndb_thread_wrapper,
+ tmpThread);
assert(result==0);
pthread_attr_destroy(&thread_attr);
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index fcc7a62d9e9..215b2a05f63 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -157,8 +157,17 @@ TransporterRegistry::init(NodeId nodeId) {
DEBUG("TransporterRegistry started node: " << localNodeId);
- // return allocateLongSignalMemoryPool(nLargeSegments);
- return true;
+#ifdef NDB_SHM_TRANSPORTER
+ /**
+ * Make sure to block SIGUSR1
+ * TransporterRegistry::init is run from "main" thread
+ */
+ sigset_t mask;
+ sigemptyset(&mask);
+ sigaddset(&mask, SIGUSR1);
+ pthread_sigmask(SIG_BLOCK, &mask, 0);
+#endif
+return true;
}
bool
@@ -1347,6 +1356,9 @@ TransporterRegistry::startReceiving()
#ifdef NDB_SHM_TRANSPORTER
m_shm_own_pid = getpid();
struct sigaction sa;
+ sigemptyset(&sa.sa_mask);
+ sigaddset(&sa.sa_mask, SIGUSR1);
+ pthread_sigmask(SIG_UNBLOCK, &sa.sa_mask, 0);
sa.sa_handler = shm_sig_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp
index 447bc8bdc2b..f1456157ac5 100644
--- a/ndb/src/mgmsrv/Services.cpp
+++ b/ndb/src/mgmsrv/Services.cpp
@@ -1512,4 +1512,3 @@ MgmApiSession::check_connection(Parser_t::Context &ctx,
template class MutexVector<int>;
template class Vector<ParserRow<MgmApiSession> const*>;
-template class Vector<unsigned short>;
diff --git a/ndb/src/ndbapi/NdbDictionaryImpl.cpp b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
index 2a9f9be5a30..1ae4263545e 100644
--- a/ndb/src/ndbapi/NdbDictionaryImpl.cpp
+++ b/ndb/src/ndbapi/NdbDictionaryImpl.cpp
@@ -631,7 +631,7 @@ NdbEventImpl::addTableEvent(const NdbDictionary::Event::TableEvent t = NdbDicti
}
void
-NdbEventImpl::setDurability(const NdbDictionary::Event::EventDurability d)
+NdbEventImpl::setDurability(NdbDictionary::Event::EventDurability d)
{
m_dur = d;
}
@@ -1370,7 +1370,7 @@ NdbDictInterface::parseTableInfo(NdbTableImpl ** ret,
}
Uint32 topBit = (1 << 31);
- for(int i = 31; i>=0; i--){
+ for(i = 31; i>=0; i--){
if((fragCount & topBit) != 0)
break;
topBit >>= 1;
diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp
index e0b06c1774c..d7f6e3b7799 100644
--- a/ndb/tools/restore/Restore.hpp
+++ b/ndb/tools/restore/Restore.hpp
@@ -187,28 +187,33 @@ public:
};
void update_max_auto_val(const char *data, int size) {
- Uint64 val= 0;
+ union {
+ Uint8 u8;
+ Uint16 u16;
+ Uint32 u32;
+ } val;
+ Uint64 v;
switch(size){
- case 8:
- val= *(Uint8*)data;
- break;
- case 16:
- val= *(Uint16*)data;
- break;
- case 24:
- val= (0xffffff)&*(Uint32*)data;
+ case 64:
+ memcpy(&v,data,8);
break;
case 32:
- val= *(Uint32*)data;
+ memcpy(&val.u32,data,4);
+ v= val.u32;
break;
- case 64:
- val= *(Uint64*)data;
+ case 16:
+ memcpy(&val.u16,data,2);
+ v= val.u16;
+ break;
+ case 8:
+ memcpy(&val.u8,data,1);
+ v= val.u8;
break;
default:
return;
};
- if(val > m_max_auto_val)
- m_max_auto_val= val;
+ if(v > m_max_auto_val)
+ m_max_auto_val= v;
};
/**
* Get attribute descriptor