Commit 9c3e68c7 authored by unknown's avatar unknown

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

into mc05.(none):/space/tomas/mysql-4.1-ndb

parents a0753202 d1946959
......@@ -113,6 +113,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
......
......@@ -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
......
......@@ -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);
}
......
......@@ -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]);
......
......@@ -7762,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);
}
......@@ -8111,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();
......@@ -8324,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();
......@@ -8611,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
......
......@@ -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 {
......
......@@ -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;
......
......@@ -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);
......
......@@ -56,8 +56,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 @@ public:
};
};
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 @@ public:
};
};
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 @@ public:
};
};
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]);
......
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