mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0 configure.in: Auto merged libmysqld/Makefile.am: Auto merged strings/ctype-big5.c: Auto merged strings/ctype-ucs2.c: Auto merged
This commit is contained in:
@ -214,4 +214,4 @@ drop table if exists t1_c,t2_c,t3_c,t4_c,t5_c,t6_c,t7_c,t8_c,t9_c;
|
|||||||
# Test BUG#10287
|
# Test BUG#10287
|
||||||
#
|
#
|
||||||
|
|
||||||
--exec $NDB_TOOLS_DIR/ndb_select_all -d sys -D , SYSTAB_0 | grep 520093696
|
--exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults -d sys -D , SYSTAB_0 | grep 520093696
|
||||||
|
@ -203,6 +203,13 @@ public:
|
|||||||
bool createSCITransporter(struct TransporterConfiguration * config);
|
bool createSCITransporter(struct TransporterConfiguration * config);
|
||||||
bool createSHMTransporter(struct TransporterConfiguration * config);
|
bool createSHMTransporter(struct TransporterConfiguration * config);
|
||||||
bool createOSETransporter(struct TransporterConfiguration * config);
|
bool createOSETransporter(struct TransporterConfiguration * config);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get free buffer space
|
||||||
|
*
|
||||||
|
* Get #free bytes in send buffer for <em>node</node>
|
||||||
|
*/
|
||||||
|
Uint32 get_free_buffer(Uint32 node) const ;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* prepareSend
|
* prepareSend
|
||||||
|
@ -1025,7 +1025,8 @@ SCI_Transporter::initSCI() {
|
|||||||
DBUG_RETURN(true);
|
DBUG_RETURN(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Uint32
|
||||||
|
SCI_Transporter::get_free_buffer() const
|
||||||
|
{
|
||||||
|
return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
|
||||||
|
}
|
||||||
|
@ -133,7 +133,8 @@ public:
|
|||||||
* remote segment is mapped. Otherwize false.
|
* remote segment is mapped. Otherwize false.
|
||||||
*/
|
*/
|
||||||
bool getConnectionStatus();
|
bool getConnectionStatus();
|
||||||
|
|
||||||
|
virtual Uint32 get_free_buffer() const;
|
||||||
private:
|
private:
|
||||||
SCI_Transporter(TransporterRegistry &t_reg,
|
SCI_Transporter(TransporterRegistry &t_reg,
|
||||||
const char *local_host,
|
const char *local_host,
|
||||||
|
@ -157,6 +157,7 @@ public:
|
|||||||
|
|
||||||
inline Uint32 getWriteIndex() const { return m_writeIndex;}
|
inline Uint32 getWriteIndex() const { return m_writeIndex;}
|
||||||
inline Uint32 getBufferSize() const { return m_bufferSize;}
|
inline Uint32 getBufferSize() const { return m_bufferSize;}
|
||||||
|
inline Uint32 get_free_buffer() const;
|
||||||
|
|
||||||
inline void copyIndexes(SHM_Writer * standbyWriter);
|
inline void copyIndexes(SHM_Writer * standbyWriter);
|
||||||
|
|
||||||
@ -212,5 +213,21 @@ SHM_Writer::updateWritePtr(Uint32 sz){
|
|||||||
m_writeIndex = tWriteIndex;
|
m_writeIndex = tWriteIndex;
|
||||||
* m_sharedWriteIndex = tWriteIndex;
|
* m_sharedWriteIndex = tWriteIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
Uint32
|
||||||
|
SHM_Writer::get_free_buffer() const
|
||||||
|
{
|
||||||
|
Uint32 tReadIndex = * m_sharedReadIndex;
|
||||||
|
Uint32 tWriteIndex = m_writeIndex;
|
||||||
|
|
||||||
|
Uint32 free;
|
||||||
|
if(tReadIndex <= tWriteIndex){
|
||||||
|
free = m_bufferSize + tReadIndex - tWriteIndex;
|
||||||
|
} else {
|
||||||
|
free = tReadIndex - tWriteIndex;
|
||||||
|
}
|
||||||
|
return free;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -365,3 +365,9 @@ SHM_Transporter::doSend()
|
|||||||
kill(m_remote_pid, g_ndb_shm_signum);
|
kill(m_remote_pid, g_ndb_shm_signum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Uint32
|
||||||
|
SHM_Transporter::get_free_buffer() const
|
||||||
|
{
|
||||||
|
return writer->get_free_buffer();
|
||||||
|
}
|
||||||
|
@ -139,6 +139,8 @@ protected:
|
|||||||
int m_remote_pid;
|
int m_remote_pid;
|
||||||
Uint32 m_last_signal;
|
Uint32 m_last_signal;
|
||||||
Uint32 m_signal_threshold;
|
Uint32 m_signal_threshold;
|
||||||
|
|
||||||
|
virtual Uint32 get_free_buffer() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _shmSegCreated;
|
bool _shmSegCreated;
|
||||||
|
@ -60,7 +60,7 @@ SendBuffer::bufferSize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Uint32
|
Uint32
|
||||||
SendBuffer::bufferSizeRemaining() {
|
SendBuffer::bufferSizeRemaining() const {
|
||||||
return (sizeOfBuffer - dataSize);
|
return (sizeOfBuffer - dataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ public:
|
|||||||
bool initBuffer(Uint32 aRemoteNodeId);
|
bool initBuffer(Uint32 aRemoteNodeId);
|
||||||
|
|
||||||
// Number of bytes remaining in the buffer
|
// Number of bytes remaining in the buffer
|
||||||
Uint32 bufferSizeRemaining();
|
Uint32 bufferSizeRemaining() const;
|
||||||
|
|
||||||
// Number of bytes of data in the buffer
|
// Number of bytes of data in the buffer
|
||||||
int bufferSize();
|
int bufferSize();
|
||||||
|
@ -253,6 +253,11 @@ TCP_Transporter::sendIsPossible(struct timeval * timeout) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Uint32
|
||||||
|
TCP_Transporter::get_free_buffer() const
|
||||||
|
{
|
||||||
|
return m_sendBuffer.bufferSizeRemaining();
|
||||||
|
}
|
||||||
|
|
||||||
Uint32 *
|
Uint32 *
|
||||||
TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio){
|
TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio){
|
||||||
|
@ -101,6 +101,7 @@ private:
|
|||||||
*/
|
*/
|
||||||
virtual void updateReceiveDataPtr(Uint32 bytesRead);
|
virtual void updateReceiveDataPtr(Uint32 bytesRead);
|
||||||
|
|
||||||
|
virtual Uint32 get_free_buffer() const;
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Setup client/server and perform connect/accept
|
* Setup client/server and perform connect/accept
|
||||||
|
@ -86,6 +86,8 @@ public:
|
|||||||
m_socket_client->set_port(port);
|
m_socket_client->set_port(port);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtual Uint32 get_free_buffer() const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Transporter(TransporterRegistry &,
|
Transporter(TransporterRegistry &,
|
||||||
TransporterType,
|
TransporterType,
|
||||||
|
@ -558,6 +558,18 @@ TransporterRegistry::removeTransporter(NodeId nodeId) {
|
|||||||
theTransporters[nodeId] = NULL;
|
theTransporters[nodeId] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Uint32
|
||||||
|
TransporterRegistry::get_free_buffer(Uint32 node) const
|
||||||
|
{
|
||||||
|
Transporter *t;
|
||||||
|
if(likely((t = theTransporters[node]) != 0))
|
||||||
|
{
|
||||||
|
return t->get_free_buffer();
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SendStatus
|
SendStatus
|
||||||
TransporterRegistry::prepareSend(const SignalHeader * const signalHeader,
|
TransporterRegistry::prepareSend(const SignalHeader * const signalHeader,
|
||||||
Uint8 prio,
|
Uint8 prio,
|
||||||
|
@ -5072,6 +5072,7 @@ Dbdih::invalidateNodeLCP(Signal* signal, Uint32 nodeId, TabRecordPtr tabPtr)
|
|||||||
* And reset nextLcp
|
* And reset nextLcp
|
||||||
*/
|
*/
|
||||||
replicaPtr.p->nextLcp = 0;
|
replicaPtr.p->nextLcp = 0;
|
||||||
|
replicaPtr.p->noCrashedReplicas = 0;
|
||||||
}//if
|
}//if
|
||||||
}//for
|
}//for
|
||||||
}//for
|
}//for
|
||||||
|
@ -133,6 +133,9 @@ void Dbtup::sendReadAttrinfo(Signal* signal,
|
|||||||
Uint32 ToutBufIndex,
|
Uint32 ToutBufIndex,
|
||||||
const Operationrec * const regOperPtr)
|
const Operationrec * const regOperPtr)
|
||||||
{
|
{
|
||||||
|
if(ToutBufIndex == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
const BlockReference recBlockref = regOperPtr->recBlockref;
|
const BlockReference recBlockref = regOperPtr->recBlockref;
|
||||||
const Uint32 sig0 = regOperPtr->tcOperationPtr;
|
const Uint32 sig0 = regOperPtr->tcOperationPtr;
|
||||||
const Uint32 sig1 = regOperPtr->transid1;
|
const Uint32 sig1 = regOperPtr->transid1;
|
||||||
|
@ -1668,7 +1668,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
|
|||||||
false,
|
false,
|
||||||
ConfigInfo::CI_INT,
|
ConfigInfo::CI_INT,
|
||||||
"256K",
|
"256K",
|
||||||
"16K",
|
"64K",
|
||||||
STR_VALUE(MAX_INT_RNIL) },
|
STR_VALUE(MAX_INT_RNIL) },
|
||||||
|
|
||||||
{
|
{
|
||||||
@ -1856,7 +1856,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
|
|||||||
false,
|
false,
|
||||||
ConfigInfo::CI_INT,
|
ConfigInfo::CI_INT,
|
||||||
"1M",
|
"1M",
|
||||||
"4K",
|
"64K",
|
||||||
STR_VALUE(MAX_INT_RNIL) },
|
STR_VALUE(MAX_INT_RNIL) },
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -1649,7 +1649,11 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
int distKeys= impl.m_noOfDistributionKeys;
|
int distKeys= impl.m_noOfDistributionKeys &&
|
||||||
|
impl.m_noOfDistributionKeys < impl.m_noOfKeys;
|
||||||
|
|
||||||
|
assert(distKeys == 0 || distKeys == 1);
|
||||||
|
|
||||||
for(i = 0; i<sz; i++){
|
for(i = 0; i<sz; i++){
|
||||||
const NdbColumnImpl * col = impl.m_columns[i];
|
const NdbColumnImpl * col = impl.m_columns[i];
|
||||||
if(col == 0)
|
if(col == 0)
|
||||||
@ -1661,7 +1665,7 @@ NdbDictInterface::createOrAlterTable(Ndb & ndb,
|
|||||||
tmpAttr.AttributeId = i;
|
tmpAttr.AttributeId = i;
|
||||||
tmpAttr.AttributeKeyFlag = col->m_pk;
|
tmpAttr.AttributeKeyFlag = col->m_pk;
|
||||||
tmpAttr.AttributeNullableFlag = col->m_nullable;
|
tmpAttr.AttributeNullableFlag = col->m_nullable;
|
||||||
tmpAttr.AttributeDKey = col->m_distributionKey;
|
tmpAttr.AttributeDKey = distKeys * col->m_distributionKey;
|
||||||
|
|
||||||
tmpAttr.AttributeExtType = (Uint32)col->m_type;
|
tmpAttr.AttributeExtType = (Uint32)col->m_type;
|
||||||
tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF);
|
tmpAttr.AttributeExtPrecision = ((unsigned)col->m_precision & 0xFFFF);
|
||||||
|
@ -104,8 +104,9 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
|
|||||||
{
|
{
|
||||||
Uint32 tTransId1, tTransId2;
|
Uint32 tTransId1, tTransId2;
|
||||||
Uint32 tReqInfo;
|
Uint32 tReqInfo;
|
||||||
Uint32 tInterpretInd = theInterpretIndicator;
|
Uint8 tInterpretInd = theInterpretIndicator;
|
||||||
|
Uint8 tDirtyIndicator = theDirtyIndicator;
|
||||||
|
Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len;
|
||||||
theErrorLine = 0;
|
theErrorLine = 0;
|
||||||
|
|
||||||
if (tInterpretInd != 1) {
|
if (tInterpretInd != 1) {
|
||||||
@ -123,7 +124,13 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
|
|||||||
if (tStatus != GetValue) {
|
if (tStatus != GetValue) {
|
||||||
setErrorCodeAbort(4116);
|
setErrorCodeAbort(4116);
|
||||||
return -1;
|
return -1;
|
||||||
}//if
|
}
|
||||||
|
else if(unlikely(tDirtyIndicator && tTotalCurrAI_Len == 0))
|
||||||
|
{
|
||||||
|
getValue(NdbDictionary::Column::FRAGMENT);
|
||||||
|
tTotalCurrAI_Len = theTotalCurrAI_Len;
|
||||||
|
assert(theTotalCurrAI_Len);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setErrorCodeAbort(4005);
|
setErrorCodeAbort(4005);
|
||||||
return -1;
|
return -1;
|
||||||
@ -132,6 +139,7 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
|
|||||||
if (prepareSendInterpreted() == -1) {
|
if (prepareSendInterpreted() == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
}//if
|
}//if
|
||||||
|
tTotalCurrAI_Len = theTotalCurrAI_Len;
|
||||||
}//if
|
}//if
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
@ -140,7 +148,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
|
|||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
TcKeyReq * const tcKeyReq = CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend());
|
TcKeyReq * const tcKeyReq = CAST_PTR(TcKeyReq, theTCREQ->getDataPtrSend());
|
||||||
|
|
||||||
Uint32 tTotalCurrAI_Len = theTotalCurrAI_Len;
|
|
||||||
Uint32 tTableId = m_currentTable->m_tableId;
|
Uint32 tTableId = m_currentTable->m_tableId;
|
||||||
Uint32 tSchemaVersion = m_currentTable->m_version;
|
Uint32 tSchemaVersion = m_currentTable->m_version;
|
||||||
|
|
||||||
@ -188,7 +195,6 @@ NdbOperation::prepareSend(Uint32 aTC_ConnectPtr, Uint64 aTransId)
|
|||||||
tcKeyReq->setStartFlag(tReqInfo, tStartIndicator);
|
tcKeyReq->setStartFlag(tReqInfo, tStartIndicator);
|
||||||
tcKeyReq->setInterpretedFlag(tReqInfo, tInterpretIndicator);
|
tcKeyReq->setInterpretedFlag(tReqInfo, tInterpretIndicator);
|
||||||
|
|
||||||
Uint8 tDirtyIndicator = theDirtyIndicator;
|
|
||||||
OperationType tOperationType = theOperationType;
|
OperationType tOperationType = theOperationType;
|
||||||
Uint32 tTupKeyLen = theTupKeyLen;
|
Uint32 tTupKeyLen = theTupKeyLen;
|
||||||
Uint8 abortOption =
|
Uint8 abortOption =
|
||||||
|
@ -866,6 +866,112 @@ int runUpdateWithoutKeys(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int runReadWithoutGetValue(NDBT_Context* ctx, NDBT_Step* step){
|
||||||
|
int result = NDBT_OK;
|
||||||
|
const NdbDictionary::Table* pTab = ctx->getTab();
|
||||||
|
|
||||||
|
HugoOperations hugoOps(*pTab);
|
||||||
|
|
||||||
|
Ndb* pNdb = GETNDB(step);
|
||||||
|
Uint32 lm;
|
||||||
|
|
||||||
|
for(Uint32 cm= 0; cm < 2; cm++)
|
||||||
|
{
|
||||||
|
for(lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++)
|
||||||
|
{
|
||||||
|
NdbConnection* pCon = pNdb->startTransaction();
|
||||||
|
if (pCon == NULL){
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NdbOperation* pOp = pCon->getNdbOperation(pTab->getName());
|
||||||
|
if (pOp == NULL){
|
||||||
|
ERR(pCon->getNdbError());
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pOp->readTuple((NdbOperation::LockMode)lm) != 0){
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
ERR(pOp->getNdbError());
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int a = 0; a<pTab->getNoOfColumns(); a++){
|
||||||
|
if (pTab->getColumn(a)->getPrimaryKey() == true){
|
||||||
|
if(hugoOps.equalForAttr(pOp, a, 1) != 0){
|
||||||
|
ERR(pCon->getNdbError());
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Dont' call any getValues
|
||||||
|
|
||||||
|
// Execute should work
|
||||||
|
int check = pCon->execute(cm == 0 ? NoCommit : Commit);
|
||||||
|
if (check == 0){
|
||||||
|
ndbout << "execute worked" << endl;
|
||||||
|
} else {
|
||||||
|
ERR(pCon->getNdbError());
|
||||||
|
result = NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Now test scans
|
||||||
|
*/
|
||||||
|
for(lm= 0; lm <= NdbOperation::LM_CommittedRead; lm++)
|
||||||
|
{
|
||||||
|
NdbConnection* pCon = pNdb->startTransaction();
|
||||||
|
if (pCon == NULL){
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NdbScanOperation* pOp = pCon->getNdbScanOperation(pTab->getName());
|
||||||
|
if (pOp == NULL){
|
||||||
|
ERR(pCon->getNdbError());
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((pOp->readTuples((NdbOperation::LockMode)lm)) != 0){
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
ERR(pOp->getNdbError());
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Dont' call any getValues
|
||||||
|
|
||||||
|
// Execute should work
|
||||||
|
int check = pCon->execute(NoCommit);
|
||||||
|
if (check == 0){
|
||||||
|
ndbout << "execute worked" << endl;
|
||||||
|
} else {
|
||||||
|
ERR(pCon->getNdbError());
|
||||||
|
result = NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
int res;
|
||||||
|
while((res = pOp->nextResult()) == 0);
|
||||||
|
pNdb->closeTransaction(pCon);
|
||||||
|
|
||||||
|
if(res != 1)
|
||||||
|
result = NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int runCheckGetNdbErrorOperation(NDBT_Context* ctx, NDBT_Step* step){
|
int runCheckGetNdbErrorOperation(NDBT_Context* ctx, NDBT_Step* step){
|
||||||
int result = NDBT_OK;
|
int result = NDBT_OK;
|
||||||
const NdbDictionary::Table* pTab = ctx->getTab();
|
const NdbDictionary::Table* pTab = ctx->getTab();
|
||||||
@ -1000,6 +1106,12 @@ TESTCASE("NdbErrorOperation",
|
|||||||
"Test that NdbErrorOperation is properly set"){
|
"Test that NdbErrorOperation is properly set"){
|
||||||
INITIALIZER(runCheckGetNdbErrorOperation);
|
INITIALIZER(runCheckGetNdbErrorOperation);
|
||||||
}
|
}
|
||||||
|
TESTCASE("ReadWithoutGetValue",
|
||||||
|
"Test that it's possible to perform read wo/ getvalue's\n"){
|
||||||
|
INITIALIZER(runLoadTable);
|
||||||
|
INITIALIZER(runReadWithoutGetValue);
|
||||||
|
FINALIZER(runClearTable);
|
||||||
|
}
|
||||||
NDBT_TESTSUITE_END(testNdbApi);
|
NDBT_TESTSUITE_END(testNdbApi);
|
||||||
|
|
||||||
int main(int argc, const char** argv){
|
int main(int argc, const char** argv){
|
||||||
|
@ -512,6 +512,10 @@ max-time: 500
|
|||||||
cmd: testNdbApi
|
cmd: testNdbApi
|
||||||
args: -n UpdateWithoutValues T6
|
args: -n UpdateWithoutValues T6
|
||||||
|
|
||||||
|
max-time: 500
|
||||||
|
cmd: testNdbApi
|
||||||
|
args: -n ReadWithoutGetValue
|
||||||
|
|
||||||
#max-time: 500
|
#max-time: 500
|
||||||
#cmd: testInterpreter
|
#cmd: testInterpreter
|
||||||
#args: T1
|
#args: T1
|
||||||
|
@ -1,10 +1,20 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
#############################################################
|
||||||
|
# This script created by Jonas does the following #
|
||||||
|
# Cleans up clones and pevious builds, pulls new clones, #
|
||||||
|
# builds, deploys, configures the tests and launches ATRT #
|
||||||
|
#############################################################
|
||||||
|
|
||||||
|
###############
|
||||||
|
#Script setup #
|
||||||
|
##############
|
||||||
|
|
||||||
save_args=$*
|
save_args=$*
|
||||||
VERSION="ndb-autotest.sh version 1.04"
|
VERSION="ndb-autotest.sh version 1.04"
|
||||||
|
|
||||||
DATE=`date '+%Y-%m-%d'`
|
DATE=`date '+%Y-%m-%d'`
|
||||||
export DATE
|
HOST=`hostname -s`
|
||||||
|
export DATE HOST
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
ulimit -Sc unlimited
|
ulimit -Sc unlimited
|
||||||
@ -14,21 +24,33 @@ echo "`date` starting: $*"
|
|||||||
RSYNC_RSH=ssh
|
RSYNC_RSH=ssh
|
||||||
export RSYNC_RSH
|
export RSYNC_RSH
|
||||||
|
|
||||||
|
verbose=0
|
||||||
do_clone=yes
|
do_clone=yes
|
||||||
build=yes
|
build=yes
|
||||||
deploy=yes
|
deploy=yes
|
||||||
|
run_test=yes
|
||||||
|
config=yes
|
||||||
|
report=yes
|
||||||
|
|
||||||
clone=5.0-ndb
|
clone=5.0-ndb
|
||||||
RUN="daily-basic daily-devel"
|
RUN="daily-basic daily-devel"
|
||||||
conf=autotest.conf
|
conf=autotest.conf
|
||||||
|
|
||||||
|
############################
|
||||||
|
# Read command line entries#
|
||||||
|
############################
|
||||||
|
|
||||||
while [ "$1" ]
|
while [ "$1" ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--no-clone) do_clone="";;
|
--no-clone) do_clone="";;
|
||||||
--no-build) build="";;
|
--no-build) build="";;
|
||||||
--no-deploy) deploy="";;
|
--no-deploy) deploy="";;
|
||||||
--clone=*) clone=`echo $1 | sed s/--clone=//`;;
|
--no-test) run_test="";;
|
||||||
|
--no-config) config="";;
|
||||||
|
--no-report) report="";;
|
||||||
|
--verbose) verbose=`expr $verbose + 1`;;
|
||||||
|
--clone=*) clone=`echo $1 | sed s/--clone=//`;;
|
||||||
--conf=*) conf=`echo $1 | sed s/--conf=//`;;
|
--conf=*) conf=`echo $1 | sed s/--conf=//`;;
|
||||||
--version) echo $VERSION; exit;;
|
--version) echo $VERSION; exit;;
|
||||||
*) RUN=$*;;
|
*) RUN=$*;;
|
||||||
@ -36,6 +58,12 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
#################################
|
||||||
|
#Make sure the configfile exists#
|
||||||
|
#if it does not exit. if it does#
|
||||||
|
# (.) load it #
|
||||||
|
#################################
|
||||||
|
|
||||||
if [ -f $conf ]
|
if [ -f $conf ]
|
||||||
then
|
then
|
||||||
. $conf
|
. $conf
|
||||||
@ -44,51 +72,119 @@ else
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
env
|
###############################
|
||||||
|
# Validate that all interesting
|
||||||
|
# variables where set in conf
|
||||||
|
###############################
|
||||||
|
vars="target base_dir src_clone_base install_dir build_dir hosts configure"
|
||||||
|
if [ "$report" ]
|
||||||
|
then
|
||||||
|
vars="$vars result_host result_path"
|
||||||
|
fi
|
||||||
|
for i in $vars
|
||||||
|
do
|
||||||
|
t=`echo echo \\$$i`
|
||||||
|
if [ -z `eval $t` ]
|
||||||
|
then
|
||||||
|
echo "Invalid config: $conf, variable $i is not set"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
###############################
|
||||||
|
#Print out the enviroment vars#
|
||||||
|
###############################
|
||||||
|
|
||||||
|
if [ $verbose -gt 0 ]
|
||||||
|
then
|
||||||
|
env
|
||||||
|
fi
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# Setup the lock file name and path#
|
||||||
|
# Setup the clone source location #
|
||||||
|
####################################
|
||||||
|
|
||||||
LOCK=$HOME/.autotest-lock
|
LOCK=$HOME/.autotest-lock
|
||||||
src_clone=$src_clone_base-$clone
|
src_clone=$src_clone_base-$clone
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# Check to see if the lock file exists#
|
||||||
|
# If it does exit. #
|
||||||
|
#######################################
|
||||||
|
|
||||||
if [ -f $LOCK ]
|
if [ -f $LOCK ]
|
||||||
then
|
then
|
||||||
echo "Lock file exists: $LOCK"
|
echo "Lock file exists: $LOCK"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#######################################
|
||||||
|
# If the lock file does not exist then#
|
||||||
|
# create it with date and run info #
|
||||||
|
#######################################
|
||||||
|
|
||||||
echo "$DATE $RUN" > $LOCK
|
echo "$DATE $RUN" > $LOCK
|
||||||
|
|
||||||
|
#############################
|
||||||
|
#If any errors here down, we#
|
||||||
|
# trap them, and remove the #
|
||||||
|
# Lock file before exit #
|
||||||
|
#############################
|
||||||
|
|
||||||
trap "rm -f $LOCK" ERR
|
trap "rm -f $LOCK" ERR
|
||||||
|
|
||||||
|
# You can add more to this path#
|
||||||
|
################################
|
||||||
|
|
||||||
dst_place=${build_dir}/clone-mysql-$clone-$DATE
|
dst_place=${build_dir}/clone-mysql-$clone-$DATE
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# Delete source and pull down the latest#
|
||||||
|
#########################################
|
||||||
|
|
||||||
if [ "$do_clone" ]
|
if [ "$do_clone" ]
|
||||||
then
|
then
|
||||||
rm -rf $dst_place
|
rm -rf $dst_place
|
||||||
bk clone $src_clone $dst_place
|
bk clone $src_clone $dst_place
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
##########################################
|
||||||
|
# Build the source, make installs, and #
|
||||||
|
# create the database to be rsynced #
|
||||||
|
##########################################
|
||||||
|
|
||||||
if [ "$build" ]
|
if [ "$build" ]
|
||||||
then
|
then
|
||||||
cd $dst_place
|
cd $dst_place
|
||||||
rm -rf $run_dir/*
|
rm -rf $install_dir/*
|
||||||
aclocal; autoheader; autoconf; automake
|
if [ -x BUILD/autorun.sh ]
|
||||||
if [ -d storage ]
|
|
||||||
then
|
then
|
||||||
(cd storage/innobase; aclocal; autoheader; autoconf; automake)
|
./BUILD/autorun.sh
|
||||||
(cd storage/bdb/dist; sh s_all)
|
|
||||||
else
|
else
|
||||||
(cd innobase; aclocal; autoheader; autoconf; automake)
|
aclocal; autoheader; autoconf; automake
|
||||||
(cd bdb/dist; sh s_all)
|
if [ -d storage ]
|
||||||
|
then
|
||||||
|
(cd storage/innobase; aclocal; autoheader; autoconf; automake)
|
||||||
|
(cd storage/bdb/dist; sh s_all)
|
||||||
|
else
|
||||||
|
(cd innobase; aclocal; autoheader; autoconf; automake)
|
||||||
|
(cd bdb/dist; sh s_all)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
eval $configure --prefix=$run_dir
|
eval $configure --prefix=$install_dir
|
||||||
make
|
make
|
||||||
make install
|
make install
|
||||||
(cd $run_dir; ./bin/mysql_install_db)
|
(cd $install_dir; ./bin/mysql_install_db) # This will be rsynced to all
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###
|
################################
|
||||||
# check script version
|
# check script version. If the #
|
||||||
#
|
# version is old, replace it #
|
||||||
script=$run_dir/mysql-test/ndb/ndb-autotest.sh
|
# and restart #
|
||||||
|
################################
|
||||||
|
|
||||||
|
script=$install_dir/mysql-test/ndb/ndb-autotest.sh
|
||||||
if [ -x $script ]
|
if [ -x $script ]
|
||||||
then
|
then
|
||||||
$script --version > /tmp/version.$$
|
$script --version > /tmp/version.$$
|
||||||
@ -100,21 +196,34 @@ rm -f /tmp/version.$$
|
|||||||
if [ $match -eq 0 ]
|
if [ $match -eq 0 ]
|
||||||
then
|
then
|
||||||
echo "Incorrect script version...restarting"
|
echo "Incorrect script version...restarting"
|
||||||
cp $run_dir/mysql-test/ndb/ndb-autotest.sh /tmp/at.$$.sh
|
cp $install_dir/mysql-test/ndb/ndb-autotest.sh /tmp/at.$$.sh
|
||||||
rm -rf $run_dir $dst_place
|
rm -rf $install_dir $dst_place
|
||||||
sh /tmp/at.$$.sh $save_args
|
sh /tmp/at.$$.sh $save_args
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that all interesting files are present
|
###############################################
|
||||||
test_dir=$run_dir/mysql-test/ndb
|
# Check that all interesting files are present#
|
||||||
|
###############################################
|
||||||
|
|
||||||
|
test_dir=$install_dir/mysql-test/ndb
|
||||||
atrt=$test_dir/atrt
|
atrt=$test_dir/atrt
|
||||||
html=$test_dir/make-html-reports.sh
|
html=$test_dir/make-html-reports.sh
|
||||||
mkconfig=$run_dir/mysql-test/ndb/make-config.sh
|
mkconfig=$install_dir/mysql-test/ndb/make-config.sh
|
||||||
|
|
||||||
PATH=$run_dir/bin:$test_dir:$PATH
|
##########################
|
||||||
|
#Setup bin and test paths#
|
||||||
|
##########################
|
||||||
|
|
||||||
|
PATH=$install_dir/bin:$test_dir:$PATH
|
||||||
export PATH
|
export PATH
|
||||||
|
|
||||||
|
###########################
|
||||||
|
# This will filter out all#
|
||||||
|
# the host that did not #
|
||||||
|
# respond. Called below #
|
||||||
|
###########################
|
||||||
|
|
||||||
filter(){
|
filter(){
|
||||||
neg=$1
|
neg=$1
|
||||||
shift
|
shift
|
||||||
@ -125,18 +234,22 @@ filter(){
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
###
|
############################
|
||||||
# check ndb_cpcc fail hosts
|
# check ndb_cpcc fail hosts#
|
||||||
#
|
############################
|
||||||
ndb_cpcc $hosts | awk '{ if($1=="Failed"){ print;}}' > /tmp/failed.$DATE
|
ndb_cpcc $hosts | awk '{ if($1=="Failed"){ print;}}' > /tmp/failed.$DATE
|
||||||
filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
|
filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
|
||||||
hosts=`cat /tmp/hosts.$DATE`
|
hosts=`cat /tmp/hosts.$DATE`
|
||||||
|
|
||||||
|
#############################
|
||||||
|
# Push bin and test to hosts#
|
||||||
|
#############################
|
||||||
|
|
||||||
if [ "$deploy" ]
|
if [ "$deploy" ]
|
||||||
then
|
then
|
||||||
for i in $hosts
|
for i in $hosts
|
||||||
do
|
do
|
||||||
rsync -a --delete --force --ignore-errors $run_dir/ $i:$run_dir
|
rsync -a --delete --force --ignore-errors $install_dir/ $i:$install_dir
|
||||||
ok=$?
|
ok=$?
|
||||||
if [ $ok -ne 0 ]
|
if [ $ok -ne 0 ]
|
||||||
then
|
then
|
||||||
@ -145,7 +258,6 @@ then
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
rm -f /tmp/build.$DATE.tgz
|
|
||||||
|
|
||||||
###
|
###
|
||||||
# handle scp failed hosts
|
# handle scp failed hosts
|
||||||
@ -154,9 +266,11 @@ filter /tmp/failed.$DATE $hosts > /tmp/hosts.$DATE
|
|||||||
hosts=`cat /tmp/hosts.$DATE`
|
hosts=`cat /tmp/hosts.$DATE`
|
||||||
cat /tmp/failed.$DATE > /tmp/filter_hosts.$$
|
cat /tmp/failed.$DATE > /tmp/filter_hosts.$$
|
||||||
|
|
||||||
###
|
#############################
|
||||||
# functions for running atrt
|
# Function for replacing the#
|
||||||
#
|
# choose host with real host#
|
||||||
|
# names. Note $$ = PID #
|
||||||
|
#############################
|
||||||
choose(){
|
choose(){
|
||||||
SRC=$1
|
SRC=$1
|
||||||
TMP1=/tmp/choose.$$
|
TMP1=/tmp/choose.$$
|
||||||
@ -177,16 +291,25 @@ choose(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
choose_conf(){
|
choose_conf(){
|
||||||
host=`hostname -s`
|
if [ -f $test_dir/conf-$1-$HOST.txt ]
|
||||||
if [ -f $test_dir/conf-$1-$host.txt ]
|
then
|
||||||
then
|
echo "$test_dir/conf-$1-$HOST.txt"
|
||||||
echo "$test_dir/conf-$1-$host.txt"
|
echo "$test_dir/conf-$1-$host.txt"
|
||||||
elif [ -f $test_dir/conf-$1.txt ]
|
elif [ -f $test_dir/conf-$1.txt ]
|
||||||
then
|
then
|
||||||
echo "$test_dir/conf-$1.txt"
|
echo "$test_dir/conf-$1.txt"
|
||||||
|
else
|
||||||
|
echo "Unable to find conf file looked for" 1>&2
|
||||||
|
echo "$testdir/conf-$1-host.txt and" 1>&2
|
||||||
|
echo "$testdir/conf-$1.txt" 1>&2
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
######################################
|
||||||
|
# Starts ATRT and gives it the right #
|
||||||
|
# command line options. after it #
|
||||||
|
# Gathers results and moves them #
|
||||||
|
######################################
|
||||||
start(){
|
start(){
|
||||||
rm -rf report.txt result* log.txt
|
rm -rf report.txt result* log.txt
|
||||||
$atrt -v -v -r -R --log-file=log.txt --testcase-file=$test_dir/$2-tests.txt &
|
$atrt -v -v -r -R --log-file=log.txt --testcase-file=$test_dir/$2-tests.txt &
|
||||||
@ -202,17 +325,31 @@ start(){
|
|||||||
cd ..
|
cd ..
|
||||||
p2=`pwd`
|
p2=`pwd`
|
||||||
cd ..
|
cd ..
|
||||||
tar cfz /tmp/res.$$.tgz `basename $p2`/$DATE
|
if [ "$report" ]
|
||||||
scp /tmp/res.$$.tgz $result_host:$result_path/res.$DATE.`hostname -s`.$2.$$.tgz
|
then
|
||||||
rm -f /tmp/res.$$.tgz
|
tar cfz /tmp/res.$2.$$.tgz `basename $p2`/$DATE
|
||||||
|
scp /tmp/res.$2.$$.tgz \
|
||||||
|
$result_host:$result_path/res.$DATE.$HOST.$2.$$.tgz
|
||||||
|
rm -f /tmp/res.$2.$$.tgz
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#########################################
|
||||||
|
# Count how many computers we have ready#
|
||||||
|
#########################################
|
||||||
|
|
||||||
count_hosts(){
|
count_hosts(){
|
||||||
cnt=`grep "CHOOSE_host" $1 |
|
cnt=`grep "CHOOSE_host" $1 | awk '{for(i=1; i<=NF;i++) \
|
||||||
awk '{for(i=1; i<=NF;i++) if(match($i, "CHOOSE_host") > 0) print $i;}' |
|
if(match($i, "CHOOSE_host") > 0) print $i;}' | sort | uniq | wc -l`
|
||||||
sort | uniq | wc -l`
|
|
||||||
echo $cnt
|
echo $cnt
|
||||||
}
|
}
|
||||||
|
#######################################################
|
||||||
|
# Calls: Choose #
|
||||||
|
# Choose_host #
|
||||||
|
# Count_host #
|
||||||
|
# start #
|
||||||
|
# for each directory in the $RUN variable #
|
||||||
|
#######################################################
|
||||||
|
|
||||||
p=`pwd`
|
p=`pwd`
|
||||||
for dir in $RUN
|
for dir in $RUN
|
||||||
@ -223,26 +360,36 @@ do
|
|||||||
res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE
|
res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE
|
||||||
|
|
||||||
mkdir -p $run_dir $res_dir
|
mkdir -p $run_dir $res_dir
|
||||||
rm -rf $res_dir/* $run_dir/*
|
rm -rf $res_dir/*
|
||||||
|
cd $run_dir
|
||||||
conf=`choose_conf $dir`
|
|
||||||
count=`count_hosts $conf`
|
if [ "$config" ]
|
||||||
avail_hosts=`filter /tmp/filter_hosts.$$ $hosts`
|
|
||||||
avail=`echo $avail_hosts | wc -w`
|
|
||||||
if [ $count -gt $avail ]
|
|
||||||
then
|
then
|
||||||
|
rm -rf $run_dir/*
|
||||||
|
|
||||||
|
conf=`choose_conf $dir`
|
||||||
|
count=`count_hosts $conf`
|
||||||
|
avail_hosts=`filter /tmp/filter_hosts.$$ $hosts`
|
||||||
|
avail=`echo $avail_hosts | wc -w`
|
||||||
|
if [ $count -gt $avail ]
|
||||||
|
then
|
||||||
echo "Not enough hosts"
|
echo "Not enough hosts"
|
||||||
echo "Needs: $count available: $avail ($avail_hosts)"
|
echo "Needs: $count available: $avail ($avail_hosts)"
|
||||||
break;
|
break;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
run_hosts=`echo $avail_hosts|awk '{for(i=1;i<='$count';i++)print $i;}'`
|
run_hosts=`echo $avail_hosts| \
|
||||||
echo $run_hosts >> /tmp/filter_hosts.$$
|
awk '{for(i=1;i<='$count';i++)print $i;}'`
|
||||||
|
echo $run_hosts >> /tmp/filter_hosts.$$
|
||||||
|
|
||||||
cd $run_dir
|
choose $conf $run_hosts > d.tmp
|
||||||
choose $conf $run_hosts > d.tmp
|
$mkconfig d.tmp
|
||||||
$mkconfig d.tmp
|
fi
|
||||||
start $dir-mysql-$clone-$target $dir $res_dir &
|
|
||||||
|
if [ "$run_test" ]
|
||||||
|
then
|
||||||
|
start $dir-mysql-$clone-$target $dir $res_dir &
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
cd $p
|
cd $p
|
||||||
rm /tmp/filter_hosts.$$
|
rm /tmp/filter_hosts.$$
|
||||||
|
@ -30,10 +30,12 @@ int main(int argc, const char** argv){
|
|||||||
const char* _tabname = NULL;
|
const char* _tabname = NULL;
|
||||||
int _help = 0;
|
int _help = 0;
|
||||||
int _batch = 512;
|
int _batch = 512;
|
||||||
|
const char* db = 0;
|
||||||
|
|
||||||
struct getargs args[] = {
|
struct getargs args[] = {
|
||||||
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
|
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
|
||||||
{ "batch", 'b', arg_integer, &_batch, "Number of operations in each transaction", "batch" },
|
{ "batch", 'b', arg_integer, &_batch, "Number of operations in each transaction", "batch" },
|
||||||
|
{ "database", 'd', arg_string, &db, "Database", "" },
|
||||||
{ "usage", '?', arg_flag, &_help, "Print help", "" }
|
{ "usage", '?', arg_flag, &_help, "Print help", "" }
|
||||||
};
|
};
|
||||||
int num_args = sizeof(args) / sizeof(args[0]);
|
int num_args = sizeof(args) / sizeof(args[0]);
|
||||||
@ -59,7 +61,7 @@ int main(int argc, const char** argv){
|
|||||||
{
|
{
|
||||||
return NDBT_ProgramExit(NDBT_FAILED);
|
return NDBT_ProgramExit(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
Ndb MyNdb(&con, "TEST_DB" );
|
Ndb MyNdb( &con, db ? db : "TEST_DB" );
|
||||||
|
|
||||||
if(MyNdb.init() != 0){
|
if(MyNdb.init() != 0){
|
||||||
ERR(MyNdb.getNdbError());
|
ERR(MyNdb.getNdbError());
|
||||||
|
@ -33,7 +33,7 @@ int main(int argc, const char** argv){
|
|||||||
int _loops = 1;
|
int _loops = 1;
|
||||||
int _abort = 0;
|
int _abort = 0;
|
||||||
int _batch = 0;
|
int _batch = 0;
|
||||||
const char* _tabname = NULL;
|
const char* _tabname = NULL, *db = 0;
|
||||||
int _help = 0;
|
int _help = 0;
|
||||||
|
|
||||||
struct getargs args[] = {
|
struct getargs args[] = {
|
||||||
@ -41,7 +41,8 @@ int main(int argc, const char** argv){
|
|||||||
{ "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" },
|
{ "loops", 'l', arg_integer, &_loops, "number of times to run this program(0=infinite loop)", "loops" },
|
||||||
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
|
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
|
||||||
{ "records", 'r', arg_integer, &_records, "Number of records", "records" },
|
{ "records", 'r', arg_integer, &_records, "Number of records", "records" },
|
||||||
{ "usage", '?', arg_flag, &_help, "Print help", "" }
|
{ "usage", '?', arg_flag, &_help, "Print help", "" },
|
||||||
|
{ "database", 'd', arg_string, &db, "Database", "" }
|
||||||
};
|
};
|
||||||
int num_args = sizeof(args) / sizeof(args[0]);
|
int num_args = sizeof(args) / sizeof(args[0]);
|
||||||
int optind = 0;
|
int optind = 0;
|
||||||
@ -62,7 +63,7 @@ int main(int argc, const char** argv){
|
|||||||
{
|
{
|
||||||
return NDBT_ProgramExit(NDBT_FAILED);
|
return NDBT_ProgramExit(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
Ndb MyNdb(&con, "TEST_DB" );
|
Ndb MyNdb( &con, db ? db : "TEST_DB" );
|
||||||
|
|
||||||
if(MyNdb.init() != 0){
|
if(MyNdb.init() != 0){
|
||||||
ERR(MyNdb.getNdbError());
|
ERR(MyNdb.getNdbError());
|
||||||
|
@ -33,7 +33,7 @@ int main(int argc, const char** argv){
|
|||||||
int _loops = 1;
|
int _loops = 1;
|
||||||
int _abort = 0;
|
int _abort = 0;
|
||||||
int _parallelism = 1;
|
int _parallelism = 1;
|
||||||
const char* _tabname = NULL;
|
const char* _tabname = NULL, *db = 0;
|
||||||
int _help = 0;
|
int _help = 0;
|
||||||
int lock = NdbOperation::LM_Read;
|
int lock = NdbOperation::LM_Read;
|
||||||
int sorted = 0;
|
int sorted = 0;
|
||||||
@ -45,7 +45,8 @@ int main(int argc, const char** argv){
|
|||||||
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
|
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
|
||||||
{ "usage", '?', arg_flag, &_help, "Print help", "" },
|
{ "usage", '?', arg_flag, &_help, "Print help", "" },
|
||||||
{ "lock", 'm', arg_integer, &lock, "lock mode", "" },
|
{ "lock", 'm', arg_integer, &lock, "lock mode", "" },
|
||||||
{ "sorted", 's', arg_flag, &sorted, "sorted", "" }
|
{ "sorted", 's', arg_flag, &sorted, "sorted", "" },
|
||||||
|
{ "database", 'd', arg_string, &db, "Database", "" }
|
||||||
};
|
};
|
||||||
int num_args = sizeof(args) / sizeof(args[0]);
|
int num_args = sizeof(args) / sizeof(args[0]);
|
||||||
int optind = 0;
|
int optind = 0;
|
||||||
@ -66,7 +67,7 @@ int main(int argc, const char** argv){
|
|||||||
{
|
{
|
||||||
return NDBT_ProgramExit(NDBT_FAILED);
|
return NDBT_ProgramExit(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
Ndb MyNdb(&con, "TEST_DB" );
|
Ndb MyNdb( &con, db ? db : "TEST_DB" );
|
||||||
|
|
||||||
if(MyNdb.init() != 0){
|
if(MyNdb.init() != 0){
|
||||||
ERR(MyNdb.getNdbError());
|
ERR(MyNdb.getNdbError());
|
||||||
|
@ -33,7 +33,7 @@ int main(int argc, const char** argv){
|
|||||||
int _loops = 1;
|
int _loops = 1;
|
||||||
int _parallelism = 1;
|
int _parallelism = 1;
|
||||||
int _ver2 = 0;
|
int _ver2 = 0;
|
||||||
const char* _tabname = NULL;
|
const char* _tabname = NULL, *db = 0;
|
||||||
int _help = 0;
|
int _help = 0;
|
||||||
|
|
||||||
struct getargs args[] = {
|
struct getargs args[] = {
|
||||||
@ -42,7 +42,8 @@ int main(int argc, const char** argv){
|
|||||||
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
|
{ "records", 'r', arg_integer, &_records, "Number of records", "recs" },
|
||||||
{ "ver2", '2', arg_flag, &_ver2, "Use version 2 of scanUpdateRecords", "" },
|
{ "ver2", '2', arg_flag, &_ver2, "Use version 2 of scanUpdateRecords", "" },
|
||||||
{ "ver2", '1', arg_negative_flag, &_ver2, "Use version 1 of scanUpdateRecords (default)", "" },
|
{ "ver2", '1', arg_negative_flag, &_ver2, "Use version 1 of scanUpdateRecords (default)", "" },
|
||||||
{ "usage", '?', arg_flag, &_help, "Print help", "" }
|
{ "usage", '?', arg_flag, &_help, "Print help", "" },
|
||||||
|
{ "database", 'd', arg_string, &db, "Database", "" }
|
||||||
};
|
};
|
||||||
int num_args = sizeof(args) / sizeof(args[0]);
|
int num_args = sizeof(args) / sizeof(args[0]);
|
||||||
int optind = 0;
|
int optind = 0;
|
||||||
@ -63,7 +64,7 @@ int main(int argc, const char** argv){
|
|||||||
{
|
{
|
||||||
return NDBT_ProgramExit(NDBT_FAILED);
|
return NDBT_ProgramExit(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
Ndb MyNdb(&con, "TEST_DB" );
|
Ndb MyNdb( &con, db ? db : "TEST_DB" );
|
||||||
|
|
||||||
if(MyNdb.init() != 0){
|
if(MyNdb.init() != 0){
|
||||||
ERR(MyNdb.getNdbError());
|
ERR(MyNdb.getNdbError());
|
||||||
@ -100,6 +101,7 @@ int main(int argc, const char** argv){
|
|||||||
return NDBT_ProgramExit(NDBT_FAILED);
|
return NDBT_ProgramExit(NDBT_FAILED);
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
//NdbSleep_MilliSleep(300);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NDBT_ProgramExit(NDBT_OK);
|
return NDBT_ProgramExit(NDBT_OK);
|
||||||
|
@ -30,7 +30,8 @@ ndb_restore_SOURCES = restore/restore_main.cpp \
|
|||||||
restore/consumer.cpp \
|
restore/consumer.cpp \
|
||||||
restore/consumer_restore.cpp \
|
restore/consumer_restore.cpp \
|
||||||
restore/consumer_printer.cpp \
|
restore/consumer_printer.cpp \
|
||||||
restore/Restore.cpp
|
restore/Restore.cpp \
|
||||||
|
../test/src/NDBT_ResultRow.cpp $(tools_common_sources)
|
||||||
|
|
||||||
include $(top_srcdir)/ndb/config/common.mk.am
|
include $(top_srcdir)/ndb/config/common.mk.am
|
||||||
include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am
|
include $(top_srcdir)/ndb/config/type_ndbapitools.mk.am
|
||||||
|
@ -925,19 +925,12 @@ operator<<(NdbOut& ndbout, const LogEntry& logE)
|
|||||||
return ndbout;
|
return ndbout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <NDBT.hpp>
|
||||||
|
|
||||||
NdbOut &
|
NdbOut &
|
||||||
operator<<(NdbOut& ndbout, const TableS & table){
|
operator<<(NdbOut& ndbout, const TableS & table){
|
||||||
ndbout << endl << "Table: " << table.getTableName() << endl;
|
|
||||||
for (int j = 0; j < table.getNoOfAttributes(); j++)
|
ndbout << (* (NDBT_Table*)table.m_dictTable) << endl;
|
||||||
{
|
|
||||||
const AttributeDesc * desc = table[j];
|
|
||||||
ndbout << desc->m_column->getName() << ": "
|
|
||||||
<< (Uint32) desc->m_column->getType();
|
|
||||||
ndbout << " key: " << (Uint32) desc->m_column->getPrimaryKey();
|
|
||||||
ndbout << " array: " << desc->arraySize;
|
|
||||||
ndbout << " size: " << desc->size << endl;
|
|
||||||
} // for
|
|
||||||
return ndbout;
|
return ndbout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user