Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4a3e1d1a
Commit
4a3e1d1a
authored
Nov 10, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:wl1744 into w2k.:C:/mysql-4.1
parents
b8ad65ba
63b40952
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
71 additions
and
99 deletions
+71
-99
ndb/include/logger/SysLogHandler.hpp
ndb/include/logger/SysLogHandler.hpp
+3
-1
ndb/include/ndb_global.h
ndb/include/ndb_global.h
+21
-24
ndb/include/portlib/PortDefs.h
ndb/include/portlib/PortDefs.h
+0
-43
ndb/src/common/mgmcommon/NdbConfig.c
ndb/src/common/mgmcommon/NdbConfig.c
+12
-11
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+2
-0
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+2
-2
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
+1
-1
ndb/src/kernel/main.cpp
ndb/src/kernel/main.cpp
+14
-6
ndb/src/kernel/vm/Configuration.cpp
ndb/src/kernel/vm/Configuration.cpp
+4
-4
ndb/src/kernel/vm/Emulator.cpp
ndb/src/kernel/vm/Emulator.cpp
+3
-1
ndb/src/mgmsrv/CommandInterpreter.cpp
ndb/src/mgmsrv/CommandInterpreter.cpp
+5
-4
ndb/src/mgmsrv/main.cpp
ndb/src/mgmsrv/main.cpp
+3
-1
scripts/make_win_src_distribution.sh
scripts/make_win_src_distribution.sh
+1
-1
No files found.
ndb/include/logger/SysLogHandler.hpp
View file @
4a3e1d1a
...
...
@@ -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.
...
...
ndb/include/ndb_global.h
View file @
4a3e1d1a
...
...
@@ -2,16 +2,23 @@
#ifndef NDBGLOBAL_H
#define NDBGLOBAL_H
#include <my_global.h>
/** signal & SIG_PIPE */
#include <my_alarm.h>
#include <ndb_types.h>
#if defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(WIN32)
#define NDB_WIN32
#include <winsock2.h>
#include <my_global.h>
#include <m_ctype.h>
#define PATH_MAX 256
#define DIR_SEPARATOR "\\"
#pragma warning(disable: 4503 4786)
#else
#undef NDB_WIN32
#endif
#include <my_global.h>
#include <my_alarm.h>
#ifdef _AIX
#undef _H_STRINGS
...
...
@@ -47,23 +54,22 @@
#include <sys/mman.h>
#endif
#ifdef NDB_WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#define DIR_SEPARATOR "\\"
#define PATH_MAX 256
#define DIR_SEPARATOR "/"
#pragma warning(disable: 4503 4786)
#else
#endif
#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,15 +90,6 @@ 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
);
#endif
#ifdef SCO
#ifndef PATH_MAX
...
...
ndb/include/portlib/PortDefs.h
View file @
4a3e1d1a
...
...
@@ -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;");
...
...
ndb/src/common/mgmcommon/NdbConfig.c
View file @
4a3e1d1a
...
...
@@ -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
;
}
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
View file @
4a3e1d1a
...
...
@@ -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
)
...
...
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
View file @
4a3e1d1a
...
...
@@ -12944,7 +12944,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
]);
...
...
@@ -13155,7 +13155,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
;
...
...
ndb/src/kernel/blocks/ndbfs/Ndbfs.cpp
View file @
4a3e1d1a
...
...
@@ -730,7 +730,7 @@ Ndbfs::scanIPC(Signal* signal)
jam
();
report
(
request
,
signal
);
theRequestPool
->
put
(
request
);
return
&
request
;
return
true
;
}
return
false
;
}
...
...
ndb/src/kernel/main.cpp
View file @
4a3e1d1a
...
...
@@ -77,11 +77,13 @@ int main(int argc, char** argv)
}
{
// Do configuration
#ifndef NDB_WIN32
signal
(
SIGPIPE
,
SIG_IGN
);
#endif
theConfig
->
fetch_configuration
(
local_config
);
}
chdir
(
NdbConfig_get_path
(
0
));
my_setwd
(
NdbConfig_get_path
(
0
),
MYF
(
0
));
if
(
theConfig
->
getDaemonMode
())
{
// Become a daemon
...
...
@@ -95,6 +97,7 @@ int main(int argc, char** argv)
}
}
#ifndef NDB_WIN32
for
(
pid_t
child
=
fork
();
child
!=
0
;
child
=
fork
()){
/**
* Parent
...
...
@@ -145,6 +148,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
);
...
...
@@ -276,7 +282,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
...
...
@@ -318,7 +324,6 @@ catchsigs(bool ignore){
SIGTRAP
#endif
};
#endif
static
const
int
signals_ignore
[]
=
{
SIGPIPE
...
...
@@ -331,6 +336,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"
...
...
@@ -349,8 +355,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
);
}
...
...
ndb/src/kernel/vm/Configuration.cpp
View file @
4a3e1d1a
...
...
@@ -278,8 +278,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
))
...
...
ndb/src/kernel/vm/Emulator.cpp
View file @
4a3e1d1a
...
...
@@ -180,11 +180,13 @@ NdbShutdown(NdbShutdownType type,
#endif
}
#ifndef NDB_WIN32
if
(
simulate_error_during_shutdown
)
{
kill
(
getpid
(),
simulate_error_during_shutdown
);
while
(
true
)
NdbSleep_MilliSleep
(
10
);
}
#endif
globalEmulatorData
.
theWatchDog
->
doStop
();
...
...
ndb/src/mgmsrv/CommandInterpreter.cpp
View file @
4a3e1d1a
...
...
@@ -28,7 +28,7 @@
#include "ConfigInfo.hpp"
#include <version.h>
#include <m_string.h>
static
const
char
*
helpTexts
[]
=
{
"HELP Print help text"
,
...
...
@@ -492,7 +492,7 @@ void CommandInterpreter::executeClusterLog(char* parameters) {
noArgs
=
true
;
}
while
(
item
!=
NULL
)
{
snprintf
(
name
,
12
,
item
);
BaseString
::
snprintf
(
name
,
12
,
item
);
if
(
strcmp
(
item
,
"ALL"
)
==
0
)
{
severity
=
7
;
...
...
@@ -740,9 +740,10 @@ CommandInterpreter::executeDumpState(int processId, const char* parameters,
char
*
tmpString
=
strdup
(
parameters
);
char
*
tmpPtr
=
0
;
char
*
item
=
strtok_r
(
tmpString
,
" "
,
&
tmpPtr
);
int
error
;
while
(
item
!=
NULL
){
if
(
0x0
<=
strtoll
(
item
,
NULL
,
0
)
&&
strtoll
(
item
,
NULL
,
0
)
<=
0xffffffff
)
{
pars
[
no
]
=
strtoll
(
item
,
NULL
,
0
);
if
(
0x0
<=
my_strtoll10
(
item
,
NULL
,
&
error
)
&&
my_strtoll10
(
item
,
NULL
,
&
error
)
<=
0xffffffff
)
{
pars
[
no
]
=
my_strtoll10
(
item
,
NULL
,
&
error
);
}
else
{
ndbout
<<
"Illegal value in argument to signal."
<<
endl
<<
"(Value must be between 0 and 0xffffffff.)"
...
...
ndb/src/mgmsrv/main.cpp
View file @
4a3e1d1a
...
...
@@ -231,7 +231,7 @@ int main(int argc, char** argv)
local_config
,
glob
.
cluster_config
);
chdir
(
NdbConfig_get_path
(
0
));
my_setwd
(
NdbConfig_get_path
(
0
),
MYF
(
0
));
glob
.
cluster_config
=
0
;
glob
.
localNodeId
=
glob
.
mgmObject
->
getOwnNodeId
();
...
...
@@ -294,7 +294,9 @@ int main(int argc, char** argv)
}
}
#ifndef NDB_WIN32
signal
(
SIGPIPE
,
SIG_IGN
);
#endif
{
BaseString
error_string
;
if
(
!
glob
.
mgmObject
->
start
(
error_string
)){
...
...
scripts/make_win_src_distribution.sh
View file @
4a3e1d1a
...
...
@@ -246,7 +246,7 @@ done
#
# Create project files for ndb
#
make
-C
ndb windoze
make
-C
$SOURCE
/
ndb windoze
#
# Input directories to be copied recursively
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment