BitKeeper/etc/logging_ok:
  auto-union
configure.in:
  Auto merged
ndb/include/Makefile.am:
  Auto merged
ndb/include/mgmapi/mgmapi.h:
  Auto merged
ndb/include/ndbapi/NdbConnection.hpp:
  Auto merged
ndb/include/ndbapi/NdbDictionary.hpp:
  Auto merged
ndb/src/common/debugger/EventLogger.cpp:
  Auto merged
ndb/src/common/logger/Logger.cpp:
  Auto merged
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  Auto merged
ndb/src/common/util/Makefile.am:
  Auto merged
ndb/src/common/util/version.c:
  Auto merged
ndb/src/kernel/blocks/dbacc/Makefile.am:
  Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Auto merged
ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
  Auto merged
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
ndb/src/kernel/main.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
ndb/src/kernel/vm/Configuration.cpp:
  Auto merged
ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
ndb/src/mgmsrv/CommandInterpreter.cpp:
  Auto merged
ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
ndb/src/mgmsrv/Services.cpp:
  Auto merged
ndb/src/mgmsrv/Services.hpp:
  Auto merged
ndb/src/mgmsrv/main.cpp:
  Auto merged
ndb/src/ndbapi/Makefile.am:
  Auto merged
ndb/src/ndbapi/NdbBlob.cpp:
  Auto merged
ndb/src/ndbapi/NdbConnection.cpp:
  Auto merged
ndb/src/ndbapi/NdbDictionaryImpl.hpp:
  Auto merged
ndb/src/ndbapi/ndberror.c:
  Auto merged
ndb/test/ndbapi/Makefile.am:
  Auto merged
ndb/test/tools/Makefile.am:
  Auto merged
ndb/tools/Makefile.am:
  Auto merged
scripts/make_win_src_distribution.sh:
  Auto merged
This commit is contained in:
unknown 2004-12-16 22:42:27 +01:00
commit ff51fe45d3
149 changed files with 2715 additions and 794 deletions

View file

@ -2,6 +2,7 @@ Administrador@light.
Administrator@co3064164-a.
Administrator@co3064164-a.rochd1.qld.optushome.com.au
Administrator@fred.
Administrator@w2k.
Greg@greg-laptop.
Miguel@light.local
Sinisa@sinisa.nasamreza.org

View file

@ -748,7 +748,7 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
strings.h string.h synch.h sys/mman.h sys/socket.h netinet/in.h arpa/inet.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h linux/config.h)
sys/ioctl.h malloc.h sys/malloc.h linux/config.h sys/resource.h sys/param.h)
#--------------------------------------------------------------------
# Check for system libraries. Adds the library to $LIBS
@ -2724,6 +2724,7 @@ AC_CONFIG_FILES(ndb/Makefile ndb/include/Makefile dnl
ndb/test/ndbapi/bank/Makefile dnl
ndb/test/tools/Makefile dnl
ndb/test/run-test/Makefile mysql-test/ndb/Makefile dnl
ndb/include/ndb_version.h ndb/include/ndb_global.h dnl
)
fi

View file

@ -17,3 +17,13 @@ dist-hook:
done; \
fi; \
done
windoze:
for i in `find . -name 'Makefile.am'`; do make -C `dirname $$i` windoze-dsp; done
windoze-dsp:
all-windoze-dsp: windoze
find . -name '*.dsp' | grep -v SCCS | xargs unix2dos
$(top_srcdir)/ndb/config/make-win-dsw.sh | unix2dos > ndb.dsw
tar cvfz ndb-win-dsp.tar.gz ndb.dsw `find . -name '*.dsp' | grep -v SCCS`

42
ndb/config/make-win-dsw.sh Executable file
View file

@ -0,0 +1,42 @@
cat <<EOF
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
EOF
for i in `find . -name '*.dsp' | grep -v SCCS`
do
name=`basename $i | sed 's/\.dsp//'`
cat<<EOF
Project: "$name"="`echo $i | sed 's/\//\\\/g'`" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
EOF
done
cat<<EOF
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
EOF

8
ndb/config/win-includes Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
dst=$1
shift
out=`echo $* | sed 's/-I\([^ ]*\)/\/I "\1"/g'`
sed -e "s!@includes@!$out!g" $dst > /tmp/$dst.$$
mv /tmp/$dst.$$ $dst

100
ndb/config/win-lib.am Normal file
View file

@ -0,0 +1,100 @@
# Microsoft Developer Studio Project File - Name="@name@" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Static Library" 0x0104
CFG=@name@ - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "@name@.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Static Library")
!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Static Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "@name@ - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /D "WIN32" /D "DBUG_OFF" /D "_WINDOWS" /D "NDEBUG" /FD /c
# ADD BASE CPP @includes@
# ADD CPP @includes@
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:".\lib_release\@name@.lib"
@release_libs@
!ELSEIF "$(CFG)" == "@name@ - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /Gf /D "WIN32" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "_WINDOWS" /FD /c
# ADD BASE CPP @includes@
# ADD CPP @includes@
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409
# ADD RSC /l 0x409
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LIB32=xilink6.exe -lib
# ADD BASE LIB32 /nologo
# ADD LIB32 /nologo /out:".\lib_debug\@name@.lib"
@debug_libs@
!ENDIF
# Begin Target
# Name "@name@ - Win32 Release"
# Name "@name@ - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
@sources@
# End Group
# End Target
# End Project

56
ndb/config/win-libraries Executable file
View file

@ -0,0 +1,56 @@
#!/bin/sh
dst=$1
shift
type=$1
shift
add_lib(){
echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"`
}
out_rel=
out_deb=
out_tls_rel=
out_tls_deb=
for i in $*
do
# mysql VC++ project files have for some unknown reason
# choosen NOT to put libdbug.lib in $(topdir)./dbug but rather in $(topdir)
# the same goes for mysys and strings
lib=$i
case $i in
*libdbug.a | *libmysys.a | *libmystrings.a)
lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'`
echo "Changing from $i to $lib"
;;
esac
if [ `echo $i | grep -c gcc` -eq 0 ]
then
out_rel="${out_rel} `add_lib lib_release $lib`"
out_deb="${out_deb} `add_lib lib_debug $lib`"
out_tls_rel="${out_tls_rel} `add_lib lib_release $lib _tls`"
out_tls_deb="${out_tls_deb} `add_lib lib_debug $lib _tls`"
fi
done
fix(){
echo "# ADD BASE ${type}32 $*\n# ADD ${type}32 $*\n"
}
if [ "$out_rel" ]
then
out_rel=`fix $out_rel`
out_deb=`fix $out_deb`
out_tls_rel=`fix $out_tls_rel`
out_tls_deb=`fix $out_tls_deb`
fi
sed -e "s!@release_libs@!$out_rel!g" \
-e "s!@debug_libs@!$out_deb!g" \
-e "s!@tls_release_libs@!$out_tls_rel!g" \
-e "s!@tls_debug_libs@!$out_tls_deb!g" \
$dst > !tmp!$dst.$$
mv !tmp!$dst.$$ $dst

7
ndb/config/win-name Executable file
View file

@ -0,0 +1,7 @@
#!/bin/sh
dst=$1
shift
sed -e "s/@name@/`echo $1 | sed 's/\.[l]*a//g'`/g" $dst > /tmp/$dst.$$
mv /tmp/$dst.$$ $dst

98
ndb/config/win-prg.am Normal file
View file

@ -0,0 +1,98 @@
# Microsoft Developer Studio Project File - Name="mysqld" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=@name@ - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "@name@.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "@name@.mak" CFG="@name@ - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "@name@ - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "@name@ - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=xicl6.exe
RSC=rc.exe
!IF "$(CFG)" == "@name@ - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "release"
# PROP Intermediate_Dir "release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "NDB_WIN32" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MT /W3 /O2 /D "NDB_WIN32" /I "../zlib" /I "../include" /I "../regex" /D "NDEBUG" /D "DBUG_OFF" /D "HAVE_INNOBASE_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD BASE CPP @includes@
# ADD CPP @includes@
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x410 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
@release_libs@
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /pdb:none /machine:I386 /out:"release/@name@-opt.exe"
# SUBTRACT LINK32 /debug
!ELSEIF "$(CFG)" == "@name@ - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "debug"
# PROP Intermediate_Dir "debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "NDB_WIN32" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /MTd /W3 /Z7 /Od /D "NDB_WIN32" /I "../bdb/build_win32" /I "../include" /I "../regex" /I "../zlib" /D "_DEBUG" /D "SAFEMALLOC" /D "SAFE_MUTEX" /D "HAVE_INNOBASE_DB" /D "HAVE_BERKELEY_DB" /D "MYSQL_SERVER" /D "_WINDOWS" /D "_CONSOLE" /D "_MBCS" /D "HAVE_DLOPEN" /FD /c
# ADD BASE CPP @includes@
# ADD CPP @includes@
# SUBTRACT CPP /Fr /YX
# ADD BASE RSC /l 0x410 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=xilink6.exe
@debug_libs@
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib Wsock32.lib /nologo /subsystem:console /incremental:no /debug /machine:I386 /out:"debug/@name@.exe" /pdbtype:sept
!ENDIF
# Begin Target
# Name "@name@ - Win32 Release"
# Name "@name@ - Win32 Debug"
@sources@
# End Target
# End Project

8
ndb/config/win-sources Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
dst=$1
shift
out=`echo $* | sed 's!\([^ ]*\)!# Begin Source File\\\nSOURCE=\1\\\n# End Source File\\\n!g'`
sed -e "s!@sources@!$out!g" $dst > /tmp/$dst.$$
mv /tmp/$dst.$$ $dst

View file

@ -100,3 +100,5 @@ odbcdoc: DUMMY
testdoc: DUMMY
mkdir -p $(OUTDIR)
cd $(top_srcdir)/ndb ; $(DOXYGEN) $(DOXYDIR)/Doxyfile.test
windoze-dsp:

View file

