Commit a3ee5c19 authored by tomas@mc05.(none)'s avatar tomas@mc05.(none)

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into mc05.(none):/space2/tomas/mysql-4.1-ndb-test
parents c5d388f1 f326e8b2
......@@ -106,6 +106,7 @@ monty@tik.
monty@tik.mysql.fi
monty@tramp.mysql.fi
monty@work.mysql.com
mronstrom@mysql.com
msvensson@build.mysql.com
mwagner@cash.mwagner.org
mwagner@evoq.mwagner.org
......@@ -113,6 +114,7 @@ mwagner@work.mysql.com
mydev@mysql.com
mysql@home.(none)
mysqldev@build.mysql2.com
mysqldev@mysql.com
ndbdev@ndbmaster.mysql.com
nick@mysql.com
nick@nick.leippe.com
......@@ -123,6 +125,7 @@ paul@ice.local
paul@ice.snake.net
paul@kite-hub.kitebird.com
paul@teton.kitebird.com
pekka@mysql.com
pem@mysql.com
peter@linux.local
peter@mysql.com
......
......@@ -2754,6 +2754,14 @@ EOF
if test X"$have_ndbcluster" = Xyes
then
if test X"$mysql_cv_compress" != Xyes
then
echo
echo "MySQL Cluster table handler ndbcluster requires compress/uncompress."
echo "Commonly available in libzlib.a. Please install and rerun configure."
echo
exit 1
fi
sql_server_dirs="$sql_server_dirs ndb"
echo "CONFIGURING FOR NDB CLUSTER"
case $with_debug in
......
......@@ -7,11 +7,11 @@ replace-targets := all clean
NDB_RELEASE := $(shell ../scripts/mysql_config --version)
all:
$(MAKE) -C src
$(MAKE) -C test/src
$(MAKE) -C tools
$(MAKE) -C test/ndbapi/flexBench
$(MAKE) -C test/tools/waiter
$(MAKE) -j 1 -C src
$(MAKE) -j 1 -C test/src
$(MAKE) -j 1 -C tools
$(MAKE) -j 1 -C test/ndbapi/flexBench
$(MAKE) -j 1 -C test/tools/waiter
include $(NDB_TOP)/Epilogue.mk
......
......@@ -105,6 +105,7 @@ parse_arguments "$@"
echo "NDB_COMPILER := $NDB_COMPILER"
echo "NDB_VERSION := $NDB_VERSION"
echo "NDB_SCI := $NDB_SCI"
echo "NDB_SHM := $NDB_SHM"
echo "NDB_ODBC := $NDB_ODBC"
echo "TERMCAP_LIB := $TERMCAP_LIB"
echo "PACKAGE := $PACKAGE"
......
......@@ -250,7 +250,7 @@ struct CreateEvntReq {
return tmp;
}
void setAttrListBitmask(const AttributeMask & val) {
m_attrListBitmask = val;
AttributeMask::assign(m_attrListBitmask.data, val);
}
Uint32 getEventType() const {
return m_eventType;
......
......@@ -17,6 +17,7 @@
#ifndef NDB_TRIGGER_DEFINITIONS_H
#define NDB_TRIGGER_DEFINITIONS_H
#include <ndb_global.h>
#include "ndb_limits.h"
#ifndef MIN
......
......@@ -49,7 +49,7 @@ int getopt(int, char **, char *opts);
#endif // NDB_WIN32
#ifdef NDB_ALPHA
#ifdef NDB_GCC
#ifdef NDB_GCC // only for NDB_ALPHA
extern int gnuShouldNotUseRPCC();
#define RPCC() gnuShouldNotUseRPCC();
#else
......
......@@ -331,11 +331,12 @@ public:
*/
struct Data {
Uint32 data[size];
#if 0
Data & operator=(const Bitmask<size> & src) {
src.assign(size, data);
return *this;
}
#endif
};
private:
......@@ -348,12 +349,13 @@ public:
/**
* assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em>
*/
void assign(const Bitmask<size>::Data & src);
void assign(const typename Bitmask<size>::Data & src);
/**
* assign - Set all bits in <em>dst</em> to corresponding in <em>src/<em>
*/
static void assign(Uint32 dst[], const Uint32 src[]);
static void assign(Uint32 dst[], const Bitmask<size> & src);
void assign(const Bitmask<size> & src);
/**
......@@ -480,7 +482,14 @@ Bitmask<size>::assign(Uint32 dst[], const Uint32 src[])
template <unsigned size>
inline void
Bitmask<size>::assign(const Bitmask<size>::Data & src)
Bitmask<size>::assign(Uint32 dst[], const Bitmask<size> & src)
{
BitmaskImpl::assign(size, dst, src.rep.data);
}
template <unsigned size>
inline void
Bitmask<size>::assign(const typename Bitmask<size>::Data & src)
{
assign(rep.data, src.data);
}
......
......@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <common/common.hpp>
#include <NdbMutex.h>
#include <common/StmtArea.hpp>
#include <FlexLexer.h>
......
......@@ -14,7 +14,6 @@
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 <NdbApi.hpp>
#include <common/common.hpp>
#include "DiagArea.hpp"
......
......@@ -14,7 +14,6 @@
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 "DataField.hpp"
#ifndef INT_MAX
......
......@@ -14,7 +14,6 @@
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 "OdbcData.hpp"
OdbcData::OdbcData() :
......
......@@ -17,9 +17,13 @@
#ifndef ODBC_COMMON_common_hpp
#define ODBC_COMMON_common_hpp
#define stpcpy stpcpy
#include <ndb_global.h>
#undef swap
// misc defs
#ifdef NDB_GCC
#ifdef NDB_GCC // only for odbc
#define PRINTFLIKE(i,j) __attribute__ ((format (printf, i, j)))
#else
#define PRINTFLIKE(i,j)
......
......@@ -14,8 +14,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <NdbMutex.h>
#include "driver.hpp"
#include <NdbMutex.h>
#undef NDB_ODBC_SIG_DFL
#ifdef NDB_ODBC_SIG_DFL
......
......@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <common/common.hpp>
#include <NdbMutex.h>
#include <common/DiagArea.hpp>
#include "HandleRoot.hpp"
......
......@@ -14,6 +14,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <common/common.hpp>
#include <NdbMutex.h>
#include <NdbApi.hpp>
#include "PoolNdb.hpp"
......
......@@ -17,8 +17,8 @@
#ifndef ODBC_HANDLES_PoolNdb_hpp
#define ODBC_HANDLES_PoolNdb_hpp
#include <list>
#include <common/common.hpp>
#include <list>
class Ndb;
......
......@@ -18,9 +18,9 @@
#include "NdbDaemon.h"
#define NdbDaemon_ErrorSize 500
long NdbDaemon_DaemonPid;
int NdbDaemon_ErrorCode;
char NdbDaemon_ErrorText[NdbDaemon_ErrorSize];
long NdbDaemon_DaemonPid = 0;
int NdbDaemon_ErrorCode = 0;
char NdbDaemon_ErrorText[NdbDaemon_ErrorSize] = "";
int
NdbDaemon_Make(const char* lockfile, const char* logfile, unsigned flags)
......
......@@ -21,6 +21,7 @@
#define MAX_THREAD_NAME 16
//#define USE_PTHREAD_EXTRAS
struct NdbThread
{
......@@ -52,11 +53,9 @@ struct NdbThread* NdbThread_Create(NDB_THREAD_FUNC *p_thread_func,
pthread_attr_init(&thread_attr);
pthread_attr_setstacksize(&thread_attr, thread_stack_size);
#if defined NDB_SOLARIS
#if !defined NDB_SOLARIS6
#ifdef USE_PTHREAD_EXTRAS
/* Guard stack overflow with a 2k databuffer */
pthread_attr_setguardsize(&thread_attr, 2048);
#endif
#endif
pthread_attr_setdetachstate(&thread_attr, PTHREAD_CREATE_JOINABLE);
......@@ -104,7 +103,7 @@ void NdbThread_Exit(int status)
int NdbThread_SetConcurrencyLevel(int level)
{
#ifndef NDB_SOLARIS6
#ifdef USE_PTHREAD_EXTRAS
return pthread_setconcurrency(level);
#else
return 0;
......
......@@ -48,7 +48,7 @@ void byteReverse(unsigned char *buf, unsigned longs);
*/
void byteReverse(unsigned char *buf, unsigned longs)
{
uint32 t;
Uint32 t;
do {
t = (Uint32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
((unsigned) buf[1] << 8 | buf[0]);
......
......@@ -14,6 +14,8 @@
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>
#define DBDICT_C
#include "Dbdict.hpp"
......@@ -5703,7 +5705,7 @@ void Dbdict::sendGET_TABINFOREF(Signal* signal,
}//sendGET_TABINFOREF()
Uint32 convertEndian(Uint32 in) {
#ifdef _BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
Uint32 ut = 0;
ut += ((in >> 24) & 255);
ut += (((in >> 16) & 255) << 8);
......@@ -7760,8 +7762,9 @@ Dbdict::createEventComplete_RT_USER_GET(Signal* signal,
#endif
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
evntRecPtr.p->m_reqTracker.init<CreateEvntRef>
(c_counterMgr, rg, GSN_CREATE_EVNT_REF, evntRecPtr.i);
RequestTracker & p = evntRecPtr.p->m_reqTracker;
p.init<CreateEvntRef>(c_counterMgr, rg, GSN_CREATE_EVNT_REF, evntRecPtr.i);
sendSignal(rg, GSN_CREATE_EVNT_REQ, signal, CreateEvntReq::SignalLength, JBB);
}
......@@ -8109,7 +8112,8 @@ void Dbdict::execSUB_START_REQ(Signal* signal)
subbPtr.p->m_senderRef = origSenderRef; // not sure if API sets correctly
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
subbPtr.p->m_reqTracker.init<SubStartRef>(c_counterMgr, rg, GSN_SUB_START_REF, subbPtr.i);
RequestTracker & p = subbPtr.p->m_reqTracker;
p.init<SubStartRef>(c_counterMgr, rg, GSN_SUB_START_REF, subbPtr.i);
SubStartReq* req = (SubStartReq*) signal->getDataPtrSend();
......@@ -8322,7 +8326,8 @@ void Dbdict::execSUB_STOP_REQ(Signal* signal)
#endif
subbPtr.p->m_senderRef = origSenderRef; // not sure if API sets correctly
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
subbPtr.p->m_reqTracker.init<SubStopRef>(c_counterMgr, rg, GSN_SUB_STOP_REF, subbPtr.i);
RequestTracker & p = subbPtr.p->m_reqTracker;
p.init<SubStopRef>(c_counterMgr, rg, GSN_SUB_STOP_REF, subbPtr.i);
SubStopReq* req = (SubStopReq*) signal->getDataPtrSend();
......@@ -8609,7 +8614,8 @@ Dbdict::dropEventUTIL_EXECUTE_READ(Signal* signal,
parseReadEventSys(signal, evntRecPtr.p->m_eventRec);
NodeReceiverGroup rg(DBDICT, c_aliveNodes);
evntRecPtr.p->m_reqTracker.init<SubRemoveRef>(c_counterMgr, rg, GSN_SUB_REMOVE_REF,
RequestTracker & p = evntRecPtr.p->m_reqTracker;
p.init<SubRemoveRef>(c_counterMgr, rg, GSN_SUB_REMOVE_REF,
evntRecPtr.i);
SubRemoveReq* req = (SubRemoveReq*) signal->getDataPtrSend();
......
......@@ -101,6 +101,22 @@
#define ZNODE_FAILURE_ERROR 704
#endif
/**
* Systable NDB$EVENTS_0
*/
#define EVENT_SYSTEM_TABLE_NAME "sys/def/NDB$EVENTS_0"
#define EVENT_SYSTEM_TABLE_LENGTH 6
struct sysTab_NDBEVENTS_0 {
char NAME[MAX_TAB_NAME_SIZE];
Uint32 EVENT_TYPE;
char TABLE_NAME[MAX_TAB_NAME_SIZE];
Uint32 ATTRIBUTE_MASK[MAXNROFATTRIBUTESINWORDS];
Uint32 SUBID;
Uint32 SUBKEY;
};
/**
* DICT - This blocks handles all metadata
*/
......@@ -1227,22 +1243,6 @@ private:
};
typedef Ptr<OpSubEvent> OpSubEventPtr;
/**
* Systable NDB$EVENTS_0
*/
#define EVENT_SYSTEM_TABLE_NAME "sys/def/NDB$EVENTS_0"
#define EVENT_SYSTEM_TABLE_LENGTH 6
struct sysTab_NDBEVENTS_0 {
char NAME[MAX_TAB_NAME_SIZE];
Uint32 EVENT_TYPE;
char TABLE_NAME[MAX_TAB_NAME_SIZE];
Uint32 ATTRIBUTE_MASK[MAXNROFATTRIBUTESINWORDS];
Uint32 SUBID;
Uint32 SUBKEY;
};
static const Uint32 sysTab_NDBEVENTS_0_szs[];
/**
......
......@@ -103,7 +103,9 @@ private:
static const unsigned MaxNodeHandles = 128; // enough for 1 operation
#endif
static const unsigned MaxAttrDataSize = 2048;
public:
static const unsigned DescPageSize = 256;
private:
static const unsigned MaxTreeNodeSize = MAX_TTREE_NODE_SIZE;
static const unsigned ScanBoundSegmentSize = 7;
static const unsigned MaxAccLockOps = MAX_PARALLEL_OP_PER_SCAN;
......@@ -126,10 +128,13 @@ private:
Data& operator+=(size_t n);
AttributeHeader& ah() const;
};
friend class Data;
/*
* Pointer to constant Uint32 data.
*/
struct ConstData;
friend struct ConstData;
struct ConstData {
private:
const Uint32* m_data;
......@@ -173,6 +178,8 @@ private:
* of "original" tuple and tuple version. Uses 2 words to get correct
* aligment (one byte is wasted currently).
*/
struct TreeEnt;
friend struct TreeEnt;
struct TreeEnt {
TupAddr m_tupAddr; // address of original tuple
Uint16 m_tupVersion; // version
......@@ -202,6 +209,8 @@ private:
* a node is about to be removed. If occupancy is 1, only max entry
* is present but both min and max prefixes are set.
*/
struct TreeNode;
friend struct TreeNode;
struct TreeNode {
TupAddr m_link[3]; // link to 0-left child 1-right child 2-parent
Uint8 m_side; // we are 0-left child 1-right child 2-root
......@@ -228,6 +237,8 @@ private:
* Tree header. There is one in each fragment. Contains tree
* parameters and address of root node.
*/
struct TreeHead;
friend struct TreeHead;
struct TreeHead {
Uint8 m_nodeSize; // words in tree node
Uint8 m_prefSize; // words in min/max prefix each
......@@ -248,6 +259,8 @@ private:
* also represented by position 0 of next node. Includes direction
* and copy of entry used by scan.
*/
struct TreePos;
friend struct TreePos;
struct TreePos {
TupAddr m_addr; // logical node address
TupLoc m_loc; // physical address
......@@ -264,6 +277,8 @@ private:
* Descriptor page. The "hot" metadata for an index is stored as
* a contiguous array of words on some page.
*/
struct DescPage;
friend struct DescPage;
struct DescPage {
Uint32 m_nextPage;
Uint32 m_numFree; // number of free words
......@@ -301,6 +316,8 @@ private:
* Complete metadata for one index. The array of attributes has
* variable size.
*/
struct DescEnt;
friend struct DescEnt;
struct DescEnt {
DescHead m_descHead;
DescAttr m_descAttr[1]; // variable size data
......@@ -329,6 +346,8 @@ private:
* be for an entry we were moved away from. In any case nothing
* happens with current entry before lock wait flag is cleared.
*/
struct ScanOp;
friend struct ScanOp;
struct ScanOp {
enum {
Undef = 0,
......@@ -382,6 +401,8 @@ private:
* Ordered index. Top level data structure. The primary table (table
* being indexed) lives in TUP.
*/
struct Index;
friend struct Index;
struct Index {
enum State {
NotDefined = 0,
......@@ -412,6 +433,8 @@ private:
* duplicate fragments known to LQH/ACC/TUP. Includes tree header.
* There are no maintenance operation records yet.
*/
struct Frag;
friend struct Frag;
struct Frag {
Uint32 m_tableId; // copy from index level
Uint32 m_indexId;
......@@ -458,6 +481,8 @@ private:
* different implementations of index memory access. The cache is
* committed and released at the end of the operation.
*/
struct NodeHandle;
friend struct NodeHandle;
struct NodeHandle {
enum Flags {
// bits 0,1 mark need for left,right prefix
......@@ -508,7 +533,6 @@ private:
};
typedef Ptr<NodeHandle> NodeHandlePtr;
ArrayPool<NodeHandle> c_nodeHandlePool;
friend class NodeHandle;
// parameters for methods
......@@ -528,6 +552,8 @@ private:
/*
* Read index key attributes.
*/
struct ReadPar;
friend struct ReadPar;
struct ReadPar {
TreeEnt m_ent; // tuple to read
unsigned m_first; // first index attribute
......@@ -551,6 +577,8 @@ private:
/*
* Tree search for entry.
*/
struct SearchPar;
friend struct SearchPar;
struct SearchPar {
ConstData m_data; // input index key values
TreeEnt m_ent; // input tuple and version
......@@ -560,6 +588,8 @@ private:
/*
* Attribute data comparison.
*/
struct CmpPar;
friend struct CmpPar;
struct CmpPar {
ConstData m_data1; // full search key
ConstData m_data2; // full or prefix data
......@@ -572,6 +602,8 @@ private:
/*
* Scan bound comparison.
*/
struct BoundPar;
friend struct BoundPar;
struct BoundPar {
ConstData m_data1; // full bound data
ConstData m_data2; // full or prefix data
......
......@@ -17,7 +17,8 @@
/**
* O_DIRECT
*/
#ifdef NDB_LINUX
#if 0
//#ifdef NDB_LINUX
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
......@@ -34,12 +35,14 @@
#include <NdbThread.h>
#include <signaldata/FsOpenReq.hpp>
#ifdef NDB_LINUX
#if 0
#ifdef HAVE_PREAD
// This is for pread and pwrite
#ifndef __USE_UNIX98
#define __USE_UNIX98
#endif
#endif
#endif
#if defined NDB_WIN32 || defined NDB_OSE || defined NDB_SOFTOSE
#else
......@@ -343,11 +346,10 @@ void AsyncFile::openReq(Request* request)
}
#if 0
#if NDB_LINUX
//#if NDB_LINUX
if(Global_useO_DIRECT){
new_flags |= O_DIRECT;
}
#endif
#endif
switch(flags & 0x3){
......
......@@ -39,6 +39,15 @@ public:
Trix(const class Configuration & conf);
virtual ~Trix();
public:
// Subscription data, when communicating with SUMA
enum RequestType {
TABLE_REORG = 0,
INDEX_BUILD = 1
};
typedef DataBuffer<11> AttrOrderBuffer;
private:
// Private attributes
......@@ -87,14 +96,6 @@ private:
Uint16 c_noNodesFailed;
Uint16 c_noActiveNodes;
// Subscription data, when communicating with SUMA
enum RequestType {
TABLE_REORG = 0,
INDEX_BUILD = 1
};
typedef DataBuffer<11> AttrOrderBuffer;
AttrOrderBuffer::DataBufferPool c_theAttrOrderBufferPool;
struct SubscriptionRecord {
......
......@@ -33,7 +33,7 @@
#include <EventLogger.hpp>
#include <NodeState.hpp>
#if defined NDB_SOLARIS
#if defined NDB_SOLARIS // ok
#include <sys/processor.h> // For system informatio
#endif
......@@ -199,7 +199,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
}
RegCloseKey(hKey);
}
#elif defined NDB_SOLARIS
#elif defined NDB_SOLARIS // ok
// Search for at max 16 processors among the first 256 processor ids
processor_info_t pinfo; memset(&pinfo, 0, sizeof(pinfo));
int pid = 0;
......@@ -213,7 +213,7 @@ systemInfo(const Configuration & config, const LogLevel & logLevel){
if(logLevel.getLogLevel(LogLevel::llStartUp) > 0){
g_eventLogger.info("NDB Cluster -- DB node %d", globalData.ownId);
g_eventLogger.info("%s --", NDB_VERSION_STRING);
#ifdef NDB_SOLARIS
#ifdef NDB_SOLARIS // ok
g_eventLogger.info("NDB is running on a machine with %d processor(s) at %d MHz",
processor, speed);
#endif
......
......@@ -30,10 +30,6 @@
#include "MgmtErrorReporter.hpp"
#include "CpcClient.hpp"
#ifdef NDB_SOLARIS // XXX fix me
static char* strsep(char** x, const char* y) { return 0; }
#endif
/*****************************************************************************
* HELP
......@@ -1865,17 +1861,36 @@ CommandInterpreter::executeRep(char* parameters)
* CPC
*****************************************************************************/
#if 0
#if 0
//#ifdef NDB_SOLARIS // XXX fix me
static char* strsep(char** x, const char* y) { return 0; }
#endif
// Note this code has not been verified
#if 0
static char * my_strsep(char **stringp, const char *delim)
{
char *tmp= *stringp;
if (tmp == 0)
return 0;
*stringp = strtok(tmp, delim);
return tmp;
}
#endif
void
CommandInterpreter::executeCpc(char *parameters)
{
char *host_str = NULL, *port_str = NULL, *end;
long port = 1234; /* XXX */
while((host_str = strsep(&parameters, " \t:")) != NULL &&
while((host_str = my_strsep(&parameters, " \t:")) != NULL &&
host_str[0] == '\0');
if(parameters && parameters[0] != '\0') {
while((port_str = strsep(&parameters, " \t:")) != NULL &&
while((port_str = my_strsep(&parameters, " \t:")) != NULL &&
port_str[0] == '\0');
errno = 0;
......@@ -1944,6 +1959,7 @@ CommandInterpreter::executeCpc(char *parameters)
<< endl;
return;
}
#endif
#if 0
static
......
......@@ -56,13 +56,14 @@ public:
NdbTableImpl* put(const char * name, NdbTableImpl *);
void drop(NdbTableImpl *);
void release(NdbTableImpl *);
private:
public:
enum Status {
OK = 0,
DROPPED = 1,
RETREIVING = 2
};
private:
struct TableVersion {
Uint32 m_version;
Uint32 m_refCount;
......
......@@ -825,7 +825,7 @@ Ndb::opTupleIdOnNdb(Uint32 aTableId, Uint64 opValue, Uint32 op)
tOperation->interpretedUpdateTuple();
tOperation->equal("SYSKEY_0", aTableId );
{
#ifdef NDB_SOLARIS
#ifdef WORDS_BIGENDIAN
Uint64 cacheSize64 = opValue; // XXX interpreter bug on Uint32
tOperation->incValue("NEXTID", cacheSize64);
#else
......@@ -991,7 +991,7 @@ Ndb::StartTransactionNodeSelectionData::release(){
Uint32
convertEndian(Uint32 Data)
{
#ifdef _BIG_ENDIAN
#ifdef WORDS_BIGENDIAN
Uint32 t1, t2, t3, t4;
t4 = (Data >> 24) & 255;
t3 = (Data >> 16) & 255;
......
......@@ -234,7 +234,7 @@ NdbDictionary::Table::~Table(){
}
NdbDictionary::Table&
NdbDictionary::Table::operator=(const NdbDictionary::Table::Table& table)
NdbDictionary::Table::operator=(const NdbDictionary::Table& table)
{
m_impl.assign(table.m_impl);
......
......@@ -55,8 +55,8 @@ NdbColumnImpl::NdbColumnImpl(NdbDictionary::Column & f)
init();
}
NdbColumnImpl::NdbColumnImpl&
NdbColumnImpl::operator=(const NdbColumnImpl::NdbColumnImpl& col)
NdbColumnImpl&
NdbColumnImpl::operator=(const NdbColumnImpl& col)
{
m_attrId = col.m_attrId;
m_name = col.m_name;
......
......@@ -53,7 +53,7 @@ public:
template<class T> bool waitFor(Vector<T> &t,
T *&handler,
NdbApiSignal *&signal,
Uint32 timeout = DEFAULT_TIMEOUT);
Uint32 timeout);
/**
* size()
......
......@@ -186,8 +186,8 @@ class SigMatch
};
};
void *
ExtNDB::signalExecThread_C(void *r)
extern "C"
void *signalExecThread_C(void *r)
{
ExtNDB *grepps = (ExtNDB*)r;
......@@ -198,6 +198,7 @@ ExtNDB::signalExecThread_C(void *r)
return 0;
}
void
ExtNDB::signalExecThreadRun()
{
......@@ -233,10 +234,12 @@ ExtNDB::signalExecThreadRun()
sl.push_back(SigMatch(GSN_GREP_SUB_START_REF, &ExtNDB::sendSignalRep));
sl.push_back(SigMatch(GSN_GREP_SUB_CREATE_REF, &ExtNDB::sendSignalRep));
while(1) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
if(m_signalRecvQueue.waitFor(sl, handler, signal)) {
if(m_signalRecvQueue.waitFor(sl, handler, signal, DEFAULT_TIMEOUT)) {
#if 0
RLOG(("Removed signal from queue (GSN: %d, QSize: %d)",
signal->readSignalNumber(), m_signalRecvQueue.size()));
......
......@@ -34,6 +34,10 @@
#include <rep/storage/GCIContainerPS.hpp>
#include "ExtAPI.hpp"
extern "C" {
static void * signalExecThread_C(void *);
}
/**
* @class ExtNDB
* @brief Class responsible for connection to primary system GREP
......@@ -58,15 +62,15 @@ public:
void signalErrorHandler(NdbApiSignal * s, Uint32 nodeId);
private:
friend void * signalExecThread_C(void *);
void signalExecThreadRun();
static void execSignal(void* signalSender, NdbApiSignal* signal,
class LinearSectionPtr ptr[3]);
static void execNodeStatus(void* signalSender, NodeId,
bool alive, bool nfCompleted);
void signalExecThreadRun();
static void * signalExecThread_C(void *);
void sendSignalRep(NdbApiSignal *);
void sendDisconnectRep(Uint32 nodeId);
......
......@@ -153,8 +153,9 @@ class SigMatch
};
};
extern "C"
void *
TransPS::signalExecThread_C(void *r)
signalExecThread_C(void *r)
{
TransPS *repps = (TransPS*)r;
......@@ -196,7 +197,7 @@ TransPS::signalExecThreadRun()
while(1) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
if(m_signalRecvQueue.waitFor(sl, handler, signal)) {
if(m_signalRecvQueue.waitFor(sl, handler, signal, DEFAULT_TIMEOUT)) {
#if 0
ndbout_c("TransPS: Removed signal from queue (GSN: %d, QSize: %d)",
signal->readSignalNumber(), m_signalRecvQueue.size());
......
......@@ -35,6 +35,10 @@
#include <rep/rep_version.hpp>
extern "C" {
static void * signalExecThread_C(void *);
}
/**
* @class TransPS
* @brief Responsible for REP-REP interface in Primary System role
......@@ -62,8 +66,10 @@ private:
/**
* SignalQueue executor thread
*/
friend void * signalExecThread_C(void *);
void signalExecThreadRun();
static void * signalExecThread_C(void *);
static void execSignal(void* signalSender, NdbApiSignal* signal,
class LinearSectionPtr ptr[3]);
......
......@@ -165,8 +165,9 @@ class SigMatch
};
};
extern "C"
void *
TransSS::signalExecThread_C(void *r)
signalExecThread_C(void *r)
{
TransSS *transss = (TransSS*)r;
......@@ -243,7 +244,7 @@ TransSS::signalExecThreadRun()
while(1) {
SigMatch *handler = NULL;
NdbApiSignal *signal = NULL;
if(m_signalRecvQueue.waitFor(sl, handler, signal))
if(m_signalRecvQueue.waitFor(sl, handler, signal, DEFAULT_TIMEOUT))
{
#if 0
ndbout_c("TransSS: Removed signal from queue (GSN: %d, QSize: %d)",
......
......@@ -34,6 +34,10 @@
#include <rep/state/RepState.hpp>
extern "C" {
static void * signalExecThread_C(void *);
}
/**
* @class TransSS
* @brief Responsible for REP-REP interface in Standby System role
......@@ -57,8 +61,8 @@ private:
/***************************************************************************
* Private Methods
***************************************************************************/
friend void * signalExecThread_C(void *);
void signalExecThreadRun(); ///< SignalQueue executor thread
static void * signalExecThread_C(void *);
static void execSignal(void* executorObj, NdbApiSignal* signal,
class LinearSectionPtr ptr[3]);
......
......@@ -214,8 +214,8 @@ TESTCASE("ScanLessThan",
"Read all records in table TX with attrX less "\
"than a value and store the resultset in TX_RES."\
"Then compare records in TX_RES with records in TX."){
TABLE("T1");
TABLE("T2");
// TABLE("T1");
// TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanLessThan);
......@@ -227,8 +227,8 @@ TESTCASE("ScanEqual",
"Read all records in table TX with attrX equal "\
"to a value and store the resultset in TX_RES."\
"Then compare records in TX_RES with records in TX."){
TABLE("T1");
TABLE("T2");
// TABLE("T1");
// TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanEqual);
......@@ -239,8 +239,8 @@ TESTCASE("ScanEqual",
TESTCASE("ScanEqualLoop",
"Scan all records in TX equal to a value."\
"Do this loop number of times"){
TABLE("T1");
TABLE("T2");
// TABLE("T1");
// TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanEqualLoop);
......@@ -251,8 +251,8 @@ TESTCASE("ScanEqualVerifyLoop",
"Scan all records in TX equal to a value."\
"Verify record in TX_RES table"\
"Do this loop number of times"){
TABLE("T1");
TABLE("T2");
// TABLE("T1");
// TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanEqualVerifyLoop);
......@@ -262,8 +262,8 @@ TESTCASE("ScanEqualVerifyLoop",
TESTCASE("ScanLessThanLoop",
"Scan all records in TX less than a value."\
"Do this loop number of times"){
TABLE("T1");
TABLE("T2");
// TABLE("T1");
// TABLE("T2");
INITIALIZER(runLoadTable);
INITIALIZER(runCreateResultTable);
STEP(runScanLessThanLoop);
......
......@@ -37,6 +37,7 @@
*/
#include <ndb_global.h>
#undef test
#include <ndb_version.h>
#include <kernel/ndb_limits.h>
#include <Bitmask.hpp>
......@@ -1281,6 +1282,7 @@ struct Fld {
return test.verify(m_double, m_ind, fld.m_double, fld.m_ind);
}
assert(false);
return false;
}
// debug
void print() const {
......
......@@ -138,6 +138,7 @@ bool emptyString(const char* s) {
* to obtain the row count.
*/
#define MAXCOLS 100
#undef max
#define max(a,b) ((a)>(b)?(a):(b))
#define MAX_MESSAGE 500
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment