Commit cde9f56b authored by jimw@mysql.com's avatar jimw@mysql.com

Merge

parents 2ae1faaf 2f9a28b4
...@@ -33,6 +33,9 @@ else ...@@ -33,6 +33,9 @@ else
esac esac
fi fi
cpu_flag=""
cpu_flag_old=""
case "$cpu_family--$model_name" in case "$cpu_family--$model_name" in
Alpha*EV6*) Alpha*EV6*)
cpu_flag="ev6"; cpu_flag="ev6";
...@@ -40,11 +43,21 @@ case "$cpu_family--$model_name" in ...@@ -40,11 +43,21 @@ case "$cpu_family--$model_name" in
*Xeon*) *Xeon*)
cpu_flag="nocona"; cpu_flag="nocona";
;; ;;
*Pentium*4*Mobile*CPU*)
cpu_flag="pentium4m";
;;
*Pentium*4*CPU*) *Pentium*4*CPU*)
cpu_flag="pentium4"; cpu_flag="pentium4";
;; ;;
*Pentium*III*Mobile*CPU*)
cpu_flag="pentium3m";
;;
*Pentium*III*CPU*)
cpu_flag="pentium3";
;;
*Athlon*64*) *Athlon*64*)
cpu_flag="athlon64"; cpu_flag="athlon64";
cpu_flag_old="athlon";
;; ;;
*Athlon*) *Athlon*)
cpu_flag="athlon"; cpu_flag="athlon";
...@@ -84,6 +97,10 @@ case "$cc_ver--$cc_verno" in ...@@ -84,6 +97,10 @@ case "$cc_ver--$cc_verno" in
check_cpu_cflags="-mtune=$cpu_flag -march=$cpu_flag" check_cpu_cflags="-mtune=$cpu_flag -march=$cpu_flag"
;; ;;
*GCC*) *GCC*)
# Fix for older compiler versions
if test -n "$cpu_flag_old"; then
cpu_flag="$cpu_flag_old"
fi
check_cpu_cflags="-mcpu=$cpu_flag -march=$cpu_flag" check_cpu_cflags="-mcpu=$cpu_flag -march=$cpu_flag"
;; ;;
*) *)
......
...@@ -308,9 +308,15 @@ C_MODE_END ...@@ -308,9 +308,15 @@ C_MODE_END
#ifndef CONFIG_SMP #ifndef CONFIG_SMP
#define CONFIG_SMP #define CONFIG_SMP
#endif #endif
#if defined(__ia64__)
#define new my_arg_new
#endif
C_MODE_START C_MODE_START
#include <asm/atomic.h> #include <asm/atomic.h>
C_MODE_END C_MODE_END
#if defined(__ia64__)
#undef new
#endif
#endif #endif
#include <errno.h> /* Recommended by debian */ #include <errno.h> /* Recommended by debian */
/* We need the following to go around a problem with openssl on solaris */ /* We need the following to go around a problem with openssl on solaris */
......
...@@ -817,6 +817,9 @@ drop table t1; ...@@ -817,6 +817,9 @@ drop table t1;
select 'c' like '\_' as want0; select 'c' like '\_' as want0;
want0 want0
0 0
SELECT SUBSTR('вася',-2);
SUBSTR('вася',-2)
ся
create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci); create table t1 (id integer, a varchar(100) character set utf8 collate utf8_unicode_ci);
insert into t1 values (1, 'Test'); insert into t1 values (1, 'Test');
select * from t1 where soundex(a) = soundex('Test'); select * from t1 where soundex(a) = soundex('Test');
......
...@@ -2476,3 +2476,13 @@ x ...@@ -2476,3 +2476,13 @@ x
NULL NULL
1.0000 1.0000
drop table t1; drop table t1;
create table t1 (a int(11));
select all all * from t1;
a
select distinct distinct * from t1;
a
select all distinct * from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'distinct * from t1' at line 1
select distinct all * from t1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'all * from t1' at line 1
drop table t1;
...@@ -666,6 +666,12 @@ drop table t1; ...@@ -666,6 +666,12 @@ drop table t1;
# #
select 'c' like '\_' as want0; select 'c' like '\_' as want0;
#
# SUBSTR with negative offset didn't work with multi-byte strings
#
SELECT SUBSTR('вася',-2);
# #
# Bug #7730 Server crash using soundex on an utf8 table # Bug #7730 Server crash using soundex on an utf8 table
# #
......
...@@ -2056,3 +2056,19 @@ create table t1 (s1 int); ...@@ -2056,3 +2056,19 @@ create table t1 (s1 int);
insert into t1 values (null),(1); insert into t1 values (null),(1);
select distinct avg(s1) as x from t1 group by s1 with rollup; select distinct avg(s1) as x from t1 group by s1 with rollup;
drop table t1; drop table t1;
#
# Bug#8733 server accepts malformed query (multiply mentioned distinct)
#
create table t1 (a int(11));
select all all * from t1;
select distinct distinct * from t1;
--error 1064
select all distinct * from t1;
--error 1064
select distinct all * from t1;
drop table t1;
#
...@@ -122,6 +122,7 @@ ParserRow<CPCDAPISession> commands[] = ...@@ -122,6 +122,7 @@ ParserRow<CPCDAPISession> commands[] =
CPCD_ARG("stderr", String, Optional, "Redirection of stderr"), CPCD_ARG("stderr", String, Optional, "Redirection of stderr"),
CPCD_ARG("stdin", String, Optional, "Redirection of stderr"), CPCD_ARG("stdin", String, Optional, "Redirection of stderr"),
CPCD_ARG("ulimit", String, Optional, "ulimit"), CPCD_ARG("ulimit", String, Optional, "ulimit"),
CPCD_ARG("shutdown", String, Optional, "shutdown options"),
CPCD_CMD("undefine process", &CPCDAPISession::undefineProcess, ""), CPCD_CMD("undefine process", &CPCDAPISession::undefineProcess, ""),
CPCD_CMD_ALIAS("undef", "undefine process", 0), CPCD_CMD_ALIAS("undef", "undefine process", 0),
......
...@@ -243,6 +243,12 @@ public: ...@@ -243,6 +243,12 @@ public:
* @desc Format c:unlimited d:0 ... * @desc Format c:unlimited d:0 ...
*/ */
BaseString m_ulimit; BaseString m_ulimit;
/**
* @brief shutdown options
*/
BaseString m_shutdown_options;
private: private:
class CPCD *m_cpcd; class CPCD *m_cpcd;
void do_exec(); void do_exec();
......
...@@ -44,6 +44,8 @@ CPCD::Process::print(FILE * f){ ...@@ -44,6 +44,8 @@ CPCD::Process::print(FILE * f){
fprintf(f, "stdout: %s\n", m_stdout.c_str() ? m_stdout.c_str() : ""); fprintf(f, "stdout: %s\n", m_stdout.c_str() ? m_stdout.c_str() : "");
fprintf(f, "stderr: %s\n", m_stderr.c_str() ? m_stderr.c_str() : ""); fprintf(f, "stderr: %s\n", m_stderr.c_str() ? m_stderr.c_str() : "");
fprintf(f, "ulimit: %s\n", m_ulimit.c_str() ? m_ulimit.c_str() : ""); fprintf(f, "ulimit: %s\n", m_ulimit.c_str() ? m_ulimit.c_str() : "");
fprintf(f, "shutdown: %s\n", m_shutdown_options.c_str() ?
m_shutdown_options.c_str() : "");
} }
CPCD::Process::Process(const Properties & props, class CPCD *cpcd) { CPCD::Process::Process(const Properties & props, class CPCD *cpcd) {
...@@ -64,6 +66,7 @@ CPCD::Process::Process(const Properties & props, class CPCD *cpcd) { ...@@ -64,6 +66,7 @@ CPCD::Process::Process(const Properties & props, class CPCD *cpcd) {
props.get("stdout", m_stdout); props.get("stdout", m_stdout);
props.get("stderr", m_stderr); props.get("stderr", m_stderr);
props.get("ulimit", m_ulimit); props.get("ulimit", m_ulimit);
props.get("shutdown", m_shutdown_options);
m_status = STOPPED; m_status = STOPPED;
if(strcasecmp(m_type.c_str(), "temporary") == 0){ if(strcasecmp(m_type.c_str(), "temporary") == 0){
...@@ -454,7 +457,11 @@ CPCD::Process::stop() { ...@@ -454,7 +457,11 @@ CPCD::Process::stop() {
m_status = STOPPING; m_status = STOPPING;
errno = 0; errno = 0;
int ret = kill(-m_pid, SIGTERM); int signo= SIGTERM;
if(m_shutdown_options == "SIGKILL")
signo= SIGKILL;
int ret = kill(-m_pid, signo);
switch(ret) { switch(ret) {
case 0: case 0:
logger.debug("Sent SIGTERM to pid %d", (int)-m_pid); logger.debug("Sent SIGTERM to pid %d", (int)-m_pid);
......
...@@ -585,34 +585,8 @@ public: ...@@ -585,34 +585,8 @@ public:
*/ */
ArrayPool<TcIndexOperation> c_theIndexOperationPool; ArrayPool<TcIndexOperation> c_theIndexOperationPool;
/**
* The list of index operations
*/
ArrayList<TcIndexOperation> c_theIndexOperations;
UintR c_maxNumberOfIndexOperations; UintR c_maxNumberOfIndexOperations;
struct TcSeizedIndexOperation {
/**
* Next ptr (used in pool/list)
*/
union {
Uint32 nextPool;
Uint32 nextList;
};
/**
* Prev pointer (used in list)
*/
Uint32 prevList;
};
/**
* Pool of seized index operations
*/
ArrayPool<TcSeizedIndexOperation> c_theSeizedIndexOperationPool;
typedef Ptr<TcSeizedIndexOperation> TcSeizedIndexOperationPtr;
/************************** API CONNECT RECORD *********************** /************************** API CONNECT RECORD ***********************
* The API connect record contains the connection record to which the * The API connect record contains the connection record to which the
* application connects. * application connects.
...@@ -650,7 +624,7 @@ public: ...@@ -650,7 +624,7 @@ public:
struct ApiConnectRecord { struct ApiConnectRecord {
ApiConnectRecord(ArrayPool<TcFiredTriggerData> & firedTriggerPool, ApiConnectRecord(ArrayPool<TcFiredTriggerData> & firedTriggerPool,
ArrayPool<TcSeizedIndexOperation> & seizedIndexOpPool): ArrayPool<TcIndexOperation> & seizedIndexOpPool):
theFiredTriggers(firedTriggerPool), theFiredTriggers(firedTriggerPool),
isIndexOp(false), isIndexOp(false),
theSeizedIndexOperations(seizedIndexOpPool) theSeizedIndexOperations(seizedIndexOpPool)
...@@ -763,7 +737,7 @@ public: ...@@ -763,7 +737,7 @@ public:
UintR accumulatingIndexOp; UintR accumulatingIndexOp;
UintR executingIndexOp; UintR executingIndexOp;
UintR tcIndxSendArray[6]; UintR tcIndxSendArray[6];
ArrayList<TcSeizedIndexOperation> theSeizedIndexOperations; ArrayList<TcIndexOperation> theSeizedIndexOperations;
}; };
typedef Ptr<ApiConnectRecord> ApiConnectRecordPtr; typedef Ptr<ApiConnectRecord> ApiConnectRecordPtr;
......
...@@ -65,7 +65,6 @@ void Dbtc::initData() ...@@ -65,7 +65,6 @@ void Dbtc::initData()
c_theFiredTriggerPool.setSize(c_maxNumberOfFiredTriggers); c_theFiredTriggerPool.setSize(c_maxNumberOfFiredTriggers);
c_theIndexPool.setSize(c_maxNumberOfIndexes); c_theIndexPool.setSize(c_maxNumberOfIndexes);
c_theIndexOperationPool.setSize(c_maxNumberOfIndexOperations); c_theIndexOperationPool.setSize(c_maxNumberOfIndexOperations);
c_theSeizedIndexOperationPool.setSize(c_maxNumberOfIndexOperations);
c_theAttributeBufferPool.setSize(c_transactionBufferSpace); c_theAttributeBufferPool.setSize(c_transactionBufferSpace);
c_firedTriggerHash.setSize((c_maxNumberOfFiredTriggers+10)/10); c_firedTriggerHash.setSize((c_maxNumberOfFiredTriggers+10)/10);
}//Dbtc::initData() }//Dbtc::initData()
...@@ -85,7 +84,7 @@ void Dbtc::initRecords() ...@@ -85,7 +84,7 @@ void Dbtc::initRecords()
for(unsigned i = 0; i<capiConnectFilesize; i++) { for(unsigned i = 0; i<capiConnectFilesize; i++) {
p = &apiConnectRecord[i]; p = &apiConnectRecord[i];
new (p) ApiConnectRecord(c_theFiredTriggerPool, new (p) ApiConnectRecord(c_theFiredTriggerPool,
c_theSeizedIndexOperationPool); c_theIndexOperationPool);
} }
// Init all fired triggers // Init all fired triggers
DLFifoList<TcFiredTriggerData> triggers(c_theFiredTriggerPool); DLFifoList<TcFiredTriggerData> triggers(c_theFiredTriggerPool);
...@@ -177,7 +176,6 @@ Dbtc::Dbtc(const class Configuration & conf): ...@@ -177,7 +176,6 @@ Dbtc::Dbtc(const class Configuration & conf):
c_maxNumberOfFiredTriggers(0), c_maxNumberOfFiredTriggers(0),
c_theIndexes(c_theIndexPool), c_theIndexes(c_theIndexPool),
c_maxNumberOfIndexes(0), c_maxNumberOfIndexes(0),
c_theIndexOperations(c_theIndexOperationPool),
c_maxNumberOfIndexOperations(0), c_maxNumberOfIndexOperations(0),
m_commitAckMarkerHash(m_commitAckMarkerPool) m_commitAckMarkerHash(m_commitAckMarkerPool)
{ {
......
...@@ -11368,18 +11368,18 @@ void Dbtc::execTCINDXREQ(Signal* signal) ...@@ -11368,18 +11368,18 @@ void Dbtc::execTCINDXREQ(Signal* signal)
jam(); jam();
// This is a newly started transaction, clean-up // This is a newly started transaction, clean-up
releaseAllSeizedIndexOperations(regApiPtr); releaseAllSeizedIndexOperations(regApiPtr);
regApiPtr->transid[0] = tcIndxReq->transId1;
regApiPtr->transid[1] = tcIndxReq->transId2;
}//if }//if
if (!seizeIndexOperation(regApiPtr, indexOpPtr)) {
if (ERROR_INSERTED(8036) || !seizeIndexOperation(regApiPtr, indexOpPtr)) {
jam(); jam();
// Failed to allocate index operation // Failed to allocate index operation
TcKeyRef * const tcIndxRef = (TcKeyRef *)signal->getDataPtrSend(); terrorCode = 288;
regApiPtr->m_exec_flag |= TcKeyReq::getExecuteFlag(tcIndxRequestInfo);
tcIndxRef->connectPtr = tcIndxReq->senderData; apiConnectptr = transPtr;
tcIndxRef->transId[0] = regApiPtr->transid[0]; abortErrorLab(signal);
tcIndxRef->transId[1] = regApiPtr->transid[1];
tcIndxRef->errorCode = 4000;
sendSignal(regApiPtr->ndbapiBlockref, GSN_TCINDXREF, signal,
TcKeyRef::SignalLength, JBB);
return; return;
} }
TcIndexOperation* indexOp = indexOpPtr.p; TcIndexOperation* indexOp = indexOpPtr.p;
...@@ -11514,15 +11514,17 @@ void Dbtc::execINDXKEYINFO(Signal* signal) ...@@ -11514,15 +11514,17 @@ void Dbtc::execINDXKEYINFO(Signal* signal)
TcIndexOperationPtr indexOpPtr; TcIndexOperationPtr indexOpPtr;
TcIndexOperation* indexOp; TcIndexOperation* indexOp;
indexOpPtr.i = regApiPtr->accumulatingIndexOp; if((indexOpPtr.i = regApiPtr->accumulatingIndexOp) != RNIL)
indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); {
if (saveINDXKEYINFO(signal, indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
indexOp, if (saveINDXKEYINFO(signal,
src, indexOp,
keyInfoLength)) { src,
jam(); keyInfoLength)) {
// We have received all we need jam();
readIndexTable(signal, regApiPtr, indexOp); // We have received all we need
readIndexTable(signal, regApiPtr, indexOp);
}
} }
} }
...@@ -11545,15 +11547,17 @@ void Dbtc::execINDXATTRINFO(Signal* signal) ...@@ -11545,15 +11547,17 @@ void Dbtc::execINDXATTRINFO(Signal* signal)
TcIndexOperationPtr indexOpPtr; TcIndexOperationPtr indexOpPtr;
TcIndexOperation* indexOp; TcIndexOperation* indexOp;
indexOpPtr.i = regApiPtr->accumulatingIndexOp; if((indexOpPtr.i = regApiPtr->accumulatingIndexOp) != RNIL)
indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); {
if (saveINDXATTRINFO(signal, indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
indexOp, if (saveINDXATTRINFO(signal,
src, indexOp,
attrInfoLength)) { src,
jam(); attrInfoLength)) {
// We have received all we need jam();
readIndexTable(signal, regApiPtr, indexOp); // We have received all we need
readIndexTable(signal, regApiPtr, indexOp);
}
} }
} }
...@@ -11578,7 +11582,7 @@ bool Dbtc::saveINDXKEYINFO(Signal* signal, ...@@ -11578,7 +11582,7 @@ bool Dbtc::saveINDXKEYINFO(Signal* signal,
releaseIndexOperation(apiConnectptr.p, indexOp); releaseIndexOperation(apiConnectptr.p, indexOp);
terrorCode = 4000; terrorCode = 4000;
abortErrorLab(signal); abortErrorLab(signal);
return true; return false;
} }
if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) { if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) {
jam(); jam();
...@@ -11611,7 +11615,7 @@ bool Dbtc::saveINDXATTRINFO(Signal* signal, ...@@ -11611,7 +11615,7 @@ bool Dbtc::saveINDXATTRINFO(Signal* signal,
releaseIndexOperation(apiConnectptr.p, indexOp); releaseIndexOperation(apiConnectptr.p, indexOp);
terrorCode = 4000; terrorCode = 4000;
abortErrorLab(signal); abortErrorLab(signal);
return true; return false;
} }
if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) { if (receivedAllINDXKEYINFO(indexOp) && receivedAllINDXATTRINFO(indexOp)) {
jam(); jam();
...@@ -11671,7 +11675,7 @@ void Dbtc::execTCKEYCONF(Signal* signal) ...@@ -11671,7 +11675,7 @@ void Dbtc::execTCKEYCONF(Signal* signal)
jamEntry(); jamEntry();
indexOpPtr.i = tcKeyConf->apiConnectPtr; indexOpPtr.i = tcKeyConf->apiConnectPtr;
TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
Uint32 confInfo = tcKeyConf->confInfo; Uint32 confInfo = tcKeyConf->confInfo;
/** /**
...@@ -11760,7 +11764,7 @@ void Dbtc::execTCKEYREF(Signal* signal) ...@@ -11760,7 +11764,7 @@ void Dbtc::execTCKEYREF(Signal* signal)
jamEntry(); jamEntry();
indexOpPtr.i = tcKeyRef->connectPtr; indexOpPtr.i = tcKeyRef->connectPtr;
TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
indexOpPtr.p = indexOp; indexOpPtr.p = indexOp;
if (!indexOp) { if (!indexOp) {
jam(); jam();
...@@ -11861,7 +11865,7 @@ void Dbtc::execTRANSID_AI(Signal* signal) ...@@ -11861,7 +11865,7 @@ void Dbtc::execTRANSID_AI(Signal* signal)
jamEntry(); jamEntry();
TcIndexOperationPtr indexOpPtr; TcIndexOperationPtr indexOpPtr;
indexOpPtr.i = transIdAI->connectPtr; indexOpPtr.i = transIdAI->connectPtr;
TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
indexOpPtr.p = indexOp; indexOpPtr.p = indexOp;
if (!indexOp) { if (!indexOp) {
jam(); jam();
...@@ -11969,7 +11973,7 @@ void Dbtc::execTCROLLBACKREP(Signal* signal) ...@@ -11969,7 +11973,7 @@ void Dbtc::execTCROLLBACKREP(Signal* signal)
jamEntry(); jamEntry();
TcIndexOperationPtr indexOpPtr; TcIndexOperationPtr indexOpPtr;
indexOpPtr.i = tcRollbackRep->connectPtr; indexOpPtr.i = tcRollbackRep->connectPtr;
TcIndexOperation* indexOp = c_theIndexOperations.getPtr(indexOpPtr.i); TcIndexOperation* indexOp = c_theIndexOperationPool.getPtr(indexOpPtr.i);
indexOpPtr.p = indexOp; indexOpPtr.p = indexOp;
tcRollbackRep = (TcRollbackRep *)signal->getDataPtrSend(); tcRollbackRep = (TcRollbackRep *)signal->getDataPtrSend();
tcRollbackRep->connectPtr = indexOp->tcIndxReq.senderData; tcRollbackRep->connectPtr = indexOp->tcIndxReq.senderData;
...@@ -12297,16 +12301,7 @@ void Dbtc::executeIndexOperation(Signal* signal, ...@@ -12297,16 +12301,7 @@ void Dbtc::executeIndexOperation(Signal* signal,
bool Dbtc::seizeIndexOperation(ApiConnectRecord* regApiPtr, bool Dbtc::seizeIndexOperation(ApiConnectRecord* regApiPtr,
TcIndexOperationPtr& indexOpPtr) TcIndexOperationPtr& indexOpPtr)
{ {
bool seizeOk; return regApiPtr->theSeizedIndexOperations.seize(indexOpPtr);
seizeOk = c_theIndexOperations.seize(indexOpPtr);
if (seizeOk) {
jam();
TcSeizedIndexOperationPtr seizedIndexOpPtr;
seizeOk &= regApiPtr->theSeizedIndexOperations.seizeId(seizedIndexOpPtr,
indexOpPtr.i);
}
return seizeOk;
} }
void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr, void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr,
...@@ -12320,18 +12315,16 @@ void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr, ...@@ -12320,18 +12315,16 @@ void Dbtc::releaseIndexOperation(ApiConnectRecord* regApiPtr,
indexOp->expectedTransIdAI = 0; indexOp->expectedTransIdAI = 0;
indexOp->transIdAI.release(); indexOp->transIdAI.release();
regApiPtr->theSeizedIndexOperations.release(indexOp->indexOpId); regApiPtr->theSeizedIndexOperations.release(indexOp->indexOpId);
c_theIndexOperations.release(indexOp->indexOpId);
} }
void Dbtc::releaseAllSeizedIndexOperations(ApiConnectRecord* regApiPtr) void Dbtc::releaseAllSeizedIndexOperations(ApiConnectRecord* regApiPtr)
{ {
TcSeizedIndexOperationPtr seizedIndexOpPtr; TcIndexOperationPtr seizedIndexOpPtr;
regApiPtr->theSeizedIndexOperations.first(seizedIndexOpPtr); regApiPtr->theSeizedIndexOperations.first(seizedIndexOpPtr);
while(seizedIndexOpPtr.i != RNIL) { while(seizedIndexOpPtr.i != RNIL) {
jam(); jam();
TcIndexOperation* indexOp = TcIndexOperation* indexOp = seizedIndexOpPtr.p;
c_theIndexOperations.getPtr(seizedIndexOpPtr.i);
indexOp->indexOpState = IOS_NOOP; indexOp->indexOpState = IOS_NOOP;
indexOp->expectedKeyInfo = 0; indexOp->expectedKeyInfo = 0;
...@@ -12340,7 +12333,6 @@ void Dbtc::releaseAllSeizedIndexOperations(ApiConnectRecord* regApiPtr) ...@@ -12340,7 +12333,6 @@ void Dbtc::releaseAllSeizedIndexOperations(ApiConnectRecord* regApiPtr)
indexOp->attrInfo.release(); indexOp->attrInfo.release();
indexOp->expectedTransIdAI = 0; indexOp->expectedTransIdAI = 0;
indexOp->transIdAI.release(); indexOp->transIdAI.release();
c_theIndexOperations.release(seizedIndexOpPtr.i);
regApiPtr->theSeizedIndexOperations.next(seizedIndexOpPtr); regApiPtr->theSeizedIndexOperations.next(seizedIndexOpPtr);
} }
regApiPtr->theSeizedIndexOperations.release(); regApiPtr->theSeizedIndexOperations.release();
......
...@@ -130,7 +130,7 @@ ErrorReporter::formatMessage(ErrorCategory type, ...@@ -130,7 +130,7 @@ ErrorReporter::formatMessage(ErrorCategory type,
"Date/Time: %s\nType of error: %s\n" "Date/Time: %s\nType of error: %s\n"
"Message: %s\nFault ID: %d\nProblem data: %s" "Message: %s\nFault ID: %d\nProblem data: %s"
"\nObject of reference: %s\nProgramName: %s\n" "\nObject of reference: %s\nProgramName: %s\n"
"ProcessID: %d\nTraceFile: %s\n***EOM***\n", "ProcessID: %d\nTraceFile: %s\n%s\n***EOM***\n",
formatTimeStampString() , formatTimeStampString() ,
errorType[type], errorType[type],
lookupErrorMessage(faultID), lookupErrorMessage(faultID),
...@@ -139,7 +139,8 @@ ErrorReporter::formatMessage(ErrorCategory type, ...@@ -139,7 +139,8 @@ ErrorReporter::formatMessage(ErrorCategory type,
objRef, objRef,
my_progname, my_progname,
processId, processId,
theNameOfTheTraceFile ? theNameOfTheTraceFile : "<no tracefile>"); theNameOfTheTraceFile ? theNameOfTheTraceFile : "<no tracefile>",
NDB_VERSION_STRING);
// Add trailing blanks to get a fixed lenght of the message // Add trailing blanks to get a fixed lenght of the message
while (strlen(messptr) <= MESSAGE_LENGTH-3){ while (strlen(messptr) <= MESSAGE_LENGTH-3){
......
...@@ -892,7 +892,10 @@ ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, const int * node_list, ...@@ -892,7 +892,10 @@ ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, const int * node_list,
args.put("initialstart", initial); args.put("initialstart", initial);
args.put("nostart", nostart); args.put("nostart", nostart);
const Properties *reply; const Properties *reply;
const int timeout = handle->read_timeout;
handle->read_timeout= 5*60*1000; // 5 minutes
reply = ndb_mgm_call(handle, restart_reply, "restart all", &args); reply = ndb_mgm_call(handle, restart_reply, "restart all", &args);
handle->read_timeout= timeout;
CHECK_REPLY(reply, -1); CHECK_REPLY(reply, -1);
BaseString result; BaseString result;
...@@ -925,7 +928,10 @@ ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, const int * node_list, ...@@ -925,7 +928,10 @@ ndb_mgm_restart2(NdbMgmHandle handle, int no_of_nodes, const int * node_list,
args.put("nostart", nostart); args.put("nostart", nostart);
const Properties *reply; const Properties *reply;
const int timeout = handle->read_timeout;
handle->read_timeout= 5*60*1000; // 5 minutes
reply = ndb_mgm_call(handle, restart_reply, "restart node", &args); reply = ndb_mgm_call(handle, restart_reply, "restart node", &args);
handle->read_timeout= timeout;
if(reply != NULL) { if(reply != NULL) {
BaseString result; BaseString result;
reply->get("result", result); reply->get("result", result);
......
...@@ -66,6 +66,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade): ...@@ -66,6 +66,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade):
{ {
ndbSetOwnVersion(); ndbSetOwnVersion();
clusterMgrThreadMutex = NdbMutex_Create(); clusterMgrThreadMutex = NdbMutex_Create();
noOfAliveNodes= 0;
noOfConnectedNodes= 0; noOfConnectedNodes= 0;
theClusterMgrThread= 0; theClusterMgrThread= 0;
} }
...@@ -336,9 +337,9 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ ...@@ -336,9 +337,9 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){
node.m_state = apiRegConf->nodeState; node.m_state = apiRegConf->nodeState;
if (node.compatible && (node.m_state.startLevel == NodeState::SL_STARTED || if (node.compatible && (node.m_state.startLevel == NodeState::SL_STARTED ||
node.m_state.startLevel == NodeState::SL_SINGLEUSER)){ node.m_state.startLevel == NodeState::SL_SINGLEUSER)){
node.m_alive = true; set_node_alive(node, true);
} else { } else {
node.m_alive = false; set_node_alive(node, false);
}//if }//if
node.hbSent = 0; node.hbSent = 0;
node.hbCounter = 0; node.hbCounter = 0;
...@@ -361,7 +362,7 @@ ClusterMgr::execAPI_REGREF(const Uint32 * theData){ ...@@ -361,7 +362,7 @@ ClusterMgr::execAPI_REGREF(const Uint32 * theData){
assert(node.defined == true); assert(node.defined == true);
node.compatible = false; node.compatible = false;
node.m_alive = false; set_node_alive(node, false);
node.m_state = NodeState::SL_NOTHING; node.m_state = NodeState::SL_NOTHING;
node.m_info.m_version = ref->version; node.m_info.m_version = ref->version;
...@@ -446,7 +447,7 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){ ...@@ -446,7 +447,7 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){
Node & theNode = theNodes[nodeId]; Node & theNode = theNodes[nodeId];
theNode.m_alive = false; set_node_alive(theNode, false);
theNode.m_info.m_connectCount ++; theNode.m_info.m_connectCount ++;
if(theNode.connected) if(theNode.connected)
...@@ -462,8 +463,7 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){ ...@@ -462,8 +463,7 @@ ClusterMgr::reportNodeFailed(NodeId nodeId){
} }
theNode.nfCompleteRep = false; theNode.nfCompleteRep = false;
if(noOfAliveNodes == 0){
if(noOfConnectedNodes == 0){
NFCompleteRep rep; NFCompleteRep rep;
for(Uint32 i = 1; i<MAX_NODES; i++){ for(Uint32 i = 1; i<MAX_NODES; i++){
if(theNodes[i].defined && theNodes[i].nfCompleteRep == false){ if(theNodes[i].defined && theNodes[i].nfCompleteRep == false){
......
...@@ -80,6 +80,7 @@ public: ...@@ -80,6 +80,7 @@ public:
Uint32 getNoOfConnectedNodes() const; Uint32 getNoOfConnectedNodes() const;
private: private:
Uint32 noOfAliveNodes;
Uint32 noOfConnectedNodes; Uint32 noOfConnectedNodes;
Node theNodes[MAX_NODES]; Node theNodes[MAX_NODES];
NdbThread* theClusterMgrThread; NdbThread* theClusterMgrThread;
...@@ -100,6 +101,19 @@ private: ...@@ -100,6 +101,19 @@ private:
void execAPI_REGREF (const Uint32 * theData); void execAPI_REGREF (const Uint32 * theData);
void execNODE_FAILREP (const Uint32 * theData); void execNODE_FAILREP (const Uint32 * theData);
void execNF_COMPLETEREP(const Uint32 * theData); void execNF_COMPLETEREP(const Uint32 * theData);
inline void set_node_alive(Node& node, bool alive){
if(node.m_alive && !alive)
{
assert(noOfAliveNodes);
noOfAliveNodes--;
}
else if(!node.m_alive && alive)
{
noOfAliveNodes++;
}
node.m_alive = alive;
}
}; };
inline inline
......
...@@ -173,7 +173,7 @@ ErrorBundle ErrorCodes[] = { ...@@ -173,7 +173,7 @@ ErrorBundle ErrorCodes[] = {
{ 4021, TR, "Out of Send Buffer space in NDB API" }, { 4021, TR, "Out of Send Buffer space in NDB API" },
{ 4022, TR, "Out of Send Buffer space in NDB API" }, { 4022, TR, "Out of Send Buffer space in NDB API" },
{ 4032, TR, "Out of Send Buffer space in NDB API" }, { 4032, TR, "Out of Send Buffer space in NDB API" },
{ 288, TR, "Out of index operations in transaction coordinator (increase MaxNoOfConcurrentIndexOperations)" },
/** /**
* InsufficientSpace * InsufficientSpace
*/ */
......
...@@ -56,6 +56,7 @@ public: ...@@ -56,6 +56,7 @@ public:
BaseString m_stdout; BaseString m_stdout;
BaseString m_stderr; BaseString m_stderr;
BaseString m_ulimit; BaseString m_ulimit;
BaseString m_shutdown_options;
}; };
private: private:
......
...@@ -359,7 +359,7 @@ int runLateCommit(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -359,7 +359,7 @@ int runLateCommit(NDBT_Context* ctx, NDBT_Step* step){
if(hugoOps.startTransaction(pNdb) != 0) if(hugoOps.startTransaction(pNdb) != 0)
return NDBT_FAILED; return NDBT_FAILED;
if(hugoOps.pkUpdateRecord(pNdb, 1) != 0) if(hugoOps.pkUpdateRecord(pNdb, 1, 128) != 0)
return NDBT_FAILED; return NDBT_FAILED;
if(hugoOps.execute_NoCommit(pNdb) != 0) if(hugoOps.execute_NoCommit(pNdb) != 0)
......
...@@ -6,7 +6,12 @@ include $(top_srcdir)/ndb/config/type_util.mk.am ...@@ -6,7 +6,12 @@ include $(top_srcdir)/ndb/config/type_util.mk.am
include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am include $(top_srcdir)/ndb/config/type_mgmapiclient.mk.am
test_PROGRAMS = atrt test_PROGRAMS = atrt
test_DATA=daily-basic-tests.txt daily-devel-tests.txt 16node-tests.txt test_DATA=daily-basic-tests.txt daily-devel-tests.txt 16node-tests.txt \
conf-daily-basic-ndbmaster.txt \
conf-daily-basic-shark.txt \
conf-daily-devel-ndbmaster.txt \
conf-daily-sql-ndbmaster.txt \
conf-daily-basic-dl145a.txt
test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \ test_SCRIPTS=atrt-analyze-result.sh atrt-gather-result.sh atrt-setup.sh \
atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh atrt-clear-result.sh make-config.sh make-index.sh make-html-reports.sh
......
baseport: 14000
basedir: /home/ndbdev/autotest/run
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3
api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
IndexMemory: 100M
DataMemory: 300M
BackupMemory: 64M
MaxNoOfConcurrentScans: 100
DataDir: .
FileSystemPath: /home/ndbdev/autotest/run
[MGM DEFAULT]
PortNumber: 14000
ArbitrationRank: 1
DataDir: .
baseport: 14000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3 CHOOSE_host2 CHOOSE_host3
api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
IndexMemory: 100M
DataMemory: 300M
BackupMemory: 64M
MaxNoOfConcurrentScans: 100
DataDir: .
FileSystemPath: /space/autotest/run
[MGM DEFAULT]
PortNumber: 14000
ArbitrationRank: 1
DataDir: .
baseport: 14000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host1 CHOOSE_host1
api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
IndexMemory: 100M
DataMemory: 300M
BackupMemory: 64M
MaxNoOfConcurrentScans: 100
DataDir: .
FileSystemPath: /space/autotest/run
[MGM DEFAULT]
PortNumber: 14000
ArbitrationRank: 1
DataDir: .
baseport: 16000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3 CHOOSE_host2 CHOOSE_host3
api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
IndexMemory: 100M
DataMemory: 300M
BackupMemory: 64M
MaxNoOfConcurrentScans: 100
DataDir: .
FileSystemPath: /space/autotest/run
[MGM DEFAULT]
PortNumber: 16000
ArbitrationRank: 1
DataDir: .
baseport: 16000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3
mysqld: CHOOSE_host1 CHOOSE_host4
mysql: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
IndexMemory: 100M
DataMemory: 300M
BackupMemory: 64M
MaxNoOfConcurrentScans: 100
DataDir: .
FileSystemPath: /space/autotest/run
[MGM DEFAULT]
PortNumber: 16000
ArbitrationRank: 1
DataDir: .
...@@ -116,10 +116,7 @@ main(int argc, const char ** argv){ ...@@ -116,10 +116,7 @@ main(int argc, const char ** argv){
*/ */
if(restart){ if(restart){
g_logger.info("(Re)starting ndb processes"); g_logger.info("(Re)starting ndb processes");
if(!stop_processes(g_config, atrt_process::NDB_MGM)) if(!stop_processes(g_config, ~0))
goto end;
if(!stop_processes(g_config, atrt_process::NDB_DB))
goto end; goto end;
if(!start_processes(g_config, atrt_process::NDB_MGM)) if(!start_processes(g_config, atrt_process::NDB_MGM))
...@@ -142,6 +139,9 @@ main(int argc, const char ** argv){ ...@@ -142,6 +139,9 @@ main(int argc, const char ** argv){
goto end; goto end;
started: started:
if(!start_processes(g_config, p_servers))
goto end;
g_logger.info("Ndb start completed"); g_logger.info("Ndb start completed");
} }
...@@ -158,9 +158,6 @@ main(int argc, const char ** argv){ ...@@ -158,9 +158,6 @@ main(int argc, const char ** argv){
if(!setup_test_case(g_config, test_case)) if(!setup_test_case(g_config, test_case))
goto end; goto end;
if(!start_processes(g_config, p_servers))
goto end;
if(!start_processes(g_config, p_clients)) if(!start_processes(g_config, p_clients))
goto end; goto end;
...@@ -201,9 +198,6 @@ main(int argc, const char ** argv){ ...@@ -201,9 +198,6 @@ main(int argc, const char ** argv){
if(!stop_processes(g_config, p_clients)) if(!stop_processes(g_config, p_clients))
goto end; goto end;
if(!stop_processes(g_config, p_servers))
goto end;
if(!gather_result(g_config, &result)) if(!gather_result(g_config, &result))
goto end; goto end;
...@@ -454,6 +448,7 @@ setup_config(atrt_config& config){ ...@@ -454,6 +448,7 @@ setup_config(atrt_config& config){
proc.m_proc.m_runas = proc.m_host->m_user; proc.m_proc.m_runas = proc.m_host->m_user;
proc.m_proc.m_ulimit = "c:unlimited"; proc.m_proc.m_ulimit = "c:unlimited";
proc.m_proc.m_env.assfmt("MYSQL_BASE_DIR=%s", dir.c_str()); proc.m_proc.m_env.assfmt("MYSQL_BASE_DIR=%s", dir.c_str());
proc.m_proc.m_shutdown_options = "";
proc.m_hostname = proc.m_host->m_hostname; proc.m_hostname = proc.m_host->m_hostname;
proc.m_ndb_mgm_port = g_default_base_port; proc.m_ndb_mgm_port = g_default_base_port;
if(split1[0] == "mgm"){ if(split1[0] == "mgm"){
...@@ -476,21 +471,19 @@ setup_config(atrt_config& config){ ...@@ -476,21 +471,19 @@ setup_config(atrt_config& config){
proc.m_proc.m_path.assign(dir).append("/libexec/mysqld"); proc.m_proc.m_path.assign(dir).append("/libexec/mysqld");
proc.m_proc.m_args = "--core-file --ndbcluster"; proc.m_proc.m_args = "--core-file --ndbcluster";
proc.m_proc.m_cwd.appfmt("%d.mysqld", index); proc.m_proc.m_cwd.appfmt("%d.mysqld", index);
if(mysql_port_offset > 0 || g_mysqld_use_base){ proc.m_proc.m_shutdown_options = "SIGKILL"; // not nice
// setup mysql specific stuff
const char * basedir = proc.m_proc.m_cwd.c_str();
proc.m_proc.m_args.appfmt("--datadir=%s", basedir);
proc.m_proc.m_args.appfmt("--pid-file=%s/mysql.pid", basedir);
proc.m_proc.m_args.appfmt("--socket=%s/mysql.sock", basedir);
proc.m_proc.m_args.appfmt("--port=%d",
g_default_base_port-(++mysql_port_offset));
}
} else if(split1[0] == "api"){ } else if(split1[0] == "api"){
proc.m_type = atrt_process::NDB_API; proc.m_type = atrt_process::NDB_API;
proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api"); proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api");
proc.m_proc.m_path = ""; proc.m_proc.m_path = "";
proc.m_proc.m_args = ""; proc.m_proc.m_args = "";
proc.m_proc.m_cwd.appfmt("%d.ndb_api", index); proc.m_proc.m_cwd.appfmt("%d.ndb_api", index);
} else if(split1[0] == "mysql"){
proc.m_type = atrt_process::MYSQL_CLIENT;
proc.m_proc.m_name.assfmt("%d-%s", index, "mysql");
proc.m_proc.m_path = "";
proc.m_proc.m_args = "";
proc.m_proc.m_cwd.appfmt("%d.mysql", index);
} else { } else {
g_logger.critical("%s:%d: Unhandled process type: %s", g_logger.critical("%s:%d: Unhandled process type: %s",
g_process_config_filename, lineno, g_process_config_filename, lineno,
...@@ -913,6 +906,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){ ...@@ -913,6 +906,11 @@ read_test_case(FILE * file, atrt_testcase& tc, int& line){
tc.m_report= true; tc.m_report= true;
else else
tc.m_report= false; tc.m_report= false;
if(p.get("run-all", &mt) && strcmp(mt, "yes") == 0)
tc.m_run_all= true;
else
tc.m_run_all= false;
return true; return true;
} }
...@@ -928,16 +926,17 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){ ...@@ -928,16 +926,17 @@ setup_test_case(atrt_config& config, const atrt_testcase& tc){
size_t i = 0; size_t i = 0;
for(; i<config.m_processes.size(); i++){ for(; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i]; atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){ if(proc.m_type == atrt_process::NDB_API || proc.m_type == atrt_process::MYSQL_CLIENT){
proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(), proc.m_proc.m_path.assfmt("%s/bin/%s", proc.m_host->m_base_dir.c_str(),
tc.m_command.c_str()); tc.m_command.c_str());
proc.m_proc.m_args.assign(tc.m_args); proc.m_proc.m_args.assign(tc.m_args);
break; if(!tc.m_run_all)
break;
} }
} }
for(i++; i<config.m_processes.size(); i++){ for(i++; i<config.m_processes.size(); i++){
atrt_process & proc = config.m_processes[i]; atrt_process & proc = config.m_processes[i];
if(proc.m_type == atrt_process::NDB_API){ if(proc.m_type == atrt_process::NDB_API || proc.m_type == atrt_process::MYSQL_CLIENT){
proc.m_proc.m_path.assign(""); proc.m_proc.m_path.assign("");
proc.m_proc.m_args.assign(""); proc.m_proc.m_args.assign("");
} }
......
This diff is collapsed.
#!/bin/sh #!/bin/sh
save_args=$* save_args=$*
VERSION="ndb-autotest.sh version 1.0" VERSION="ndb-autotest.sh version 1.04"
DATE=`date '+%Y-%m-%d'` DATE=`date '+%Y-%m-%d'`
export DATE export DATE
...@@ -71,11 +71,18 @@ then ...@@ -71,11 +71,18 @@ then
cd $dst_place cd $dst_place
rm -rf $run_dir/* rm -rf $run_dir/*
aclocal; autoheader; autoconf; automake aclocal; autoheader; autoconf; automake
(cd innobase; aclocal; autoheader; autoconf; automake) if [ -d storage ]
(cd bdb/dist; sh s_all) 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
eval $configure --prefix=$run_dir eval $configure --prefix=$run_dir
make make
make install make install
(cd $run_dir; ./bin/mysql_install_db)
fi fi
### ###
...@@ -103,7 +110,9 @@ fi ...@@ -103,7 +110,9 @@ fi
test_dir=$run_dir/mysql-test/ndb test_dir=$run_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
PATH=$test_dir:$PATH mkconfig=$run_dir/mysql-test/ndb/make-config.sh
PATH=$run_dir/bin:$test_dir:$PATH
export PATH export PATH
filter(){ filter(){
...@@ -125,20 +134,16 @@ hosts=`cat /tmp/hosts.$DATE` ...@@ -125,20 +134,16 @@ hosts=`cat /tmp/hosts.$DATE`
if [ "$deploy" ] if [ "$deploy" ]
then then
(cd / && tar cfz /tmp/build.$DATE.tgz $run_dir ) for i in $hosts
for i in $hosts do
do rsync -a --delete --force --ignore-errors $run_dir/ $i:$run_dir
ok=0 ok=$?
scp /tmp/build.$DATE.tgz $i:/tmp/build.$DATE.$$.tgz && \ if [ $ok -ne 0 ]
ssh $i "rm -rf /space/autotest/*" && \ then
ssh $i "cd / && tar xfz /tmp/build.$DATE.$$.tgz" && \ echo "$i failed during rsync, excluding"
ssh $i "rm /tmp/build.$DATE.$$.tgz" && ok=1 echo $i >> /tmp/failed.$DATE
if [ $ok -eq 0 ] fi
then done
echo "$i failed during scp/ssh, excluding"
echo $i >> /tmp/failed.$DATE
fi
done
fi fi
rm -f /tmp/build.$DATE.tgz rm -f /tmp/build.$DATE.tgz
...@@ -170,6 +175,18 @@ choose(){ ...@@ -170,6 +175,18 @@ choose(){
cat $TMP1 cat $TMP1
rm -f $TMP1 rm -f $TMP1
} }
choose_conf(){
host=`hostname -s`
if [ -f $test_dir/conf-$1-$host.txt ]
then
echo "$test_dir/conf-$1-$host.txt"
elif [ -f $test_dir/conf-$1.txt ]
then
echo "$test_dir/conf-$1.txt"
fi
}
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 &
...@@ -186,11 +203,17 @@ start(){ ...@@ -186,11 +203,17 @@ start(){
p2=`pwd` p2=`pwd`
cd .. cd ..
tar cfz /tmp/res.$$.tgz `basename $p2`/$DATE tar cfz /tmp/res.$$.tgz `basename $p2`/$DATE
scp /tmp/res.$$.tgz $result_host:$result_path scp /tmp/res.$$.tgz $result_host:$result_path/res.$DATE.`hostname -s`.$2.$$.tgz
ssh $result_host "cd $result_path && tar xfz res.$$.tgz && rm -f res.$$.tgz"
rm -f /tmp/res.$$.tgz rm -f /tmp/res.$$.tgz
} }
count_hosts(){
cnt=`grep "CHOOSE_host" $1 |
awk '{for(i=1; i<=NF;i++) if(match($i, "CHOOSE_host") > 0) print $i;}' |
sort | uniq | wc -l`
echo $cnt
}
p=`pwd` p=`pwd`
for dir in $RUN for dir in $RUN
do do
...@@ -199,10 +222,11 @@ do ...@@ -199,10 +222,11 @@ do
run_dir=$base_dir/run-$dir-mysql-$clone-$target run_dir=$base_dir/run-$dir-mysql-$clone-$target
res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE res_dir=$base_dir/result-$dir-mysql-$clone-$target/$DATE
mkdir -p $res_dir mkdir -p $run_dir $res_dir
rm -rf $res_dir/* rm -rf $res_dir/* $run_dir/*
count=`grep -c "COMPUTER" $run_dir/1.ndb_mgmd/initconfig.template` conf=`choose_conf $dir`
count=`count_hosts $conf`
avail_hosts=`filter /tmp/filter_hosts.$$ $hosts` avail_hosts=`filter /tmp/filter_hosts.$$ $hosts`
avail=`echo $avail_hosts | wc -w` avail=`echo $avail_hosts | wc -w`
if [ $count -gt $avail ] if [ $count -gt $avail ]
...@@ -212,12 +236,12 @@ do ...@@ -212,12 +236,12 @@ do
break; break;
fi fi
run_hosts=`echo $avail_hosts| awk '{for(i=1;i<='$count';i++)print $i;}'` run_hosts=`echo $avail_hosts|awk '{for(i=1;i<='$count';i++)print $i;}'`
choose $run_dir/d.template $run_hosts > $run_dir/d.txt
choose $run_dir/1.ndb_mgmd/initconfig.template $run_hosts > $run_dir/1.ndb_mgmd/config.ini
echo $run_hosts >> /tmp/filter_hosts.$$ echo $run_hosts >> /tmp/filter_hosts.$$
cd $run_dir cd $run_dir
choose $conf $run_hosts > d.tmp
$mkconfig d.tmp
start $dir-mysql-$clone-$target $dir $res_dir & start $dir-mysql-$clone-$target $dir $res_dir &
done done
cd $p cd $p
......
...@@ -69,6 +69,7 @@ struct atrt_config { ...@@ -69,6 +69,7 @@ struct atrt_config {
struct atrt_testcase { struct atrt_testcase {
bool m_report; bool m_report;
bool m_run_all;
time_t m_max_time; time_t m_max_time;
BaseString m_command; BaseString m_command;
BaseString m_args; BaseString m_args;
......
...@@ -282,6 +282,7 @@ convert(const Properties & src, SimpleCpcClient::Process & dst){ ...@@ -282,6 +282,7 @@ convert(const Properties & src, SimpleCpcClient::Process & dst){
b &= src.get("stdout", dst.m_stdout); b &= src.get("stdout", dst.m_stdout);
b &= src.get("stderr", dst.m_stderr); b &= src.get("stderr", dst.m_stderr);
b &= src.get("ulimit", dst.m_ulimit); b &= src.get("ulimit", dst.m_ulimit);
b &= src.get("shutdown", dst.m_shutdown_options);
return b; return b;
} }
...@@ -305,6 +306,7 @@ convert(const SimpleCpcClient::Process & src, Properties & dst ){ ...@@ -305,6 +306,7 @@ convert(const SimpleCpcClient::Process & src, Properties & dst ){
b &= dst.put("stdout", src.m_stdout.c_str()); b &= dst.put("stdout", src.m_stdout.c_str());
b &= dst.put("stderr", src.m_stderr.c_str()); b &= dst.put("stderr", src.m_stderr.c_str());
b &= dst.put("ulimit", src.m_ulimit.c_str()); b &= dst.put("ulimit", src.m_ulimit.c_str());
b &= dst.put("shutdown", src.m_shutdown_options.c_str());
return b; return b;
} }
...@@ -372,6 +374,7 @@ SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) { ...@@ -372,6 +374,7 @@ SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) {
CPC_ARG("stdout",String, Mandatory, "Redirect stdout"), CPC_ARG("stdout",String, Mandatory, "Redirect stdout"),
CPC_ARG("stderr",String, Mandatory, "Redirect stderr"), CPC_ARG("stderr",String, Mandatory, "Redirect stderr"),
CPC_ARG("ulimit",String, Mandatory, "ulimit"), CPC_ARG("ulimit",String, Mandatory, "ulimit"),
CPC_ARG("shutdown",String, Mandatory, "shutdown"),
CPC_END() CPC_END()
}; };
......
...@@ -1013,7 +1013,7 @@ String *Item_func_substr::val_str(String *str) ...@@ -1013,7 +1013,7 @@ String *Item_func_substr::val_str(String *str)
if ((null_value=(args[0]->null_value || args[1]->null_value || if ((null_value=(args[0]->null_value || args[1]->null_value ||
(arg_count == 3 && args[2]->null_value)))) (arg_count == 3 && args[2]->null_value))))
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
start= (int32)((start < 0) ? res->length() + start : start -1); start= (int32)((start < 0) ? res->numchars() + start : start -1);
start=res->charpos(start); start=res->charpos(start);
length=res->charpos(length,start); length=res->charpos(length,start);
if (start < 0 || (uint) start+1 > res->length() || length <= 0) if (start < 0 || (uint) start+1 > res->length() || length <= 0)
......
...@@ -268,6 +268,9 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset; ...@@ -268,6 +268,9 @@ extern CHARSET_INFO *national_charset_info, *table_alias_charset;
#define OPTION_SCHEMA_TABLE (1L << 29) #define OPTION_SCHEMA_TABLE (1L << 29)
/* Flag set if setup_tables already done */ /* Flag set if setup_tables already done */
#define OPTION_SETUP_TABLES_DONE (1L << 30) #define OPTION_SETUP_TABLES_DONE (1L << 30)
/* Thr following is used to detect a conflict with DISTINCT
in the user query has requested */
#define SELECT_ALL (ULL(1) << 32)
/* /*
Maximum length of time zone name that we support Maximum length of time zone name that we support
......
...@@ -4000,7 +4000,15 @@ select_option: ...@@ -4000,7 +4000,15 @@ select_option:
YYABORT; YYABORT;
Lex->lock_option= TL_READ_HIGH_PRIORITY; Lex->lock_option= TL_READ_HIGH_PRIORITY;
} }
| DISTINCT { Select->options|= SELECT_DISTINCT; } | DISTINCT
{
if (Select->options & SELECT_ALL)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
Select->options|= SELECT_DISTINCT;
}
| SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; } | SQL_SMALL_RESULT { Select->options|= SELECT_SMALL_RESULT; }
| SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; } | SQL_BIG_RESULT { Select->options|= SELECT_BIG_RESULT; }
| SQL_BUFFER_RESULT | SQL_BUFFER_RESULT
...@@ -4020,7 +4028,15 @@ select_option: ...@@ -4020,7 +4028,15 @@ select_option:
{ {
Lex->select_lex.options|= OPTION_TO_QUERY_CACHE; Lex->select_lex.options|= OPTION_TO_QUERY_CACHE;
} }
| ALL {} | ALL
{
if (Select->options & SELECT_DISTINCT)
{
yyerror(ER(ER_SYNTAX_ERROR));
YYABORT;
}
Select->options|= SELECT_ALL;
}
; ;
select_lock_type: select_lock_type:
......
...@@ -59,6 +59,7 @@ static byte* get_field_name(Field **buff,uint *length, ...@@ -59,6 +59,7 @@ static byte* get_field_name(Field **buff,uint *length,
3 Wrong data in .frm file 3 Wrong data in .frm file
4 Error (see frm_error) 4 Error (see frm_error)
5 Error (see frm_error: charset unavailable) 5 Error (see frm_error: charset unavailable)
6 Unknown .frm version
*/ */
int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
...@@ -135,10 +136,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat, ...@@ -135,10 +136,14 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
*fn_ext(share->table_name)='\0'; // Remove extension *fn_ext(share->table_name)='\0'; // Remove extension
*fn_ext(share->path)='\0'; // Remove extension *fn_ext(share->path)='\0'; // Remove extension
if (head[0] != (uchar) 254 || head[1] != 1 || if (head[0] != (uchar) 254 || head[1] != 1)
(head[2] != FRM_VER && head[2] != FRM_VER+1 && goto err; /* purecov: inspected */
! (head[2] >= FRM_VER+3 && head[2] <= FRM_VER+4))) if (head[2] != FRM_VER && head[2] != FRM_VER+1 &&
! (head[2] >= FRM_VER+3 && head[2] <= FRM_VER+4))
{
error= 6;
goto err; /* purecov: inspected */ goto err; /* purecov: inspected */
}
new_field_pack_flag=head[27]; new_field_pack_flag=head[27];
new_frm_ver= (head[2] - FRM_VER); new_frm_ver= (head[2] - FRM_VER);
field_pack_length= new_frm_ver < 2 ? 11 : 17; field_pack_length= new_frm_ver < 2 ? 11 : 17;
...@@ -1084,6 +1089,12 @@ static void frm_error(int error, TABLE *form, const char *name, ...@@ -1084,6 +1089,12 @@ static void frm_error(int error, TABLE *form, const char *name,
MYF(0), csname, real_name); MYF(0), csname, real_name);
break; break;
} }
case 6:
my_printf_error(ER_NOT_FORM_FILE,
"Table '%-.64s' was created with a different version "
"of MySQL and cannot be read",
MYF(0), name);
break;
default: /* Better wrong error than none */ default: /* Better wrong error than none */
case 4: case 4:
my_error(ER_NOT_FORM_FILE, errortype, my_error(ER_NOT_FORM_FILE, errortype,
......
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