@ -41,3 +41,5 @@ portlib transporter util
dist-hook:
-rm -rf `find $(distdir) -type d -name SCCS`
windoze-dsp:

View file

@ -24,8 +24,8 @@
*/
class GrepError {
public:
enum Code {
NO_ERROR = 0,
enum GE_Code {
GE_NO_ERROR = 0,
SUBSCRIPTION_ID_NOMEM = 1,
SUBSCRIPTION_ID_NOT_FOUND = 2,
SUBSCRIPTION_ID_NOT_UNIQUE = 3,
@ -82,12 +82,12 @@ public:
};
struct ErrorDescription {
Code errCode;
GE_Code errCode;
const char * name;
};
static const ErrorDescription errorDescriptions[];
static const Uint32 noOfErrorDescs;
static const char * getErrorDesc(GrepError::Code err);
static const char * getErrorDesc(GrepError::GE_Code err);
};

View file

@ -89,7 +89,7 @@ public:
return memcmp(this, &l, sizeof(* this)) == 0;
}
LogLevel& operator=(const class EventSubscribeReq & req);
LogLevel& operator=(const struct EventSubscribeReq & req);
private:
/**

View file

@ -75,7 +75,7 @@ inline
void
FsCloseReq::setRemoveFileFlag(UintR & fileflag, bool removefile){
// ASSERT_BOOL(removefile, "FsCloseReq::setRemoveFileFlag");
if (removefile == true)
if (removefile)
fileflag = 1;
else
fileflag = 0;

View file

@ -93,7 +93,7 @@ public:
Uint32 subscriptionId;
Uint32 subscriptionKey;
Uint32 senderNodeId;
GrepError::Code err;
GrepError::GE_Code err;
};
class RepGetGciReq
@ -151,7 +151,7 @@ public:
Uint32 lastPSGCI;
Uint32 firstSSGCI;
Uint32 lastSSGCI;
GrepError::Code err;
GrepError::GE_Code err;
};
class RepGetGciBufferReq {
@ -213,7 +213,7 @@ public:
Uint32 lastSSGCI;
Uint32 currentGCIBuffer;
Uint32 nodeGrp;
GrepError::Code err;
GrepError::GE_Code err;
};
class RepInsertGciBufferReq
@ -252,7 +252,7 @@ public:
Uint32 nodeGrp;
Uint32 tableId;
Uint32 force;
GrepError::Code err;
GrepError::GE_Code err;
};
class RepInsertGciBufferConf
@ -310,7 +310,7 @@ public:
Uint32 lastGCI;
Uint32 currentGCI;
Uint32 nodeGrp;
GrepError::Code err;
GrepError::GE_Code err;
};
class RepClearPSGciBufferConf
@ -367,7 +367,7 @@ public:
Uint32 lastGCI;
Uint32 currentGCI;
Uint32 nodeGrp;
GrepError::Code err;
GrepError::GE_Code err;
};
class RepClearSSGciBufferConf

View file

@ -39,7 +39,7 @@ public:
enum RequestInfo {
TryLock = 1
};
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -63,7 +63,7 @@ class UtilLockConf {
public:
STATIC_CONST( SignalLength = 4 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -95,7 +95,7 @@ public:
LockAlreadyHeld = 4
};
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -119,7 +119,7 @@ class UtilUnlockReq {
public:
STATIC_CONST( SignalLength = 4 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -143,7 +143,7 @@ class UtilUnlockConf {
public:
STATIC_CONST( SignalLength = 3 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -171,7 +171,7 @@ public:
NoSuchLock = 1,
NotLockOwner = 2
};
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -200,7 +200,7 @@ public:
STATIC_CONST( SignalLength = 4 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -229,7 +229,7 @@ public:
STATIC_CONST( SignalLength = 4 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -251,7 +251,7 @@ class UtilCreateLockConf {
public:
STATIC_CONST( SignalLength = 3 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -275,7 +275,7 @@ class UtilDestroyLockReq {
public:
STATIC_CONST( SignalLength = 4 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -303,7 +303,7 @@ public:
STATIC_CONST( SignalLength = 4 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;
@ -325,7 +325,7 @@ class UtilDestroyLockConf {
public:
STATIC_CONST( SignalLength = 3 );
private:
public:
Uint32 senderData;
Uint32 senderRef;
Uint32 lockId;

View file

@ -18,7 +18,9 @@
#define SYSLOGHANDLER_H
#include "LogHandler.hpp"
#ifndef NDB_WIN32
#include <syslog.h>
#endif
/**
* Logs messages to syslog. The default identity is 'NDB'.
@ -62,7 +64,7 @@ public:
* @param pIdentity a syslog identity.
* @param facility syslog facility, defaults to LOG_USER
*/
SysLogHandler(const char* pIdentity, int facility = LOG_USER);
SysLogHandler(const char* pIdentity, int facility);
/**
* Destructor.

View file

@ -49,6 +49,7 @@
* @{
*/
#include <ndb_types.h>
#include "mgmapi_config_parameters.h"
#ifdef __cplusplus
@ -743,7 +744,7 @@ extern "C" {
int ndb_mgm_get_int_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned * value);
int ndb_mgm_get_int64_parameter(const ndb_mgm_configuration_iterator*,
int param, unsigned long long * value);
int param, Uint64 * value);
int ndb_mgm_get_string_parameter(const ndb_mgm_configuration_iterator*,
int param, const char ** value);
int ndb_mgm_purge_stale_sessions(NdbMgmHandle handle, char **);

View file

@ -59,7 +59,7 @@ public:
void print() const { props->print(); }
static Uint32 configureTransporters(Uint32 nodeId,
const class ndb_mgm_configuration &,
const struct ndb_mgm_configuration &,
class TransporterRegistry &);
private:

View file

@ -2,34 +2,51 @@
#ifndef NDBGLOBAL_H
#define NDBGLOBAL_H
#include <my_global.h>
#include <ndb_types.h>
/** signal & SIG_PIPE */
#include <my_alarm.h>
#define NDB_PORT "@ndb_port@"
#define NDB_TCP_BASE_PORT "@ndb_port_base@"
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
#define NDB_WIN32
#include <winsock2.h>
#define PATH_MAX 256
#define DIR_SEPARATOR "\\"
#define MYSQLCLUSTERDIR "c:\\mysql\\mysql-cluster"
#define HAVE_STRCASECMP
#define strcasecmp _strcmpi
#pragma warning(disable: 4503 4786)
#else
#undef NDB_WIN32
#define DIR_SEPARATOR "/"
#endif
#include <my_global.h>
#include <my_alarm.h>
#ifdef _AIX
#undef _H_STRINGS
#endif
#include <m_string.h>
#include <m_ctype.h>
#include <ndb_types.h>
#include <ctype.h>
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef TIME_WITH_SYS_TIME
#include <time.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_STAT_H
#if defined(__cplusplus) && defined(_APP32_64BIT_OFF_T) && defined(_INCLUDE_AES_SOURCE)
#undef _INCLUDE_AES_SOURCE
@ -39,31 +56,31 @@
#include <sys/stat.h>
#endif
#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#ifdef NDB_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#define DIR_SEPARATOR "\\"
#define PATH_MAX 256
#pragma warning(disable: 4503 4786)
#else
#define DIR_SEPARATOR "/"
#ifndef HAVE_STRDUP
extern char * strdup(const char *s);
#endif
#ifndef HAVE_STRCASECMP
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, size_t n);
#endif
static const char table_name_separator = '/';
#if defined(_AIX) || defined(NDB_VC98)
#if defined(_AIX) || defined(WIN32) || defined(NDB_VC98)
#define STATIC_CONST(x) enum { x }
#else
#define STATIC_CONST(x) static const Uint32 x
@ -84,13 +101,8 @@ extern int ndb_init(void);
extern void ndb_end(int);
#define NDB_INIT(prog_name) {my_progname=(prog_name); ndb_init();}
#ifndef HAVE_STRDUP
extern char * strdup(const char *s);
#endif
#ifndef HAVE_STRCASECMP
extern int strcasecmp(const char *s1, const char *s2);
extern int strncasecmp(const char *s1, const char *s2, size_t n);
#ifdef __cplusplus
}
#endif
#ifdef SCO
@ -101,8 +113,4 @@ extern int strncasecmp(const char *s1, const char *s2, size_t n);
#endif /* SCO */
#ifdef __cplusplus
}
#endif
#endif

View file

@ -40,15 +40,21 @@ typedef __SIZE_TYPE__ UintPtr;
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#if defined(WIN32) || defined(NDB_WIN32)
typedef Uint32 UintPtr;
#else
typedef uintptr_t UintPtr;
#endif
#endif
#if defined(WIN32) || defined(NDB_WIN32)
typedef unsigned __int64 Uint64;
typedef signed __int64 Int64;
typedef UintPtr ssize_t;
#else
typedef unsigned long long Uint64;
typedef signed long long Int64;
#endif
#endif

View file

@ -20,14 +20,25 @@
#include <ndb_global.h>
#include <version.h>
/* NDB build version */
#define NDB_VERSION_BUILD @NDB_VERSION_BUILD@
/* NDB major version */
#define NDB_VERSION_MAJOR @NDB_VERSION_MAJOR@
/* NDB minor version */
#define NDB_VERSION_MINOR @NDB_VERSION_MINOR@
/* NDB status version */
#define NDB_VERSION_STATUS "@NDB_VERSION_STATUS@"
#define MAKE_VERSION(A,B,C) (((A) << 16) | ((B) << 8) | ((C) << 0))
#define NDB_VERSION_D MAKE_VERSION(NDB_VERSION_MAJOR, NDB_VERSION_MINOR, NDB_VERSION_BUILD)
#define NDB_VERSION_STRING (getVersionString(NDB_VERSION, NDB_VERSION_STATUS))
#define NDB_VERSION_TAG_STRING "$Name: $"
#define NDB_VERSION ndbGetOwnVersion()
/**

View file

@ -50,7 +50,7 @@ enum AbortOption {
TryCommit = 0, ///< <i>Missing explanation</i>
#endif
AbortOnError = 0, ///< Abort transaction on failed operation
IgnoreError = 2 ///< Transaction continues on failed operation
AO_IgnoreError = 2 ///< Transaction continues on failed operation
};
typedef AbortOption CommitType;

View file

@ -703,7 +703,7 @@ public:
/**
* 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

View file

@ -20,7 +20,7 @@
class TransporterFacade;
class ConfigRetriever;
class NdbThread;
struct NdbThread;
extern "C" {
void* run_ndb_cluster_connection_connect_thread(void*);

View file

@ -40,7 +40,7 @@ typedef int socklen_t;
#define InetErrno (* inet_errno())
#elif NDB_WIN32
#elif defined NDB_WIN32
/**
* Include files needed

View file

@ -22,55 +22,12 @@
$Id: PortDefs.h,v 1.5 2003/10/07 07:59:59 mikael Exp $
*/
#ifdef NDB_WIN32
#include <time.h>
struct tms
{
time_t tms_utime; /* user time */
time_t tms_stime; /* system time */
time_t tms_cutime; /* user time of children */
time_t tms_cstime; /* system time of children */
};
struct timespec
{
long tv_sec; /* Seconds */
long tv_nsec; /* Nanoseconds */
};
#define strcasecmp(a,b) _strcmpi(a,b)
/* Exports a WIN32 getopt function */
extern int optind;
extern char *optarg;
int getopt(int, char **, char *opts);
#endif /* NDB_WIN32 */
#ifdef NDB_ALPHA
#ifdef NDB_GCC /* only for NDB_ALPHA */
extern int gnuShouldNotUseRPCC();
#define RPCC() gnuShouldNotUseRPCC();
#else
#ifdef NDB_WIN32
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
u_int64 __asm(char *, ...);
double __dasm(char *, ...);
float __fasm(char *, ...);
void _AcquireSpinLock(long *);
void _ReleaseSpinLock(long *);
int __ADD_ATOMIC_LONG2(void *, int);
#ifdef __cplusplus
};
#endif /* __cplusplus */
#pragma intrinsic (__asm, __dasm, __fasm)
#pragma intrinsic(_ReleaseSpinLock, _AcquireSpinLock)
#pragma intrinsic(__ADD_ATOMIC_LONG2)
#endif /* NDB_WIN32 */
#define RPCC() ((int)__asm(" rpcc v0;"))
#define MB() __asm(" mb;");
#define WMB() __asm(" wmb;");

View file

@ -225,7 +225,7 @@ public:
const char *m_interface;
};
Vector<Transporter_interface> m_transporter_interface;
void add_transporter_interface(const char *interface, unsigned short port);
void add_transporter_interface(const char *interf, unsigned short port);
protected:
private:

View file

@ -23,7 +23,7 @@
#include "NdbOut.hpp"
class ParserImpl;
template<class T> class ParserRow;
template<class T> struct ParserRow;
//#define PARSER_DEBUG
#ifdef PARSER_DEBUG
@ -130,11 +130,11 @@ public:
* The void* equivalent implementation
*/
class ParserImpl {
public:
class Dummy {};
typedef ParserRow<Dummy> DummyRow;
typedef Parser<Dummy>::Context Context;
template<class T> friend class Parser;
private:
ParserImpl(const DummyRow rows[], class InputStream & in,
bool b_cmd, bool b_empty, bool b_iarg);

View file

@ -51,7 +51,7 @@ public:
struct SP2StructMapping {
Uint16 Key;
Uint32 Offset;
SimpleProperties::ValueType Type;
ValueType Type;
Uint32 minValue;
Uint32 maxValue;
Uint32 Length_Offset; // Offset used for looking up length of
@ -233,7 +233,7 @@ private:
*/
class SimplePropertiesSectionReader : public SimpleProperties::Reader {
public:
SimplePropertiesSectionReader(class SegmentedSectionPtr &,
SimplePropertiesSectionReader(struct SegmentedSectionPtr &,
class SectionSegmentPool &);
virtual void reset();
@ -248,8 +248,8 @@ private:
Uint32 m_pos;
Uint32 m_len;
class SectionSegmentPool & m_pool;
class SectionSegment * m_head;
class SectionSegment * m_currentSegment;
struct SectionSegment * m_head;
struct SectionSegment * m_currentSegment;
};
inline
@ -275,15 +275,15 @@ public:
/**
* This "unlinks" the writer from the memory
*/
void getPtr(class SegmentedSectionPtr & dst);
void getPtr(struct SegmentedSectionPtr & dst);
private:
Int32 m_pos;
Uint32 m_sz;
class SectionSegmentPool & m_pool;
class SectionSegment * m_head;
struct SectionSegment * m_head;
Uint32 m_prevPtrI; // Prev to m_currentSegment
class SectionSegment * m_currentSegment;
struct SectionSegment * m_currentSegment;
};
#endif

View file

@ -98,7 +98,7 @@ public:
*/
void stopSessions(bool wait = false);
void foreachSession(void (*f)(SocketServer::Session*, void*), void *data);
void foreachSession(void (*f)(Session*, void*), void *data);
private:
struct SessionInstance {

View file

@ -16,3 +16,18 @@ libndbclient_la_LIBADD = \
common/logger/liblogger.la \
common/portlib/libportlib.la \
common/util/libgeneral.la
windoze-dsp: libndbclient.dsp
libndbclient.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(ndblib_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ dummy.cpp
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(libndbclient_la_LIBADD)
@touch dummy.cpp

View file

@ -11,3 +11,5 @@ libcommon_la_LIBADD = \
portlib/libportlib.la \
logger/liblogger.la \
util/libgeneral.la
windoze-dsp:

View file

@ -1033,7 +1033,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"Grep::SSCoord:Error code: %d Error message: %s"
" (subId=%d,SubKey=%d)",
err,
GrepError::getErrorDesc((GrepError::Code)err),
GrepError::getErrorDesc((GrepError::GE_Code)err),
subId,
subKey);
break;
@ -1050,7 +1050,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubStartMetaRef:
@ -1066,7 +1066,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubStartDataRef:
@ -1081,7 +1081,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubSyncMetaRef:
@ -1096,7 +1096,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubSyncDataRef:
@ -1113,7 +1113,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subKey,
gci,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepSS_SubRemoveRef:
@ -1128,7 +1128,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err)
GrepError::getErrorDesc((GrepError::GE_Code)err)
);
break;
}
@ -1142,7 +1142,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
"Grep::PSCoord: Error code: %d Error Message: %s"
" (subId=%d,SubKey=%d)",
err,
GrepError::getErrorDesc((GrepError::Code)err),
GrepError::getErrorDesc((GrepError::GE_Code)err),
subId,
subKey);
break;
@ -1159,7 +1159,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubStartMetaRef:
@ -1175,7 +1175,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubStartDataRef:
@ -1190,7 +1190,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubSyncMetaRef:
@ -1205,7 +1205,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubSyncDataRef:
@ -1222,7 +1222,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subKey,
gci,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::GrepPS_SubRemoveRef:
@ -1237,7 +1237,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
subId,
subKey,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}
case GrepEvent::Rep_Disconnect:
@ -1249,7 +1249,7 @@ EventLogger::getText(char * m_text, size_t m_text_len,
" Error code: %d Error Message: %s",
nodeId,
err,
GrepError::getErrorDesc((GrepError::Code)err));
GrepError::getErrorDesc((GrepError::GE_Code)err));
break;
}

View file

