mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
wl1744 - ndb win-port
ndb/include/ndbapi/NdbDictionary.hpp: win-port ndb/include/ndbapi/ndb_cluster_connection.hpp: win-port ndb/include/util/SocketServer.hpp: win-port ndb/src/common/portlib/win32/NdbCondition.c: win-port ndb/src/common/portlib/win32/NdbEnv.c: win-port ndb/src/common/portlib/win32/NdbHost.c: win-port ndb/src/common/portlib/win32/NdbMem.c: win-port ndb/src/common/portlib/win32/NdbMutex.c: win-port ndb/src/common/portlib/win32/NdbSleep.c: win-port ndb/src/common/portlib/win32/NdbTCP.c: win-port ndb/src/common/portlib/win32/NdbThread.c: win-port ndb/src/common/portlib/win32/NdbTick.c: win-port ndb/src/common/util/File.cpp: win-port ndb/src/mgmsrv/ConfigInfo.cpp: win-port ndb/src/mgmsrv/InitConfigFileParser.cpp: win-port ndb/src/mgmsrv/MgmtSrvr.cpp: win-port ndb/src/mgmsrv/MgmtSrvr.hpp: win-port ndb/src/mgmsrv/Services.cpp: win-port ndb/src/mgmsrv/Services.hpp: win-port ndb/src/mgmsrv/SignalQueue.hpp: win-port ndb/src/ndbapi/NdbDictionaryImpl.hpp: win-port ndb/test/src/NdbRestarts.cpp: win-port
This commit is contained in:
@ -710,7 +710,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Get a specific column in the index
|
* Get a specific column in the index
|
||||||
*/
|
*/
|
||||||
const NdbDictionary::Column * getColumn(unsigned no) const ;
|
const Column * getColumn(unsigned no) const ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a specific column name in the index
|
* Get a specific column name in the index
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
#define CLUSTER_CONNECTION_HPP
|
#define CLUSTER_CONNECTION_HPP
|
||||||
|
|
||||||
class TransporterFacade;
|
class TransporterFacade;
|
||||||
class LocalConfig;
|
struct LocalConfig;
|
||||||
class ConfigRetriever;
|
class ConfigRetriever;
|
||||||
class NdbThread;
|
struct NdbThread;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
void* run_ndb_cluster_connection_connect_thread(void*);
|
void* run_ndb_cluster_connection_connect_thread(void*);
|
||||||
|
@ -98,7 +98,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void stopSessions(bool wait = false);
|
void stopSessions(bool wait = false);
|
||||||
|
|
||||||
void foreachSession(void (*f)(SocketServer::Session*, void*), void *data);
|
void foreachSession(void (*f)(Session*, void*), void *data);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct SessionInstance {
|
struct SessionInstance {
|
||||||
|
@ -15,16 +15,10 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <ndb_global.h>
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include "NdbCondition.h"
|
#include "NdbCondition.h"
|
||||||
#include <NdbMutex.h>
|
#include <NdbMutex.h>
|
||||||
|
|
||||||
|
|
||||||
struct NdbCondition
|
struct NdbCondition
|
||||||
{
|
{
|
||||||
long nWaiters;
|
long nWaiters;
|
||||||
|
@ -14,10 +14,8 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include "NdbEnv.h"
|
#include "NdbEnv.h"
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen)
|
const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen)
|
||||||
{
|
{
|
||||||
|
@ -15,9 +15,8 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include "NdbHost.h"
|
#include "NdbHost.h"
|
||||||
#include <windows.h>
|
|
||||||
#include <process.h>
|
|
||||||
|
|
||||||
|
|
||||||
int NdbHost_GetHostName(char* buf)
|
int NdbHost_GetHostName(char* buf)
|
||||||
|
@ -14,14 +14,10 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include <windows.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <NdbStdio.h>
|
|
||||||
|
|
||||||
#include "NdbMem.h"
|
#include "NdbMem.h"
|
||||||
|
|
||||||
|
#if 0
|
||||||
struct AWEINFO
|
struct AWEINFO
|
||||||
{
|
{
|
||||||
SIZE_T dwSizeInBytesRequested;
|
SIZE_T dwSizeInBytesRequested;
|
||||||
@ -235,3 +231,53 @@ int NdbMem_MemUnlockAll()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void NdbMem_Create()
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void NdbMem_Destroy()
|
||||||
|
{
|
||||||
|
/* Do nothing */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void* NdbMem_Allocate(size_t size)
|
||||||
|
{
|
||||||
|
void* mem_allocated;
|
||||||
|
assert(size > 0);
|
||||||
|
mem_allocated= (void*)malloc(size);
|
||||||
|
return mem_allocated;
|
||||||
|
}
|
||||||
|
|
||||||
|
void* NdbMem_AllocateAlign(size_t size, size_t alignment)
|
||||||
|
{
|
||||||
|
(void)alignment; /* remove warning for unused parameter */
|
||||||
|
/*
|
||||||
|
return (void*)memalign(alignment, size);
|
||||||
|
TEMP fix
|
||||||
|
*/
|
||||||
|
return (void*)malloc(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void NdbMem_Free(void* ptr)
|
||||||
|
{
|
||||||
|
free(ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int NdbMem_MemLockAll()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int NdbMem_MemUnlockAll()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -15,15 +15,9 @@
|
|||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <ndb_global.h>
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <time.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "NdbMutex.h"
|
#include "NdbMutex.h"
|
||||||
|
|
||||||
|
|
||||||
NdbMutex* NdbMutex_Create(void)
|
NdbMutex* NdbMutex_Create(void)
|
||||||
{
|
{
|
||||||
NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex));
|
NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex));
|
||||||
|
@ -14,12 +14,9 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include "NdbSleep.h"
|
#include "NdbSleep.h"
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
NdbSleep_MilliSleep(int milliseconds)
|
NdbSleep_MilliSleep(int milliseconds)
|
||||||
{
|
{
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include "NdbTCP.h"
|
#include "NdbTCP.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -14,13 +14,9 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include <windows.h>
|
|
||||||
#include <process.h>
|
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "NdbThread.h"
|
#include "NdbThread.h"
|
||||||
|
#include <process.h>
|
||||||
|
|
||||||
#define MAX_THREAD_NAME 16
|
#define MAX_THREAD_NAME 16
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
|
#include <ndb_global.h>
|
||||||
#include <windows.h>
|
|
||||||
#include "NdbTick.h"
|
#include "NdbTick.h"
|
||||||
|
//#include <windows.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#define FILETIME_PER_MICROSEC 10
|
#define FILETIME_PER_MICROSEC 10
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <ndb_global.h>
|
#include <ndb_global.h>
|
||||||
|
|
||||||
#include <File.hpp>
|
#include <File.hpp>
|
||||||
|
|
||||||
#include <NdbOut.hpp>
|
#include <NdbOut.hpp>
|
||||||
#include <my_dir.h>
|
#include <my_dir.h>
|
||||||
|
|
||||||
@ -28,13 +29,11 @@ bool
|
|||||||
File_class::exists(const char* aFileName)
|
File_class::exists(const char* aFileName)
|
||||||
{
|
{
|
||||||
bool rc = true;
|
bool rc = true;
|
||||||
|
|
||||||
#ifdef USE_MY_STAT_STRUCT
|
#ifdef USE_MY_STAT_STRUCT
|
||||||
struct my_stat stmp;
|
struct my_stat stmp;
|
||||||
#else
|
#else
|
||||||
struct stat stmp;
|
struct stat stmp;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (my_stat(aFileName, &stmp, MYF(0)) != 0)
|
if (my_stat(aFileName, &stmp, MYF(0)) != 0)
|
||||||
{
|
{
|
||||||
rc = false;
|
rc = false;
|
||||||
|
@ -3177,7 +3177,7 @@ transform(InitConfigFileParser::Context & ctx,
|
|||||||
Uint64 oldVal;
|
Uint64 oldVal;
|
||||||
require(ctx.m_currentSection->get(oldName, &oldVal));
|
require(ctx.m_currentSection->get(oldName, &oldVal));
|
||||||
|
|
||||||
Uint64 newVal = (Uint64)(oldVal * mul + add);
|
Uint64 newVal = (Uint64)((Int64)oldVal * mul + add);
|
||||||
if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){
|
if(!ctx.m_info->verify(ctx.m_currentInfo, newName, newVal)){
|
||||||
ctx.reportError("Unable to handle deprication, new value not within bounds"
|
ctx.reportError("Unable to handle deprication, new value not within bounds"
|
||||||
"%s %s - [%s] starting at line: %d",
|
"%s %s - [%s] starting at line: %d",
|
||||||
|
@ -386,7 +386,7 @@ bool InitConfigFileParser::convertStringToUint64(const char* s,
|
|||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
char* p;
|
char* p;
|
||||||
long long v = strtoll(s, &p, log10base);
|
Int64 v = strtoll(s, &p, log10base);
|
||||||
if (errno != 0)
|
if (errno != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ MgmtSrvr::signalRecvThreadRun()
|
|||||||
while(!_isStopThread) {
|
while(!_isStopThread) {
|
||||||
SigMatch *handler = NULL;
|
SigMatch *handler = NULL;
|
||||||
NdbApiSignal *signal = NULL;
|
NdbApiSignal *signal = NULL;
|
||||||
if(m_signalRecvQueue.waitFor(siglist, handler, signal, DEFAULT_TIMEOUT)) {
|
if(m_signalRecvQueue.waitFor(siglist, &handler, &signal, DEFAULT_TIMEOUT)) {
|
||||||
if(handler->function != 0)
|
if(handler->function != 0)
|
||||||
(this->*handler->function)(signal);
|
(this->*handler->function)(signal);
|
||||||
}
|
}
|
||||||
@ -2652,7 +2652,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
|
|||||||
|
|
||||||
int p_type;
|
int p_type;
|
||||||
unsigned val_32;
|
unsigned val_32;
|
||||||
unsigned long long val_64;
|
Uint64 val_64;
|
||||||
const char * val_char;
|
const char * val_char;
|
||||||
do {
|
do {
|
||||||
p_type = 0;
|
p_type = 0;
|
||||||
@ -2714,7 +2714,7 @@ MgmtSrvr::setDbParameter(int node, int param, const char * value,
|
|||||||
|
|
||||||
template class Vector<SigMatch>;
|
template class Vector<SigMatch>;
|
||||||
#if __SUNPRO_CC != 0x560
|
#if __SUNPRO_CC != 0x560
|
||||||
template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch*&, NdbApiSignal*&, unsigned);
|
template bool SignalQueue::waitFor<SigMatch>(Vector<SigMatch>&, SigMatch**, NdbApiSignal**, unsigned);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template class MutexVector<unsigned short>;
|
template class MutexVector<unsigned short>;
|
||||||
|
@ -663,7 +663,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
static void signalReceivedNotification(void* mgmtSrvr,
|
static void signalReceivedNotification(void* mgmtSrvr,
|
||||||
NdbApiSignal* signal,
|
NdbApiSignal* signal,
|
||||||
class LinearSectionPtr ptr[3]);
|
struct LinearSectionPtr ptr[3]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called from "outside" of MgmtSrvr when a DB process has died.
|
* Called from "outside" of MgmtSrvr when a DB process has died.
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <ConfigValues.hpp>
|
#include <ConfigValues.hpp>
|
||||||
#include <mgmapi_configuration.hpp>
|
#include <mgmapi_configuration.hpp>
|
||||||
|
#include <Vector.hpp>
|
||||||
#include "Services.hpp"
|
#include "Services.hpp"
|
||||||
|
|
||||||
extern bool g_StopServer;
|
extern bool g_StopServer;
|
||||||
@ -282,8 +282,8 @@ MgmApiSession::runSession() {
|
|||||||
/* Backwards compatibility for old NDBs that still use
|
/* Backwards compatibility for old NDBs that still use
|
||||||
* the old "GET CONFIG" command.
|
* the old "GET CONFIG" command.
|
||||||
*/
|
*/
|
||||||
|
size_t i;
|
||||||
for(size_t i=0; i<strlen(ctx.m_currentToken); i++)
|
for(i=0; i<strlen(ctx.m_currentToken); i++)
|
||||||
ctx.m_currentToken[i] = toupper(ctx.m_currentToken[i]);
|
ctx.m_currentToken[i] = toupper(ctx.m_currentToken[i]);
|
||||||
|
|
||||||
if(strncmp("GET CONFIG ",
|
if(strncmp("GET CONFIG ",
|
||||||
|
@ -103,7 +103,7 @@ public:
|
|||||||
m_mgmsrv = mgmsrv;
|
m_mgmsrv = mgmsrv;
|
||||||
}
|
}
|
||||||
|
|
||||||
MgmApiSession * newSession(NDB_SOCKET_TYPE socket){
|
SocketServer::Session * newSession(NDB_SOCKET_TYPE socket){
|
||||||
return new MgmApiSession(* m_mgmsrv, socket);
|
return new MgmApiSession(* m_mgmsrv, socket);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -47,8 +47,8 @@ public:
|
|||||||
NodeId nodeid = 0,
|
NodeId nodeid = 0,
|
||||||
Uint32 timeout = DEFAULT_TIMEOUT);
|
Uint32 timeout = DEFAULT_TIMEOUT);
|
||||||
template<class T> bool waitFor(Vector<T> &t,
|
template<class T> bool waitFor(Vector<T> &t,
|
||||||
T *&handler,
|
T **handler,
|
||||||
NdbApiSignal *&signal,
|
NdbApiSignal **signal,
|
||||||
Uint32 timeout = DEFAULT_TIMEOUT);
|
Uint32 timeout = DEFAULT_TIMEOUT);
|
||||||
private:
|
private:
|
||||||
NdbMutex *m_mutex; /* Locks all data in SignalQueue */
|
NdbMutex *m_mutex; /* Locks all data in SignalQueue */
|
||||||
@ -75,8 +75,8 @@ private:
|
|||||||
|
|
||||||
template<class T> bool
|
template<class T> bool
|
||||||
SignalQueue::waitFor(Vector<T> &t,
|
SignalQueue::waitFor(Vector<T> &t,
|
||||||
T *&handler,
|
T **handler,
|
||||||
NdbApiSignal *&signal,
|
NdbApiSignal **signal,
|
||||||
Uint32 timeout) {
|
Uint32 timeout) {
|
||||||
Guard g(m_mutex);
|
Guard g(m_mutex);
|
||||||
|
|
||||||
@ -88,8 +88,8 @@ SignalQueue::waitFor(Vector<T> &t,
|
|||||||
|
|
||||||
for(size_t i = 0; i < t.size(); i++) {
|
for(size_t i = 0; i < t.size(); i++) {
|
||||||
if(t[i].check(m_signalQueueHead->signal)) {
|
if(t[i].check(m_signalQueueHead->signal)) {
|
||||||
handler = &t[i];
|
* handler = &t[i];
|
||||||
signal = pop();
|
* signal = pop();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ private:
|
|||||||
friend class Ndb;
|
friend class Ndb;
|
||||||
static void execSignal(void* dictImpl,
|
static void execSignal(void* dictImpl,
|
||||||
class NdbApiSignal* signal,
|
class NdbApiSignal* signal,
|
||||||
class LinearSectionPtr ptr[3]);
|
struct LinearSectionPtr ptr[3]);
|
||||||
|
|
||||||
static void execNodeStatus(void* dictImpl, Uint32,
|
static void execNodeStatus(void* dictImpl, Uint32,
|
||||||
bool alive, bool nfCompleted);
|
bool alive, bool nfCompleted);
|
||||||
|
@ -445,7 +445,7 @@ int twoNodeFailure(NdbRestarter& _restarter,
|
|||||||
<< ") secs " << endl;
|
<< ") secs " << endl;
|
||||||
NdbSleep_SecSleep(seconds);
|
NdbSleep_SecSleep(seconds);
|
||||||
|
|
||||||
randomId = (random() % _restarter.getNumDbNodes());
|
randomId = (rand() % _restarter.getNumDbNodes());
|
||||||
nodeId = _restarter.getDbNodeId(randomId);
|
nodeId = _restarter.getDbNodeId(randomId);
|
||||||
g_info << _restart->m_name << ": node = "<< nodeId << endl;
|
g_info << _restart->m_name << ": node = "<< nodeId << endl;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user