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
f16e5a0a
Commit
f16e5a0a
authored
Jul 09, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed some macros
and moved some code. Improve portability
parent
664329b5
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
55 additions
and
108 deletions
+55
-108
ndb/include/kernel/signaldata/SignalData.hpp
ndb/include/kernel/signaldata/SignalData.hpp
+3
-13
ndb/include/mgmcommon/MgmtErrorReporter.hpp
ndb/include/mgmcommon/MgmtErrorReporter.hpp
+0
-6
ndb/include/util/Bitmask.hpp
ndb/include/util/Bitmask.hpp
+3
-8
ndb/src/common/debugger/SignalLoggerManager.cpp
ndb/src/common/debugger/SignalLoggerManager.cpp
+0
-25
ndb/src/kernel/Main.cpp
ndb/src/kernel/Main.cpp
+2
-2
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
+1
-1
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
+1
-1
ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
+1
-2
ndb/src/kernel/blocks/ndbfs/Pool.hpp
ndb/src/kernel/blocks/ndbfs/Pool.hpp
+0
-1
ndb/src/kernel/error/ErrorReporter.hpp
ndb/src/kernel/error/ErrorReporter.hpp
+0
-29
ndb/src/kernel/vm/MetaData.cpp
ndb/src/kernel/vm/MetaData.cpp
+1
-1
ndb/src/kernel/vm/SimulatedBlock.cpp
ndb/src/kernel/vm/SimulatedBlock.cpp
+6
-6
ndb/src/kernel/vm/SimulatedBlock.hpp
ndb/src/kernel/vm/SimulatedBlock.hpp
+2
-2
ndb/src/kernel/vm/TransporterCallback.cpp
ndb/src/kernel/vm/TransporterCallback.cpp
+24
-1
ndb/src/mgmclient/CommandInterpreter.cpp
ndb/src/mgmclient/CommandInterpreter.cpp
+2
-2
ndb/src/mgmsrv/MgmtSrvr.cpp
ndb/src/mgmsrv/MgmtSrvr.cpp
+1
-1
ndb/src/ndbapi/TransporterFacade.cpp
ndb/src/ndbapi/TransporterFacade.cpp
+8
-7
No files found.
ndb/include/kernel/signaldata/SignalData.hpp
View file @
f16e5a0a
...
...
@@ -21,20 +21,10 @@
#include <ndb_limits.h>
#include <kernel_types.h>
#ifndef NDB_ASSERT
#ifdef VM_TRACE
#define NDB_ASSERT(test, message) { if(!(test)) { printf(message); exit(-1); }}
#else
#define NDB_ASSERT(test, message)
#endif
#endif
// Useful ASSERT macros...
#define ASSERT_BOOL(flag, message) NDB_ASSERT( (flag<=1), (message) )
#define ASSERT_BOOL(flag, message) assert(flag<=1)
#define ASSERT_RANGE(value, min, max, message) \
NDB_ASSERT((value) >= (min) && (value) <= (max), (message))
#define ASSERT_MAX(value, max, message) \
NDB_ASSERT((value) <= (max), (message))
assert((value) >= (min) && (value) <= (max))
#define ASSERT_MAX(value, max, message) assert((value) <= (max))
#define SECTION(x) STATIC_CONST(x)
...
...
ndb/include/mgmcommon/MgmtErrorReporter.hpp
View file @
f16e5a0a
...
...
@@ -63,12 +63,6 @@
// Returns: -
//****************************************************************************
#ifndef NDB_ASSERT
#define NDB_ASSERT(trueToContinue, message) \
if ( !(trueToContinue) ) { \
ndbout << "ASSERT FAILED. FILE: " << __FILE__ << ", LINE: " << __LINE__ << ", MSG: " << message << endl;exit(-1);}
#endif
#define MGM_REQUIRE(x) \
if (!(x)) { ndbout << __FILE__ << " " << __LINE__ \
<< ": Warning! Requirement failed" << endl; }
ndb/include/util/Bitmask.hpp
View file @
f16e5a0a
...
...
@@ -19,11 +19,6 @@
#include <ndb_global.h>
#ifndef NDB_ASSERT
#define NDB_ASSERT(x, s) \
do { if (!(x)) { printf("%s\n", s); abort(); } } while (0)
#endif
/**
* Bitmask implementation. Size is given explicitly
* (as first argument). All methods are static.
...
...
@@ -140,7 +135,7 @@ public:
inline
bool
BitmaskImpl
::
get
(
unsigned
size
,
const
Uint32
data
[],
unsigned
n
)
{
NDB_ASSERT
(
n
<
(
size
<<
5
),
"bit get out of range"
);
assert
(
n
<
(
size
<<
5
)
);
return
(
data
[
n
>>
5
]
&
(
1
<<
(
n
&
31
)))
!=
0
;
}
...
...
@@ -153,7 +148,7 @@ BitmaskImpl::set(unsigned size, Uint32 data[], unsigned n, bool value)
inline
void
BitmaskImpl
::
set
(
unsigned
size
,
Uint32
data
[],
unsigned
n
)
{
NDB_ASSERT
(
n
<
(
size
<<
5
),
"bit set out of range"
);
assert
(
n
<
(
size
<<
5
)
);
data
[
n
>>
5
]
|=
(
1
<<
(
n
&
31
));
}
...
...
@@ -176,7 +171,7 @@ BitmaskImpl::assign(unsigned size, Uint32 dst[], const Uint32 src[])
inline
void
BitmaskImpl
::
clear
(
unsigned
size
,
Uint32
data
[],
unsigned
n
)
{
NDB_ASSERT
(
n
<
(
size
<<
5
),
"bit clear out of range"
);
assert
(
n
<
(
size
<<
5
)
);
data
[
n
>>
5
]
&=
~
(
1
<<
(
n
&
31
));
}
...
...
ndb/src/common/debugger/SignalLoggerManager.cpp
View file @
f16e5a0a
...
...
@@ -487,31 +487,6 @@ SignalLoggerManager::printLinearSection(FILE * output,
putc
(
'\n'
,
output
);
}
void
SignalLoggerManager
::
printSegmentedSection
(
FILE
*
output
,
const
SignalHeader
&
sh
,
const
SegmentedSectionPtr
ptr
[
3
],
unsigned
i
)
{
fprintf
(
output
,
"SECTION %u type=segmented"
,
i
);
if
(
i
>=
3
)
{
fprintf
(
output
,
" *** invalid ***
\n
"
);
return
;
}
const
Uint32
len
=
ptr
[
i
].
sz
;
SectionSegment
*
ssp
=
ptr
[
i
].
p
;
Uint32
pos
=
0
;
fprintf
(
output
,
" size=%u
\n
"
,
(
unsigned
)
len
);
while
(
pos
<
len
)
{
if
(
pos
>
0
&&
pos
%
SectionSegment
::
DataLength
==
0
)
{
ssp
=
g_sectionSegmentPool
.
getPtr
(
ssp
->
m_nextSegment
);
}
printDataWord
(
output
,
pos
,
ssp
->
theData
[
pos
%
SectionSegment
::
DataLength
]);
}
if
(
len
>
0
)
putc
(
'\n'
,
output
);
}
void
SignalLoggerManager
::
printDataWord
(
FILE
*
output
,
Uint32
&
pos
,
const
Uint32
data
)
{
...
...
ndb/src/kernel/Main.cpp
View file @
f16e5a0a
...
...
@@ -143,7 +143,7 @@ NDB_MAIN(ndb_kernel){
// Set thread concurrency for Solaris' light weight processes
int
status
;
status
=
NdbThread_SetConcurrencyLevel
(
30
);
NDB_ASSERT
(
status
==
0
,
"Can't set appropriate concurrency level."
);
assert
(
status
==
0
);
#ifdef VM_TRACE
// Create a signal logger
...
...
@@ -168,7 +168,7 @@ NDB_MAIN(ndb_kernel){
globalEmulatorData
.
theThreadConfig
->
doStart
(
NodeState
::
SL_STARTING
);
break
;
default:
NDB_ASSERT
(
0
,
"Illegal state globalData.theRestartFlag"
);
assert
(
"Illegal state globalData.theRestartFlag"
==
0
);
}
globalTransporterRegistry
.
startSending
();
...
...
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
View file @
f16e5a0a
...
...
@@ -924,7 +924,7 @@ Dbtux::TreeHead::getSize(AccSize acc) const
case
AccFull
:
return
m_nodeSize
;
}
REQUIRE
(
false
,
"invalid Dbtux::AccSize"
);
abort
(
);
return
0
;
}
...
...
ndb/src/kernel/blocks/ndbfs/AsyncFile.cpp
View file @
f16e5a0a
...
...
@@ -229,7 +229,7 @@ AsyncFile::run()
endReq
();
return
;
default:
THREAD_REQUIRE
(
false
,
"Using default switch in AsyncFile::run"
);
abort
(
);
break
;
}
//switch
theReportTo
->
writeChannel
(
request
);
...
...
ndb/src/kernel/blocks/ndbfs/MemoryChannel.hpp
View file @
f16e5a0a
...
...
@@ -120,8 +120,7 @@ template <class T> void MemoryChannel<T>::writeChannel( T *t)
{
NdbMutex_Lock
(
theMutexPtr
);
REQUIRE
(
!
full
(
theWriteIndex
,
theReadIndex
),
"Memory Channel Full"
);
REQUIRE
(
theChannel
!=
NULL
,
"Memory Channel Full"
);
if
(
full
(
theWriteIndex
,
theReadIndex
)
||
theChannel
==
NULL
)
abort
();
theChannel
[
theWriteIndex
]
=
t
;
++
theWriteIndex
;
NdbMutex_Unlock
(
theMutexPtr
);
...
...
ndb/src/kernel/blocks/ndbfs/Pool.hpp
View file @
f16e5a0a
...
...
@@ -215,7 +215,6 @@ protected:
T
**
tList
=
theList
;
int
i
;
theList
=
new
T
*
[
aSize
+
theCurrentSize
];
REQUIRE
(
theList
!=
0
,
"Allocate in Pool.hpp failed"
);
// allocate full list
for
(
i
=
0
;
i
<
theTop
;
i
++
)
{
theList
[
i
]
=
tList
[
i
];
...
...
ndb/src/kernel/error/ErrorReporter.hpp
View file @
f16e5a0a
...
...
@@ -23,35 +23,6 @@
#include "Error.hpp"
#include <Emulator.hpp>
#ifdef ASSERT
#undef ASSERT
#endif
#define REQUIRE(trueToContinue, message) \
if ( (trueToContinue) ) { } else { \
ErrorReporter::handleAssert(message, __FILE__, __LINE__); }
#define THREAD_REQUIRE(trueToContinue, message) \
if ( (trueToContinue) ) { } else { \
ErrorReporter::handleThreadAssert(message, __FILE__, __LINE__); }
#ifdef NDEBUG
#define NDB_ASSERT(trueToContinue, message)
#else
#define NDB_ASSERT(trueToContinue, message) \
if ( !(trueToContinue) ) { \
ErrorReporter::handleAssert(message, __FILE__, __LINE__); }
#endif
// Description:
// This macro is used to report programming errors.
// Parameters:
// trueToContinue IN An expression. If it evaluates to 0
// execution is stopped.
// message IN A message from the programmer
// explaining what went wrong.
class
ErrorReporter
{
public:
...
...
ndb/src/kernel/vm/MetaData.cpp
View file @
f16e5a0a
...
...
@@ -47,7 +47,7 @@ MetaData::MetaData(SimulatedBlock* block) :
MetaData
::~
MetaData
()
{
for
(
int
i
=
false
;
i
<=
true
;
i
++
)
{
NDB_ASSERT
(
m_common
.
m_lock
[
i
]
>=
m_lock
[
i
],
"invalid lock count"
);
assert
(
m_common
.
m_lock
[
i
]
>=
m_lock
[
i
]
);
m_common
.
m_lock
[
i
]
-=
m_lock
[
i
];
m_lock
[
i
]
=
0
;
}
...
...
ndb/src/kernel/vm/SimulatedBlock.cpp
View file @
f16e5a0a
...
...
@@ -136,12 +136,12 @@ SimulatedBlock::installSimulatedBlockFunctions(){
void
SimulatedBlock
::
addRecSignalImpl
(
GlobalSignalNumber
gsn
,
ExecFunction
f
,
bool
force
){
REQUIRE
(
gsn
<=
MAX_GSN
,
"Illegal signal added in block (GSN too high)"
);
char
probData
[
255
];
snprintf
(
probData
,
255
,
"Signal (%d) already added in block"
,
gsn
);
REQUIRE
(
force
||
theExecArray
[
gsn
]
==
0
,
probData
);
if
(
gsn
>
MAX_GSN
||
(
!
force
&&
theExecArray
[
gsn
]
!=
0
)){
char
errorMsg
[
255
];
snprintf
(
errorMsg
,
255
,
"Illeagal signal (%d %d)"
,
gsn
,
MAX_GSN
);
ERROR_SET
(
fatal
,
ERR_ERROR_PRGERR
,
errorMsg
,
errorMsg
);
}
theExecArray
[
gsn
]
=
f
;
}
...
...
ndb/src/kernel/vm/SimulatedBlock.hpp
View file @
f16e5a0a
...
...
@@ -458,11 +458,11 @@ SimulatedBlock::executeFunction(GlobalSignalNumber gsn, Signal* signal){
char
errorMsg
[
255
];
if
(
!
(
gsn
<=
MAX_GSN
))
{
snprintf
(
errorMsg
,
255
,
"Illegal signal received (GSN %d too high)"
,
gsn
);
REQUIRE
(
false
,
errorMsg
);
ERROR_SET
(
fatal
,
ERR_ERROR_PRGERR
,
errorMsg
,
errorMsg
);
}
if
(
!
(
theExecArray
[
gsn
]
!=
0
))
{
snprintf
(
errorMsg
,
255
,
"Illegal signal received (GSN %d not added)"
,
gsn
);
REQUIRE
(
false
,
errorMsg
);
ERROR_SET
(
fatal
,
ERR_ERROR_PRGERR
,
errorMsg
,
errorMsg
);
}
ndbrequire
(
false
);
}
...
...
ndb/src/kernel/vm/TransporterCallback.cpp
View file @
f16e5a0a
...
...
@@ -434,5 +434,28 @@ reportDisconnect(void * callbackObj, NodeId nodeId, Uint32 errNo){
globalScheduler
.
execute
(
&
signal
,
JBA
,
CMVMI
,
GSN_DISCONNECT_REP
);
}
void
SignalLoggerManager
::
printSegmentedSection
(
FILE
*
output
,
const
SignalHeader
&
sh
,
const
SegmentedSectionPtr
ptr
[
3
],
unsigned
i
)
{
fprintf
(
output
,
"SECTION %u type=segmented"
,
i
);
if
(
i
>=
3
)
{
fprintf
(
output
,
" *** invalid ***
\n
"
);
return
;
}
const
Uint32
len
=
ptr
[
i
].
sz
;
SectionSegment
*
ssp
=
ptr
[
i
].
p
;
Uint32
pos
=
0
;
fprintf
(
output
,
" size=%u
\n
"
,
(
unsigned
)
len
);
while
(
pos
<
len
)
{
if
(
pos
>
0
&&
pos
%
SectionSegment
::
DataLength
==
0
)
{
ssp
=
g_sectionSegmentPool
.
getPtr
(
ssp
->
m_nextSegment
);
}
printDataWord
(
output
,
pos
,
ssp
->
theData
[
pos
%
SectionSegment
::
DataLength
]);
}
if
(
len
>
0
)
putc
(
'\n'
,
output
);
}
ndb/src/mgmclient/CommandInterpreter.cpp
View file @
f16e5a0a
...
...
@@ -1478,7 +1478,7 @@ CommandInterpreter::executeSet(int /*processId*/,
<< endl;
}
else {
NDB_ASSERT(false, ""
);
assert(false
);
}
}
else {
...
...
@@ -1497,7 +1497,7 @@ CommandInterpreter::executeSet(int /*processId*/,
}
else {
// The primary is not tried to write if the write of backup file fails
NDB_ASSERT(false, ""
);
abort(
);
}
}
free(newpar);
...
...
ndb/src/mgmsrv/MgmtSrvr.cpp
View file @
f16e5a0a
...
...
@@ -1698,7 +1698,7 @@ MgmtSrvr::setSignalLoggingMode(int processId, LogMode mode,
logSpec
=
TestOrd
::
InputOutputSignals
;
break
;
default:
NDB_ASSERT
(
false
,
"Unexpected value, MgmtSrvr::setSignalLoggingMode"
);
assert
(
"Unexpected value, MgmtSrvr::setSignalLoggingMode"
==
0
);
}
NdbApiSignal
*
signal
=
getSignal
();
...
...
ndb/src/ndbapi/TransporterFacade.cpp
View file @
f16e5a0a
...
...
@@ -162,13 +162,6 @@ setSignalLog(){
}
#endif
// These symbols are needed, but not used in the API
int
g_sectionSegmentPool
;
struct
ErrorReporter
{
void
handleAssert
(
const
char
*
,
const
char
*
,
int
);
};
void
ErrorReporter
::
handleAssert
(
const
char
*
message
,
const
char
*
file
,
int
line
)
{}
/**
* The execute function : Handle received signal
*/
...
...
@@ -314,6 +307,14 @@ execute(void * callbackObj, SignalHeader * const header,
}
}
// These symbols are needed, but not used in the API
void
SignalLoggerManager
::
printSegmentedSection
(
FILE
*
,
const
SignalHeader
&
,
const
SegmentedSectionPtr
ptr
[
3
],
unsigned
i
){
abort
();
}
void
copy
(
Uint32
*
&
insertPtr
,
class
SectionSegmentPool
&
thePool
,
const
SegmentedSectionPtr
&
_ptr
){
...
...
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