@ -21,7 +21,7 @@
*/
const GrepError::ErrorDescription GrepError::errorDescriptions[] = {
{ GrepError::NO_ERROR,
{ GrepError::GE_NO_ERROR,
"No error" },
{ GrepError::SUBSCRIPTION_ID_NOMEM,
"Not enough resources to allocate the subscription" },
@ -119,7 +119,7 @@ GrepError::noOfErrorDescs = sizeof(GrepError::errorDescriptions) /
* gets the corresponding error message to an err code
*/
const char *
GrepError::getErrorDesc(GrepError::Code err) {
GrepError::getErrorDesc(GrepError::GE_Code err) {
for(Uint32 i = 0; i<noOfErrorDescs; i++){
if(err == errorDescriptions[i].errCode){

View file

@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libtrace.dsp
libtrace.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libtrace_la_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -31,7 +31,7 @@ printFSCLOSEREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiv
sig->userReference);
fprintf(output, " Flags: H\'%.8x, ", sig->fileFlag);
if (sig->getRemoveFileFlag(sig->fileFlag) == true)
if (sig->getRemoveFileFlag(sig->fileFlag))
fprintf(output, "Remove file");
else
fprintf(output, "Don't remove file");

View file

@ -31,7 +31,7 @@ printFSREADWRITEREQ(FILE * output, const Uint32 * theData,
fprintf(output, " UserReference: H\'%.8x", sig->userReference);
fprintf(output, " Operation flag: H\'%.8x (", sig->operationFlag);
if (sig->getSyncFlag(sig->operationFlag) == true)
if (sig->getSyncFlag(sig->operationFlag))
fprintf(output, "Sync,");
else
fprintf(output, "No sync,");

View file

@ -32,3 +32,16 @@ include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libsignaldataprint.dsp
libsignaldataprint.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libsignaldataprint_la_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -206,9 +206,9 @@ FileLogHandler::setMaxSize(const BaseString &size) {
long val = strtol(size.c_str(), &end, 0); /* XXX */
if(size.c_str() == end)
return false;
if(strncasecmp("M", end, 1) == 0)
if(end[0] == 'M')
val *= 1024*1024;
if(strncasecmp("k", end, 1) == 0)
if(end[0] == 'k')
val *= 1024;
m_maxFileSize = val;

View file

@ -18,6 +18,7 @@
#define LOGHANDLERLIST_H
class LogHandler;
#include <ndb_global.h>
/**
* Provides a simple linked list of log handlers.

View file

@ -186,9 +186,13 @@ Logger::addHandler(const BaseString &logstring) {
LogHandler *handler = NULL;
if(type == "SYSLOG") {
#ifndef NDB_WIN32
if(type == "SYSLOG")
{
handler = new SysLogHandler();
} else if(type == "FILE")
} else
#endif
if(type == "FILE")
handler = new FileLogHandler();
else if(type == "CONSOLE")
handler = new ConsoleLogHandler();

View file

@ -1,11 +1,25 @@
noinst_LTLIBRARIES = liblogger.la
liblogger_la_SOURCES = Logger.cpp LogHandlerList.cpp LogHandler.cpp \
ConsoleLogHandler.cpp FileLogHandler.cpp SysLogHandler.cpp
SOURCE_WIN = Logger.cpp LogHandlerList.cpp LogHandler.cpp \
ConsoleLogHandler.cpp FileLogHandler.cpp
liblogger_la_SOURCES = $(SOURCE_WIN) SysLogHandler.cpp
include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_ndbapi.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: liblogger.dsp
liblogger.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(SOURCE_WIN)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -144,6 +144,7 @@ ConfigRetriever::getConfig(NdbMgmHandle m_handle){
ndb_mgm_configuration *
ConfigRetriever::getConfig(const char * filename){
#ifndef NDB_WIN32
struct stat sbuf;
const int res = stat(filename, &sbuf);
@ -180,8 +181,10 @@ ConfigRetriever::getConfig(const char * filename){
return 0;
}
delete [] buf2;
return (ndb_mgm_configuration*)cvf.m_cfg;
#else
return 0;
#endif
}
void

View file

@ -12,3 +12,17 @@ include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libmgmsrvcommon.dsp
libmgmsrvcommon.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libmgmsrvcommon_la_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -17,3 +17,27 @@ PortLibTest_SOURCES = NdbPortLibTest.cpp
munmaptest_SOURCES = munmaptest.cpp
# Don't update the files from bitkeeper
WIN_src = win32/NdbCondition.c \
win32/NdbDaemon.c \
win32/NdbEnv.c \
win32/NdbHost.c \
win32/NdbMem.c \
win32/NdbMutex.c \
win32/NdbSleep.c \
win32/NdbTCP.c \
win32/NdbThread.c \
win32/NdbTick.c
windoze-dsp: libportlib.dsp
libportlib.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(WIN_src)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -18,6 +18,7 @@
#include <NdbConfig.h>
#include <NdbEnv.h>
#include <NdbMem.h>
#include <basestring_vsnprintf.h>
static const char *datadir_path= 0;
@ -48,7 +49,7 @@ NdbConfig_AllocHomePath(int _len)
const char *path= NdbConfig_get_path(&path_len);
int len= _len+path_len;
char *buf= NdbMem_Allocate(len);
snprintf(buf, len, "%s%s", path, DIR_SEPARATOR);
basestring_snprintf(buf, len, "%s%s", path, DIR_SEPARATOR);
return buf;
}
@ -67,7 +68,7 @@ NdbConfig_NdbCfgName(int with_ndb_home){
len= strlen(buf);
} else
buf= NdbMem_Allocate(128);
snprintf(buf+len, 128, "Ndb.cfg");
basestring_snprintf(buf+len, 128, "Ndb.cfg");
return buf;
}
@ -77,9 +78,9 @@ char *get_prefix_buf(int len, int node_id)
char tmp_buf[sizeof("ndb_pid#############")+1];
char *buf;
if (node_id > 0)
snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id);
basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_%u", node_id);
else
snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid());
basestring_snprintf(tmp_buf, sizeof(tmp_buf), "ndb_pid%u", getpid());
tmp_buf[sizeof(tmp_buf)-1]= 0;
buf= NdbConfig_AllocHomePath(len+strlen(tmp_buf));
@ -91,7 +92,7 @@ char*
NdbConfig_ErrorFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, "_error.log");
basestring_snprintf(buf+len, 128, "_error.log");
return buf;
}
@ -99,7 +100,7 @@ char*
NdbConfig_ClusterLogFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, "_cluster.log");
basestring_snprintf(buf+len, 128, "_cluster.log");
return buf;
}
@ -107,7 +108,7 @@ char*
NdbConfig_SignalLogFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, "_signal.log");
basestring_snprintf(buf+len, 128, "_signal.log");
return buf;
}
@ -115,7 +116,7 @@ char*
NdbConfig_TraceFileName(int node_id, int file_no){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, "_trace.log.%u", file_no);
basestring_snprintf(buf+len, 128, "_trace.log.%u", file_no);
return buf;
}
@ -123,7 +124,7 @@ char*
NdbConfig_NextTraceFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, "_trace.log.next");
basestring_snprintf(buf+len, 128, "_trace.log.next");
return buf;
}
@ -131,7 +132,7 @@ char*
NdbConfig_PidFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, ".pid");
basestring_snprintf(buf+len, 128, ".pid");
return buf;
}
@ -139,6 +140,6 @@ char*
NdbConfig_StdoutFileName(int node_id){
char *buf= get_prefix_buf(128, node_id);
int len= strlen(buf);
snprintf(buf+len, 128, "_out.log");
basestring_snprintf(buf+len, 128, "_out.log");
return buf;
}

View file

@ -0,0 +1,178 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbCondition.h"
#include <NdbMutex.h>
struct NdbCondition
{
long nWaiters;
NdbMutex* pNdbMutexWaitersLock;
HANDLE hSemaphore;
HANDLE hEventWaitersDone;
int bWasBroadcast;
};
struct NdbCondition*
NdbCondition_Create(void)
{
int result = 0;
struct NdbCondition* pNdbCondition = (struct NdbCondition*)malloc(sizeof(struct NdbCondition));
if(!pNdbCondition)
return 0;
pNdbCondition->nWaiters = 0;
pNdbCondition->bWasBroadcast = 0;
if(!(pNdbCondition->hSemaphore = CreateSemaphore(0, 0, MAXLONG, 0)))
result = -1;
else if(!(pNdbCondition->pNdbMutexWaitersLock = NdbMutex_Create()))
result = -1;
else if(!(pNdbCondition->hEventWaitersDone = CreateEvent(0, 0, 0, 0)))
result = -1;
assert(!result);
return pNdbCondition;
}
int
NdbCondition_Wait(struct NdbCondition* p_cond,
NdbMutex* p_mutex)
{
int result;
int bLastWaiter;
if(!p_cond || !p_mutex)
return 1;
NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
p_cond->nWaiters++;
NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
if(NdbMutex_Unlock(p_mutex))
return -1;
result = WaitForSingleObject (p_cond->hSemaphore, INFINITE);
NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
p_cond->nWaiters--;
bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0);
NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
if(result==WAIT_OBJECT_0 && bLastWaiter)
SetEvent(p_cond->hEventWaitersDone);
NdbMutex_Lock(p_mutex);
return result;
}
int
NdbCondition_WaitTimeout(struct NdbCondition* p_cond,
NdbMutex* p_mutex,
int msecs)
{
int result;
int bLastWaiter;
if (!p_cond || !p_mutex)
return 1;
NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
p_cond->nWaiters++;
NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
if(msecs<0)
msecs = 0;
if(NdbMutex_Unlock(p_mutex))
return -1;
result = WaitForSingleObject(p_cond->hSemaphore, msecs);
NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
p_cond->nWaiters--;
bLastWaiter = (p_cond->bWasBroadcast && p_cond->nWaiters==0);
NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
if(result!=WAIT_OBJECT_0)
result = -1;
if(bLastWaiter)
SetEvent(p_cond->hEventWaitersDone);
NdbMutex_Lock(p_mutex);
return result;
}
int
NdbCondition_Signal(struct NdbCondition* p_cond)
{
int bHaveWaiters;
if(!p_cond)
return 1;
NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
bHaveWaiters = (p_cond->nWaiters > 0);
NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
if(bHaveWaiters)
return (ReleaseSemaphore(p_cond->hSemaphore, 1, 0) ? 0 : -1);
else
return 0;
}
int NdbCondition_Broadcast(struct NdbCondition* p_cond)
{
int bHaveWaiters;
int result = 0;
if(!p_cond)
return 1;
NdbMutex_Lock(p_cond->pNdbMutexWaitersLock);
bHaveWaiters = 0;
if(p_cond->nWaiters > 0)
{
p_cond->bWasBroadcast = !0;
bHaveWaiters = 1;
}
NdbMutex_Unlock(p_cond->pNdbMutexWaitersLock);
if(bHaveWaiters)
{
if(!ReleaseSemaphore(p_cond->hSemaphore, p_cond->nWaiters, 0))
result = -1;
else if(WaitForSingleObject (p_cond->hEventWaitersDone, INFINITE) != WAIT_OBJECT_0)
result = -1;
p_cond->bWasBroadcast = 0;
}
return result;
}
int NdbCondition_Destroy(struct NdbCondition* p_cond)
{
int result;
if(!p_cond)
return 1;
CloseHandle(p_cond->hEventWaitersDone);
NdbMutex_Destroy(p_cond->pNdbMutexWaitersLock);
result = (CloseHandle(p_cond->hSemaphore) ? 0 : -1);
free(p_cond);
return 0;
}

View file

@ -0,0 +1,44 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbDaemon.h"
#define NdbDaemon_ErrorSize 500
long NdbDaemon_DaemonPid;
int NdbDaemon_ErrorCode;
char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
{
// XXX do something
return 0;
}
#ifdef NDB_DAEMON_TEST
int
main()
{
if (NdbDaemon_Make("test.pid", "test.log", 0) == -1) {
fprintf(stderr, "NdbDaemon_Make: %s\n", NdbDaemon_ErrorText);
return 1;
}
sleep(10);
return 0;
}
#endif

View file

@ -0,0 +1,31 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbEnv.h"
const char* NdbEnv_GetEnv(const char* name, char * buf, int buflen)
{
char* p = NULL;
p = getenv(name);
if (p != NULL && buf != NULL){
strncpy(buf, p, buflen);
buf[buflen-1] = 0;
}
return p;
}

View file

@ -0,0 +1,52 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbHost.h"
int NdbHost_GetHostName(char* buf)
{
/* We must initialize TCP/IP if we want to call gethostname */
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD( 2, 0 );
err = WSAStartup( wVersionRequested, &wsaData );
if ( err != 0 ) {
/**
* Tell the user that we couldn't find a usable
* WinSock DLL.
*/
return -1;
}
/* Get host name */
if(gethostname(buf, MAXHOSTNAMELEN))
{
return -1;
}
return 0;
}
int NdbHost_GetProcessId(void)
{
return _getpid();
}

View file

@ -0,0 +1,283 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbMem.h"
#if 0
struct AWEINFO
{
SIZE_T dwSizeInBytesRequested;
ULONG_PTR nNumberOfPagesRequested;
ULONG_PTR nNumberOfPagesActual;
ULONG_PTR nNumberOfPagesFreed;
ULONG_PTR* pnPhysicalMemoryPageArray;
void* pRegionReserved;
};
const size_t cNdbMem_nMaxAWEinfo = 256;
size_t gNdbMem_nAWEinfo = 0;
struct AWEINFO* gNdbMem_pAWEinfo = 0;
void ShowLastError(const char* szContext, const char* szFunction)
{
DWORD dwError = GetLastError();
LPVOID lpMsgBuf;
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
dwError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR)&lpMsgBuf,
0,
NULL
);
printf("%s : %s failed : %lu : %s\n", szContext, szFunction, dwError, (char*)lpMsgBuf);
LocalFree(lpMsgBuf);
}
void NdbMem_Create()
{
// Address Windowing Extensions
struct PRIVINFO
{
DWORD Count;
LUID_AND_ATTRIBUTES Privilege[1];
} Info;
HANDLE hProcess = GetCurrentProcess();
HANDLE hToken;
if(!OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES, &hToken))
{
ShowLastError("NdbMem_Create", "OpenProcessToken");
}
Info.Count = 1;
Info.Privilege[0].Attributes = SE_PRIVILEGE_ENABLED;
if(!LookupPrivilegeValue(0, SE_LOCK_MEMORY_NAME, &(Info.Privilege[0].Luid)))
{
ShowLastError("NdbMem_Create", "LookupPrivilegeValue");
}
if(!AdjustTokenPrivileges(hToken, FALSE, (PTOKEN_PRIVILEGES)&Info, 0, 0, 0))
{
ShowLastError("NdbMem_Create", "AdjustTokenPrivileges");
}
if(!CloseHandle(hToken))
{
ShowLastError("NdbMem_Create", "CloseHandle");
}
return;
}
void NdbMem_Destroy()
{
/* Do nothing */
return;
}
void* NdbMem_Allocate(size_t size)
{
// Address Windowing Extensions
struct AWEINFO* pAWEinfo;
HANDLE hProcess;
SYSTEM_INFO sysinfo;
if(!gNdbMem_pAWEinfo)
{
gNdbMem_pAWEinfo = VirtualAlloc(0,
sizeof(struct AWEINFO)*cNdbMem_nMaxAWEinfo,
MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
}
assert(gNdbMem_nAWEinfo < cNdbMem_nMaxAWEinfo);
pAWEinfo = gNdbMem_pAWEinfo+gNdbMem_nAWEinfo++;
hProcess = GetCurrentProcess();
GetSystemInfo(&sysinfo);
pAWEinfo->nNumberOfPagesRequested = (size+sysinfo.dwPageSize-1)/sysinfo.dwPageSize;
pAWEinfo->pnPhysicalMemoryPageArray = VirtualAlloc(0,
sizeof(ULONG_PTR)*pAWEinfo->nNumberOfPagesRequested,
MEM_COMMIT|MEM_RESERVE, PAGE_READWRITE);
pAWEinfo->nNumberOfPagesActual = pAWEinfo->nNumberOfPagesRequested;
if(!AllocateUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesActual), pAWEinfo->pnPhysicalMemoryPageArray))
{
ShowLastError("NdbMem_Allocate", "AllocateUserPhysicalPages");
return 0;
}
if(pAWEinfo->nNumberOfPagesRequested != pAWEinfo->nNumberOfPagesActual)
{
ShowLastError("NdbMem_Allocate", "nNumberOfPagesRequested != nNumberOfPagesActual");
return 0;
}
pAWEinfo->dwSizeInBytesRequested = size;
pAWEinfo->pRegionReserved = VirtualAlloc(0, pAWEinfo->dwSizeInBytesRequested, MEM_RESERVE | MEM_PHYSICAL, PAGE_READWRITE);
if(!pAWEinfo->pRegionReserved)
{
ShowLastError("NdbMem_Allocate", "VirtualAlloc");
return 0;
}
if(!MapUserPhysicalPages(pAWEinfo->pRegionReserved, pAWEinfo->nNumberOfPagesActual, pAWEinfo->pnPhysicalMemoryPageArray))
{
ShowLastError("NdbMem_Allocate", "MapUserPhysicalPages");
return 0;
}
/*
printf("allocate AWE memory: %lu bytes, %lu pages, address %lx\n",
pAWEinfo->dwSizeInBytesRequested,
pAWEinfo->nNumberOfPagesActual,
pAWEinfo->pRegionReserved);
*/
return pAWEinfo->pRegionReserved;
}
void* NdbMem_AllocateAlign(size_t size, size_t alignment)
{
/*
return (void*)memalign(alignment, size);
TEMP fix
*/
return NdbMem_Allocate(size);
}
void NdbMem_Free(void* ptr)
{
// VirtualFree(ptr, 0, MEM_DECOMMIT|MEM_RELEASE);
// Address Windowing Extensions
struct AWEINFO* pAWEinfo = 0;
size_t i;
HANDLE hProcess;
for(i=0; i<gNdbMem_nAWEinfo; ++i)
{
if(ptr==gNdbMem_pAWEinfo[i].pRegionReserved)
{
pAWEinfo = gNdbMem_pAWEinfo+i;
}
}
if(!pAWEinfo)
{
ShowLastError("NdbMem_Free", "ptr is not AWE memory");
}
hProcess = GetCurrentProcess();
if(!MapUserPhysicalPages(ptr, pAWEinfo->nNumberOfPagesActual, 0))
{
ShowLastError("NdbMem_Free", "MapUserPhysicalPages");
}
if(!VirtualFree(ptr, 0, MEM_RELEASE))
{
ShowLastError("NdbMem_Free", "VirtualFree");
}
pAWEinfo->nNumberOfPagesFreed = pAWEinfo->nNumberOfPagesActual;
if(!FreeUserPhysicalPages(hProcess, &(pAWEinfo->nNumberOfPagesFreed), pAWEinfo->pnPhysicalMemoryPageArray))
{
ShowLastError("NdbMem_Free", "FreeUserPhysicalPages");
}
VirtualFree(pAWEinfo->pnPhysicalMemoryPageArray, 0, MEM_DECOMMIT|MEM_RELEASE);
}
int NdbMem_MemLockAll()
{
/*
HANDLE hProcess = GetCurrentProcess();
SIZE_T nMinimumWorkingSetSize;
SIZE_T nMaximumWorkingSetSize;
GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize);
ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl;
SetProcessWorkingSetSize(hProcess, 50000000, 100000000);
GetProcessWorkingSetSize(hProcess, &nMinimumWorkingSetSize, &nMaximumWorkingSetSize);
ndbout << "nMinimumWorkingSetSize=" << nMinimumWorkingSetSize << ", nMaximumWorkingSetSize=" << nMaximumWorkingSetSize << endl;
*/
return -1;
}
int NdbMem_MemUnlockAll()
{
//VirtualUnlock();
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;
}

View file

@ -0,0 +1,73 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbMutex.h"
NdbMutex* NdbMutex_Create(void)
{
NdbMutex* pNdbMutex = (NdbMutex*)malloc(sizeof(NdbMutex));
if(!pNdbMutex)
return 0;
InitializeCriticalSection(pNdbMutex);
return pNdbMutex;
}
int NdbMutex_Destroy(NdbMutex* p_mutex)
{
if(!p_mutex)
return -1;
DeleteCriticalSection(p_mutex);
free(p_mutex);
return 0;
}
int NdbMutex_Lock(NdbMutex* p_mutex)
{
if(!p_mutex)
return -1;
EnterCriticalSection (p_mutex);
return 0;
}
int NdbMutex_Unlock(NdbMutex* p_mutex)
{
if(!p_mutex)
return -1;
LeaveCriticalSection(p_mutex);
return 0;
}
int NdbMutex_Trylock(NdbMutex* p_mutex)
{
int result = -1;
if(p_mutex)
{
result = NdbMutex_Lock(p_mutex);
//(TryEnterCriticalSection(p_mutex) ? 0 : -1);
}
return result;
}

View file

@ -0,0 +1,32 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbSleep.h"
int
NdbSleep_MilliSleep(int milliseconds)
{
Sleep(milliseconds);
return 0;
}
int
NdbSleep_SecSleep(int seconds)
{
return NdbSleep_MilliSleep(seconds*1000);
}

View file

@ -0,0 +1,39 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbTCP.h"
int
Ndb_getInAddr(struct in_addr * dst, const char *address)
{
struct hostent * hostPtr;
/* Try it as aaa.bbb.ccc.ddd. */
dst->s_addr = inet_addr(address);
if (dst->s_addr != -1) {
return 0;
}
hostPtr = gethostbyname(address);
if (hostPtr != NULL) {
dst->s_addr = ((struct in_addr *) *hostPtr->h_addr_list)->s_addr;
return 0;
}
return -1;
}

View file

@ -0,0 +1,114 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbThread.h"
#include <process.h>
#define MAX_THREAD_NAME 16
typedef unsigned (WINAPI* NDB_WIN32_THREAD_FUNC)(void*);
struct NdbThread
{
HANDLE hThread;
unsigned nThreadId;
char thread_name[MAX_THREAD_NAME];
};
struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
NDB_THREAD_ARG *p_thread_arg,
const NDB_THREAD_STACKSIZE thread_stack_size,
const char* p_thread_name,
NDB_THREAD_PRIO thread_prio)
{
struct NdbThread* tmpThread;
unsigned initflag;
int nPriority = 0;
if(!p_thread_func)
return 0;
tmpThread = (struct NdbThread*)malloc(sizeof(struct NdbThread));
if(!tmpThread)
return 0;
strncpy((char*)&tmpThread->thread_name, p_thread_name, MAX_THREAD_NAME);
switch(thread_prio)
{
case NDB_THREAD_PRIO_HIGHEST: nPriority=THREAD_PRIORITY_HIGHEST; break;
case NDB_THREAD_PRIO_HIGH: nPriority=THREAD_PRIORITY_ABOVE_NORMAL; break;
case NDB_THREAD_PRIO_MEAN: nPriority=THREAD_PRIORITY_NORMAL; break;
case NDB_THREAD_PRIO_LOW: nPriority=THREAD_PRIORITY_BELOW_NORMAL; break;
case NDB_THREAD_PRIO_LOWEST: nPriority=THREAD_PRIORITY_LOWEST; break;
}
initflag = (nPriority ? CREATE_SUSPENDED : 0);
tmpThread->hThread = (HANDLE)_beginthreadex(0, thread_stack_size,
(NDB_WIN32_THREAD_FUNC)p_thread_func, p_thread_arg,
initflag, &tmpThread->nThreadId);
if(nPriority && tmpThread->hThread)
{
SetThreadPriority(tmpThread->hThread, nPriority);
ResumeThread (tmpThread->hThread);
}
assert(tmpThread->hThread);
return tmpThread;
}
void NdbThread_Destroy(struct NdbThread** p_thread)
{
CloseHandle((*p_thread)->hThread);
(*p_thread)->hThread = 0;
free(*p_thread);
*p_thread = 0;
}
int NdbThread_WaitFor(struct NdbThread* p_wait_thread, void** status)
{
void *local_status = 0;
if (status == 0)
status = &local_status;
if(WaitForSingleObject(p_wait_thread->hThread, INFINITE) == WAIT_OBJECT_0
&& GetExitCodeThread(p_wait_thread->hThread, (LPDWORD)status))
{
CloseHandle(p_wait_thread->hThread);
p_wait_thread->hThread = 0;
return 0;
}
return -1;
}
void NdbThread_Exit(int status)
{
_endthreadex((DWORD) status);
}
int NdbThread_SetConcurrencyLevel(int level)
{
return 0;
}

View file

@ -0,0 +1,64 @@
/* 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; either version 2 of the License, or
(at your option) any later version.
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 "NdbTick.h"
//#include <windows.h>
/*
#define FILETIME_PER_MICROSEC 10
#define FILETIME_PER_MILLISEC 10000
#define FILETIME_PER_SEC 10000000
NDB_TICKS NdbTick_CurrentMillisecond(void)
{
ULONGLONG ullTime;
GetSystemTimeAsFileTime((LPFILETIME)&ullTime);
return (ullTime / FILETIME_PER_MILLISEC);
}
int
NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros)
{
ULONGLONG ullTime;
GetSystemTimeAsFileTime((LPFILETIME)&ullTime);
*secs = (ullTime / FILETIME_PER_SEC);
*micros = (Uint32)((ullTime % FILETIME_PER_SEC) / FILETIME_PER_MICROSEC);
return 0;
}
*/
NDB_TICKS NdbTick_CurrentMillisecond(void)
{
LARGE_INTEGER liCount, liFreq;
QueryPerformanceCounter(&liCount);
QueryPerformanceFrequency(&liFreq);
return (liCount.QuadPart*1000) / liFreq.QuadPart;
}
int
NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros)
{
LARGE_INTEGER liCount, liFreq;
QueryPerformanceCounter(&liCount);
QueryPerformanceFrequency(&liFreq);
*secs = liCount.QuadPart / liFreq.QuadPart;
liCount.QuadPart -= *secs * liFreq.QuadPart;
*micros = (liCount.QuadPart*1000000) / liFreq.QuadPart;
return 0;
}

View file

@ -20,3 +20,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libtransporter.dsp
libtransporter.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libtransporter_la_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -95,7 +95,7 @@ Transporter::connect_client() {
return true;
NDB_SOCKET_TYPE sockfd = m_socket_client->connect();
if (sockfd < 0)
if (sockfd == NDB_INVALID_SOCKET)
return false;
// send info about own id

View file

@ -1180,32 +1180,31 @@ TransporterRegistry::stop_clients()
}
void
TransporterRegistry::add_transporter_interface(const char *interface,
unsigned short port)
TransporterRegistry::add_transporter_interface(const char *interf, unsigned short port)
{
DBUG_ENTER("TransporterRegistry::add_transporter_interface");
DBUG_PRINT("enter",("interface=%s, port= %d", interface, port));
if (interface && strlen(interface) == 0)
interface= 0;
DBUG_PRINT("enter",("interface=%s, port= %d", interf, port));
if (interf && strlen(interf) == 0)
interf= 0;
for (unsigned i= 0; i < m_transporter_interface.size(); i++)
{
Transporter_interface &tmp= m_transporter_interface[i];
if (port != tmp.m_service_port)
continue;
if (interface != 0 && tmp.m_interface != 0 &&
strcmp(interface, tmp.m_interface) == 0)
if (interf != 0 && tmp.m_interface != 0 &&
strcmp(interf, tmp.m_interface) == 0)
{
DBUG_VOID_RETURN; // found match, no need to insert
}
if (interface == 0 && tmp.m_interface == 0)
if (interf == 0 && tmp.m_interface == 0)
{
DBUG_VOID_RETURN; // found match, no need to insert
}
}
Transporter_interface t;
t.m_service_port= port;
t.m_interface= interface;
t.m_interface= interf;
m_transporter_interface.push_back(t);
DBUG_PRINT("exit",("interface and port added"));
DBUG_VOID_RETURN;
@ -1214,7 +1213,7 @@ TransporterRegistry::add_transporter_interface(const char *interface,
bool
TransporterRegistry::start_service(SocketServer& socket_server)
{
if (m_transporter_interface.size() > 0 && nodeIdSpecified != true)
if (m_transporter_interface.size() > 0 && !nodeIdSpecified)
{
ndbout_c("TransporterRegistry::startReceiving: localNodeId not specified");
return false;

View file

@ -19,6 +19,7 @@
#include <File.hpp>
#include <NdbOut.hpp>
#include <my_dir.h>
//
// PUBLIC
@ -28,9 +29,12 @@ bool
File_class::exists(const char* aFileName)
{
bool rc = true;
#ifdef USE_MY_STAT_STRUCT
struct my_stat stmp;
#else
struct stat stmp;
if (::stat(aFileName, &stmp) != 0)
#endif
if (my_stat(aFileName, &stmp, MYF(0)) != 0)
{
rc = false;
}

View file

@ -33,3 +33,17 @@ include $(top_srcdir)/ndb/config/type_util.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libgeneral.dsp
libgeneral.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LTLIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libgeneral_la_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -881,7 +881,7 @@ PropertiesImpl::unpack(const Uint32 * buf, Uint32 &bufLen, Properties * top,
case PropertiesType_Properties:
assert(0);
}
if(res3 != true){
if(!res3){
return false;
}
_items--;

View file

@ -26,14 +26,14 @@ SocketClient::SocketClient(const char *server_name, unsigned short port, SocketA
m_auth= sa;
m_port= port;
m_server_name= strdup(server_name);
m_sockfd= -1;
m_sockfd= NDB_INVALID_SOCKET;
}
SocketClient::~SocketClient()
{
if (m_server_name)
free(m_server_name);
if (m_sockfd >= 0)
if (m_sockfd != NDB_INVALID_SOCKET)
NDB_CLOSE_SOCKET(m_sockfd);
if (m_auth)
delete m_auth;
@ -42,7 +42,7 @@ SocketClient::~SocketClient()
bool
SocketClient::init()
{
if (m_sockfd >= 0)
if (m_sockfd != NDB_INVALID_SOCKET)
NDB_CLOSE_SOCKET(m_sockfd);
memset(&m_servaddr, 0, sizeof(m_servaddr));
@ -63,32 +63,32 @@ SocketClient::init()
NDB_SOCKET_TYPE
SocketClient::connect()
{
if (m_sockfd < 0)
if (m_sockfd == NDB_INVALID_SOCKET)
{
if (!init()) {
#ifdef VM_TRACE
ndbout << "SocketClient::connect() failed " << m_server_name << " " << m_port << endl;
#endif
return -1;
return NDB_INVALID_SOCKET;
}
}
const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr));
if (r == -1) {
NDB_CLOSE_SOCKET(m_sockfd);
m_sockfd= -1;
return -1;
m_sockfd= NDB_INVALID_SOCKET;
return NDB_INVALID_SOCKET;
}
if (m_auth) {
if (!m_auth->client_authenticate(m_sockfd))
{
NDB_CLOSE_SOCKET(m_sockfd);
m_sockfd= -1;
return -1;
m_sockfd= NDB_INVALID_SOCKET;
return NDB_INVALID_SOCKET;
}
}
NDB_SOCKET_TYPE sockfd= m_sockfd;
m_sockfd= -1;
m_sockfd= NDB_INVALID_SOCKET;
return sockfd;
}

View file

@ -20,10 +20,12 @@
#include <basestring_vsnprintf.h>
#include <my_config.h>
/*
#ifdef _WINDOWS
#define SNPRINTF_RETURN_TRUNC
*/
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
int
basestring_snprintf(char *str, size_t size, const char *format, ...)
{
@ -35,16 +37,6 @@ basestring_snprintf(char *str, size_t size, const char *format, ...)
return(ret);
}
#ifdef HAVE_SNPRINTF
#define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
#else
#define SNPRINTF_RETURN_TRUNC
/* #define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) my_vsnprintf(a,b,c,d)
* we would like to use my_vsnprintf but it does not have enough features
* Let's hope vsnprintf works anyways
*/
#define BASESTRING_VSNPRINTF_FUNC(a,b,c,d) vsnprintf(a,b,c,d)
#endif
#ifdef SNPRINTF_RETURN_TRUNC
static char basestring_vsnprintf_buf[16*1024];
#endif
@ -54,20 +46,20 @@ basestring_vsnprintf(char *str, size_t size, const char *format, va_list ap)
if (size == 0)
{
#ifdef SNPRINTF_RETURN_TRUNC
return BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
return vsnprintf(basestring_vsnprintf_buf,
sizeof(basestring_vsnprintf_buf),
format, ap);
#else
char buf[1];
return BASESTRING_VSNPRINTF_FUNC(buf, 1, format, ap);
return vsnprintf(buf, 1, format, ap);
#endif
}
{
int ret= BASESTRING_VSNPRINTF_FUNC(str, size, format, ap);
int ret= vsnprintf(str, size, format, ap);
#ifdef SNPRINTF_RETURN_TRUNC
if (ret == size-1 || ret == -1)
{
ret= BASESTRING_VSNPRINTF_FUNC(basestring_vsnprintf_buf,
ret= vsnprintf(basestring_vsnprintf_buf,
sizeof(basestring_vsnprintf_buf),
format, ap);
}

View file

@ -17,6 +17,7 @@
#include <ndb_global.h>
#include <ndb_version.h>
#include <version.h>
#include <basestring_vsnprintf.h>
Uint32 getMajor(Uint32 version) {
return (version >> 16) & 0xFF;
@ -38,14 +39,14 @@ Uint32 makeVersion(Uint32 major, Uint32 minor, Uint32 build) {
const char * getVersionString(Uint32 version, const char * status) {
char buff[100];
if (status && status[0] != 0)
snprintf(buff, sizeof(buff),
basestring_snprintf(buff, sizeof(buff),
"Version %d.%d.%d (%s)",
getMajor(version),
getMinor(version),
getBuild(version),
status);
else
snprintf(buff, sizeof(buff),
basestring_snprintf(buff, sizeof(buff),
"Version %d.%d.%d",
getMajor(version),
getMinor(version),

View file

@ -1 +1,4 @@
SUBDIRS = cpcd
windoze-dsp:

View file

@ -16,3 +16,5 @@ ndb_cpcd_LDFLAGS = @ndb_bin_am_ldflags@
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp:

View file

@ -59,3 +59,17 @@ LDADD += \
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: ndbd.dsp
ndbd.dsp: Makefile \
$(top_srcdir)/ndb/config/win-prg.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-prg.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(ndbbin_PROGRAMS)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(ndbd_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LINK $(LDADD)

View file

@ -15,3 +15,5 @@ SUBDIRS = \
suma \
grep \
dbtux
windoze-dsp:

View file

@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libbackup.dsp
libbackup.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libbackup_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -150,6 +150,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
ndbrequire(false);
}
#ifndef NDB_WIN32
if(ERROR_INSERTED(9996)){
simulate_error_during_shutdown= SIGSEGV;
ndbrequire(false);
@ -159,6 +160,7 @@ void Cmvmi::execNDB_TAMPER(Signal* signal)
simulate_error_during_shutdown= SIGSEGV;
kill(getpid(), SIGABRT);
}
#endif
}//execNDB_TAMPER()
void Cmvmi::execSET_LOGLEVELORD(Signal* signal)

View file

@ -8,3 +8,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libcmvmi.dsp
libcmvmi.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libcmvmi_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbacc.dsp
libdbacc.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbacc_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -527,7 +527,7 @@ Dbdict::writeTableFile(Signal* signal, Uint32 tableId,
Uint32 sz = tabInfoPtr.sz + ZPAGE_HEADER_SIZE;
c_writeTableRecord.noOfPages = DIV(sz, ZSIZE_OF_PAGES_IN_WORDS);
c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK;
c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK;
c_writeTableRecord.m_callback = * callback;
c_writeTableRecord.pageId = 0;
@ -646,7 +646,7 @@ void Dbdict::closeWriteTableConf(Signal* signal,
case WriteTableRecord::WRITE_RESTART_FROM_OWN :
ndbrequire(false);
break;
case WriteTableRecord::CALLBACK:
case WriteTableRecord::TWR_CALLBACK:
jam();
execute(signal, c_writeTableRecord.m_callback, 0);
return;
@ -2380,7 +2380,7 @@ Dbdict::restartCreateTab_readTableConf(Signal* signal,
ndbrequire(c_writeTableRecord.tableWriteState == WriteTableRecord::IDLE);
c_writeTableRecord.noOfPages = c_readTableRecord.noOfPages;
c_writeTableRecord.pageId = c_readTableRecord.pageId;
c_writeTableRecord.tableWriteState = WriteTableRecord::CALLBACK;
c_writeTableRecord.tableWriteState = WriteTableRecord::TWR_CALLBACK;
c_writeTableRecord.m_callback.m_callbackData = callbackData;
c_writeTableRecord.m_callback.m_callbackFunction =
safe_cast(&Dbdict::restartCreateTab_writeTableConf);

View file

@ -641,7 +641,7 @@ private:
WRITE_ADD_TABLE_SLAVE = 2,
WRITE_RESTART_FROM_MASTER = 3,
WRITE_RESTART_FROM_OWN = 4,
CALLBACK = 5
TWR_CALLBACK = 5
};
TableWriteState tableWriteState;
Callback m_callback;

View file

@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbdict.dsp
libdbdict.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbdict_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -1468,7 +1468,7 @@ private:
Uint32 c_blockCommitNo;
bool getBlockCommit() const {
return c_blockCommit == true || cgckptflag == true;
return c_blockCommit || cgckptflag;
}
/**

View file

@ -12941,7 +12941,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
Uint32 nodeOrder[MAX_REPLICAS];
const Uint32 noOfReplicas = extractNodeInfo(fragPtr.p, nodeOrder);
char buf[100];
snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j);
BaseString::snprintf(buf, sizeof(buf), " Table %d Fragment %d - ", tabPtr.i, j);
for(Uint32 k = 0; k < noOfReplicas; k++){
char tmp[100];
BaseString::snprintf(tmp, sizeof(tmp), "%d ", nodeOrder[k]);
@ -13152,7 +13152,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal)
getFragstore(tabPtr.p, fid, fragPtr);
char buf[100], buf2[100];
snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
BaseString::snprintf(buf, sizeof(buf), " Fragment %d: noLcpReplicas==%d ",
fid, fragPtr.p->noLcpReplicas);
Uint32 num=0;

View file

@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbdih.dsp
libdbdih.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbdih_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdblqh.dsp
libdblqh.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdblqh_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -6498,7 +6498,7 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
*------------------------------------------------------------------*/
char buf[96]; buf[0] = 0;
char buf2[96];
snprintf(buf, sizeof(buf), "TC %d: %d ops:",
BaseString::snprintf(buf, sizeof(buf), "TC %d: %d ops:",
__LINE__, apiConnectptr.i);
for(Uint32 i = 0; i<TloopCount; i++){
BaseString::snprintf(buf2, sizeof(buf2), "%s %d", buf, tmp[i]);

View file

@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbtc.dsp
libdbtc.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbtc_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -25,3 +25,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbtup.dsp
libdbtup.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbtup_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -18,3 +18,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbtux.dsp
libdbtux.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbtux_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libdbutil.dsp
libdbutil.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libdbutil_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -603,7 +603,7 @@ Grep::PSCoord::execCREATE_SUBID_CONF(Signal* signal)
GrepEvent::GrepPS_CreateSubIdConf,
subId,
subKey,
(Uint32)GrepError::NO_ERROR);
(Uint32)GrepError::GE_NO_ERROR);
}
void
@ -612,7 +612,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) {
CreateSubscriptionIdRef const * ref =
(CreateSubscriptionIdRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
GrepError::Code err;
GrepError::GE_Code err;
Uint32 sendersBlockRef = signal->getSendersBlockRef();
if(sendersBlockRef == SUMA_REF)
@ -624,7 +624,7 @@ Grep::PSCoord::execCREATE_SUBID_REF(Signal* signal) {
ndbrequire(false); /* Added since errorcode err unhandled
* TODO: fix correct errorcode
*/
err= GrepError::NO_ERROR; // remove compiler warning
err= GrepError::GE_NO_ERROR; // remove compiler warning
}
SubCoordinatorPtr subPtr;
@ -824,7 +824,7 @@ Grep::PSPart::execSUB_CREATE_REF(Signal* signal)
jamEntry();
SubCreateRef * const ref = (SubCreateRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
GrepError::Code err = (GrepError::Code)ref->err;
GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
sendRefToPSCoord(signal, *subPtr.p, err /*error*/);
@ -867,7 +867,7 @@ Grep::PSCoord::execGREP_CREATE_CONF(Signal* signal)
GrepEvent::GrepPS_SubCreateConf,
subId,
subKey,
(Uint32)GrepError::NO_ERROR);
(Uint32)GrepError::GE_NO_ERROR);
c_subCoordinatorPool.release(subPtr);
@ -889,7 +889,7 @@ Grep::PSCoord::execGREP_CREATE_REF(Signal* signal)
SubCoordinatorPtr subPtr;
c_runningSubscriptions.getPtr(subPtr, subData);
sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/);
sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/);
}
@ -1046,7 +1046,7 @@ Grep::PSPart::execSUB_START_REF(Signal* signal)
{
SubStartRef * const ref = (SubStartRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
GrepError::Code err = (GrepError::Code)ref->err;
GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
@ -1102,7 +1102,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal)
EventReport::GrepSubscriptionInfo,
GrepEvent::GrepPS_SubStartMetaConf,
subId, subKey,
(Uint32)GrepError::NO_ERROR);
(Uint32)GrepError::GE_NO_ERROR);
c_subCoordinatorPool.release(subPtr);
break;
@ -1118,7 +1118,7 @@ Grep::PSCoord::execGREP_START_CONF(Signal* signal)
EventReport::GrepSubscriptionInfo,
GrepEvent::GrepPS_SubStartDataConf,
subId, subKey,
(Uint32)GrepError::NO_ERROR);
(Uint32)GrepError::GE_NO_ERROR);
c_subCoordinatorPool.release(subPtr);
@ -1145,7 +1145,7 @@ Grep::PSCoord::execGREP_START_REF(Signal* signal)
jamEntry();
GrepStartRef * const ref = (GrepStartRef *)signal->getDataPtr();
Uint32 subData = ref->senderData;
GrepError::Code err = (GrepError::Code)ref->err;
GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
SubCoordinatorPtr subPtr;
@ -1301,7 +1301,7 @@ Grep::PSPart::execSUB_REMOVE_REF(Signal* signal)
jamEntry();
SubRemoveRef * const ref = (SubRemoveRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
/* GrepError::Code err = (GrepError::Code)ref->err;*/
/* GrepError::GE_Code err = (GrepError::GE_Code)ref->err;*/
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subData);
@ -1342,7 +1342,7 @@ Grep::PSCoord::execGREP_REMOVE_CONF(Signal* signal)
EventReport::GrepSubscriptionInfo,
GrepEvent::GrepPS_SubRemoveConf,
subId, subKey,
GrepError::NO_ERROR);
GrepError::GE_NO_ERROR);
GrepSubRemoveConf * grepConf = (GrepSubRemoveConf *) conf;
grepConf->subscriptionId = subId;
@ -1375,7 +1375,7 @@ Grep::PSCoord::execGREP_REMOVE_REF(Signal* signal)
subPtr.p = c_runningSubscriptions.getPtr(subPtr.i);
if(subData == subPtr.i)
{
sendRefToSS(signal, *subPtr.p, (GrepError::Code)err /*error*/);
sendRefToSS(signal, *subPtr.p, (GrepError::GE_Code)err /*error*/);
c_runningSubscriptions.release(subPtr);
return;
}
@ -1633,7 +1633,7 @@ Grep::PSPart::execSUB_SYNC_REF(Signal* signal) {
jamEntry();
SubSyncRef * const ref = (SubSyncRef *)signal->getDataPtr();
Uint32 subData = ref->subscriberData;
GrepError::Code err = (GrepError::Code)ref->err;
GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
SubscriptionPtr subPtr;
@ -1677,7 +1677,7 @@ Grep::PSCoord::execGREP_SYNC_CONF(Signal* signal)
/* @todo Johan: Add firstGCI here. /Lars */
m_grep->sendEventRep(signal, EventReport::GrepSubscriptionInfo,
event, subId, subKey,
(Uint32)GrepError::NO_ERROR,
(Uint32)GrepError::GE_NO_ERROR,
lastGCI);
/*************************
@ -1707,7 +1707,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) {
GrepSyncRef * const ref = (GrepSyncRef *)signal->getDataPtr();
Uint32 subData = ref->senderData;
SubscriptionData::Part part = (SubscriptionData::Part)ref->part;
GrepError::Code err = (GrepError::Code)ref->err;
GrepError::GE_Code err = (GrepError::GE_Code)ref->err;
SubCoordinatorPtr subPtr;
c_runningSubscriptions.getPtr(subPtr, subData);
sendRefToSS(signal, *subPtr.p, err /*error*/, part);
@ -1718,7 +1718,7 @@ Grep::PSCoord::execGREP_SYNC_REF(Signal* signal) {
void
Grep::PSCoord::sendRefToSS(Signal * signal,
SubCoordinator sub,
GrepError::Code err,
GrepError::GE_Code err,
SubscriptionData::Part part) {
/**
@ -1843,7 +1843,7 @@ Grep::PSCoord::sendRefToSS(Signal * signal,
void
Grep::PSPart::sendRefToPSCoord(Signal * signal,
Subscription sub,
GrepError::Code err,
GrepError::GE_Code err,
SubscriptionData::Part part) {
jam();

View file

@ -380,16 +380,16 @@ public:
Uint32 subId,
Uint32 subKey,
BlockReference to,
GrepError::Code err);
GrepError::GE_Code err);
void sendSubRemoveRef_SS(Signal * signal,
SubCoordinator sub,
GrepError::Code err);
GrepError::GE_Code err);
void sendRefToSS(Signal * signal,
SubCoordinator sub,
GrepError::Code err,
GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
void setRepRef(BlockReference rr) { m_repRef = rr; };
@ -496,7 +496,7 @@ public:
void sendRefToPSCoord(Signal * signal,
Subscription sub,
GrepError::Code err,
GrepError::GE_Code err,
SubscriptionData::Part part = (SubscriptionData::Part)0);
//protected:

View file

@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libgrep.dsp
libgrep.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libgrep_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -10,3 +10,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libndbcntr.dsp
libndbcntr.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libndbcntr_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -11,3 +11,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libndbfs.dsp
libndbfs.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libndbfs_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -730,7 +730,7 @@ Ndbfs::scanIPC(Signal* signal)
jam();
report(request, signal);
theRequestPool->put(request);
return &request;
return true;
}
return false;
}

View file

@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libqmgr.dsp
libqmgr.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libqmgr_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libsuma.dsp
libsuma.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libsuma_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -7,3 +7,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: libtrix.dsp
libtrix.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(libtrix_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -9,3 +9,17 @@ include $(top_srcdir)/ndb/config/type_kernel.mk.am
# Don't update the files from bitkeeper
%::SCCS/s.%
windoze-dsp: liberror.dsp
liberror.dsp: Makefile \
$(top_srcdir)/ndb/config/win-lib.am \
$(top_srcdir)/ndb/config/win-name \
$(top_srcdir)/ndb/config/win-includes \
$(top_srcdir)/ndb/config/win-sources \
$(top_srcdir)/ndb/config/win-libraries
cat $(top_srcdir)/ndb/config/win-lib.am > $@
@$(top_srcdir)/ndb/config/win-name $@ $(noinst_LIBRARIES)
@$(top_srcdir)/ndb/config/win-includes $@ $(INCLUDES)
@$(top_srcdir)/ndb/config/win-sources $@ $(liberror_a_SOURCES)
@$(top_srcdir)/ndb/config/win-libraries $@ LIB $(LDADD)

View file

@ -69,11 +69,13 @@ int main(int argc, char** argv)
}
{ // Do configuration
#ifndef NDB_WIN32
signal(SIGPIPE, SIG_IGN);
#endif
theConfig->fetch_configuration();
}
chdir(NdbConfig_get_path(0));
my_setwd(NdbConfig_get_path(0), MYF(0));
if (theConfig->getDaemonMode()) {
// Become a daemon
@ -87,6 +89,7 @@ int main(int argc, char** argv)
}
}
#ifndef NDB_WIN32
for(pid_t child = fork(); child != 0; child = fork()){
/**
* Parent
@ -137,6 +140,9 @@ int main(int argc, char** argv)
}
g_eventLogger.info("Angel pid: %d ndb pid: %d", getppid(), getpid());
#else
g_eventLogger.info("Ndb started");
#endif
theConfig->setupConfiguration();
systemInfo(* theConfig, * theConfig->m_logLevel);
@ -268,7 +274,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
void
catchsigs(bool ignore){
#if ! defined NDB_SOFTOSE && !defined NDB_OSE
#if !defined NDB_WIN32 && !defined NDB_SOFTOSE && !defined NDB_OSE
static const int signals_shutdown[] = {
#ifdef SIGBREAK
@ -310,7 +316,6 @@ catchsigs(bool ignore){
SIGTRAP
#endif
};
#endif
static const int signals_ignore[] = {
SIGPIPE
@ -323,6 +328,7 @@ catchsigs(bool ignore){
handler_register(signals_error[i], handler_error, ignore);
for(i = 0; i < sizeof(signals_ignore)/sizeof(signals_ignore[0]); i++)
handler_register(signals_ignore[i], SIG_IGN, ignore);
#endif
}
extern "C"
@ -341,8 +347,10 @@ handler_error(int signum){
if (thread_id != 0 && thread_id == my_thread_id())
{
// Shutdown thread received signal
#ifndef NDB_WIN32
signal(signum, SIG_DFL);
kill(getpid(), signum);
#endif
while(true)
NdbSleep_MilliSleep(10);
}

View file

@ -20,12 +20,5 @@
/**
* Block callbacks
*/
typedef void (SimulatedBlock::* CallbackFunction)(class Signal*,
Uint32 callbackData,
Uint32 returnCode);
struct Callback {
CallbackFunction m_callbackFunction;
Uint32 m_callbackData;
};
#endif

View file

@ -281,8 +281,8 @@ static char * get_and_validate_path(ndb_mgm_configuration_iterator &iter,
memset(buf2, 0,sizeof(buf2));
#ifdef NDB_WIN32
char* szFilePart;
if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart)
|| (::GetFileAttributes(alloc_path)&FILE_ATTRIBUTE_READONLY))
if(!GetFullPathName(path, sizeof(buf2), buf2, &szFilePart) ||
(GetFileAttributes(buf2) & FILE_ATTRIBUTE_READONLY))
#else
if((::realpath(path, buf2) == NULL)||
(::access(buf2, W_OK) != 0))
@ -561,7 +561,7 @@ Configuration::calcSizeAlt(ConfigValues * ownConfig){
noOfDBNodes++; // No of NDB processes
if(nodeId > MAX_NDB_NODES){
snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
BaseString::snprintf(buf, sizeof(buf), "Maximum node id for a ndb node is: %d",
MAX_NDB_NODES);
ERROR_SET(fatal, ERR_INVALID_CONFIG, msg, buf);
}

Some files were not shown because too many files have changed in this diff Show more