diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2006-12-01 09:14:12 +0100 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2006-12-01 09:14:12 +0100 |
commit | e958b49e8d0d51581032ab64859c5e646ec5680a (patch) | |
tree | e6c2dfcbcad64ac29e16155a4413ef7ca590097d /storage | |
parent | bfc5a0cc42eaf124e298401ebb1198f950b5a9dc (diff) | |
parent | cc00d542ac802c86e61fd572fc1c9f3862abfa84 (diff) | |
download | mariadb-git-e958b49e8d0d51581032ab64859c5e646ec5680a.tar.gz |
Merge perch.ndb.mysql.com:/home/jonas/src/50-work
into perch.ndb.mysql.com:/home/jonas/src/51-work
storage/ndb/src/common/util/NdbSqlUtil.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
Auto merged
storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
merge
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp:
merge
storage/ndb/src/kernel/vm/SimulatedBlock.cpp:
merge
storage/ndb/src/kernel/vm/SimulatedBlock.hpp:
merge
storage/ndb/src/ndbapi/ndberror.c:
merge
Diffstat (limited to 'storage')
-rw-r--r-- | storage/ndb/src/common/util/NdbSqlUtil.cpp | 19 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 22 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 3 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 2 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 44 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 4 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp | 3 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 36 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 1 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp | 4 | ||||
-rw-r--r-- | storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp | 10 | ||||
-rw-r--r-- | storage/ndb/src/kernel/vm/SimulatedBlock.cpp | 9 | ||||
-rw-r--r-- | storage/ndb/src/kernel/vm/SimulatedBlock.hpp | 1 | ||||
-rw-r--r-- | storage/ndb/src/ndbapi/ndberror.c | 1 |
16 files changed, 125 insertions, 38 deletions
diff --git a/storage/ndb/src/common/util/NdbSqlUtil.cpp b/storage/ndb/src/common/util/NdbSqlUtil.cpp index f3d70a5734a..ba451c4dd8b 100644 --- a/storage/ndb/src/common/util/NdbSqlUtil.cpp +++ b/storage/ndb/src/common/util/NdbSqlUtil.cpp @@ -136,7 +136,7 @@ NdbSqlUtil::m_typeList[] = { }, { // 22 Type::Bit, - NULL, + cmpBit, NULL }, { // 23 @@ -679,6 +679,17 @@ NdbSqlUtil::cmpText(const void* info, const void* p1, unsigned n1, const void* p } int +NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) +{ + Uint32 n = (n1 < n2) ? n1 : n2; + char* c1 = (char*)p1; + char* c2 = (char*)p2; + int ret = memcmp(p1, p2, n); + return ret; +} + + +int NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) { if (n2 >= 3) { @@ -698,12 +709,6 @@ NdbSqlUtil::cmpTime(const void* info, const void* p1, unsigned n1, const void* p } // not yet -int -NdbSqlUtil::cmpBit(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) -{ - assert(false); - return 0; -} int NdbSqlUtil::cmpLongvarchar(const void* info, const void* p1, unsigned n1, const void* p2, unsigned n2, bool full) diff --git a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 957248bcf56..f9607a2cb19 100644 --- a/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/storage/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -366,6 +366,16 @@ void Cmvmi::execSTTOR(Signal* signal) jamEntry(); if (theStartPhase == 1){ jam(); + + if(theConfig.lockPagesInMainMemory()) + { + int res = NdbMem_MemLockAll(); + if(res != 0){ + g_eventLogger.warning("Failed to memlock pages"); + warningEvent("Failed to memlock pages"); + } + } + sendSTTORRY(signal); return; } else if (theStartPhase == 3) { @@ -382,18 +392,6 @@ void Cmvmi::execSTTOR(Signal* signal) execOPEN_COMREQ(signal); globalData.theStartLevel = NodeState::SL_STARTED; sendSTTORRY(signal); - } else { - jam(); - - if(m_ctx.m_config.lockPagesInMainMemory()){ - int res = NdbMem_MemLockAll(); - if(res != 0){ - g_eventLogger.warning("Failed to memlock pages"); - warningEvent("Failed to memlock pages"); - } - } - - sendSTTORRY(signal); } } diff --git a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index 3edaf146cd4..37eb54028a6 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -1617,7 +1617,7 @@ private: void dump_replica_info(); // DIH specifics for execNODE_START_REP (sendDictUnlockOrd) - void exec_node_start_rep(Signal* signal); + void execNODE_START_REP(Signal* signal); /* * Lock master DICT. Only current use is by starting node diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 468a52f23f5..48e19658f24 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -256,7 +256,8 @@ Dbdih::Dbdih(Block_context& ctx): addRecSignal(GSN_DICT_LOCK_CONF, &Dbdih::execDICT_LOCK_CONF); addRecSignal(GSN_DICT_LOCK_REF, &Dbdih::execDICT_LOCK_REF); - + addRecSignal(GSN_NODE_START_REP, &Dbdih::execNODE_START_REP); + addRecSignal(GSN_START_FRAGREF, &Dbdih::execSTART_FRAGREF); diff --git a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 0e9157c38aa..ec17d7409c0 100644 --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -1421,7 +1421,7 @@ void Dbdih::execNDB_STTOR(Signal* signal) }//Dbdih::execNDB_STTOR() void -Dbdih::exec_node_start_rep(Signal* signal) +Dbdih::execNODE_START_REP(Signal* signal) { /* * Send DICT_UNLOCK_ORD when this node is SL_STARTED. diff --git a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 736134a8a8b..cb415a97f0f 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -240,6 +240,7 @@ class Dbtup; #define ZOPERATION_EVENT_REP 19 #define ZPREP_DROP_TABLE 20 #define ZENABLE_EXPAND_CHECK 21 +#define ZRETRY_TCKEYREF 22 /* ------------------------------------------------------------------------- */ /* NODE STATE DURING SYSTEM RESTART, VARIABLES CNODES_SR_STATE */ @@ -2240,6 +2241,7 @@ private: void releaseScanrec(Signal* signal); void seizeScanrec(Signal* signal); Uint32 sendKeyinfo20(Signal* signal, ScanRecord *, TcConnectionrec *); + void sendTCKEYREF(Signal*, Uint32 dst, Uint32 route, Uint32 cnt); void sendScanFragConf(Signal* signal, Uint32 scanCompleted); void initCopyrec(Signal* signal); void initCopyTc(Signal* signal, Operation_t); diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 9a7803efbec..486ccbc5612 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -448,6 +448,22 @@ void Dblqh::execCONTINUEB(Signal* signal) return; } } + case ZRETRY_TCKEYREF: + { + jam(); + Uint32 cnt = signal->theData[1]; + Uint32 ref = signal->theData[2]; + if (cnt < (10 * 60 * 5)) + { + jam(); + /** + * Only retry for 5 minutes...then hope that API has handled it..somehow + */ + memmove(signal->theData, signal->theData+3, 4*TcKeyRef::SignalLength); + sendTCKEYREF(signal, ref, 0, cnt); + } + return; + } default: ndbrequire(false); break; @@ -2216,7 +2232,7 @@ void Dblqh::noFreeRecordLab(Signal* signal, tcKeyRef->transId[0] = transid1; tcKeyRef->transId[1] = transid2; tcKeyRef->errorCode = errCode; - sendSignal(apiRef, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB); + sendTCKEYREF(signal, apiRef, signal->getSendersBlockRef(), 0); } else { jam(); @@ -7273,8 +7289,7 @@ void Dblqh::continueAfterLogAbortWriteLab(Signal* signal) tcKeyRef->transId[0] = regTcPtr->transid[0]; tcKeyRef->transId[1] = regTcPtr->transid[1]; tcKeyRef->errorCode = regTcPtr->errorCode; - sendSignal(regTcPtr->applRef, - GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB); + sendTCKEYREF(signal, regTcPtr->applRef, regTcPtr->clientBlockref, 0); cleanUp(signal); return; }//if @@ -7309,6 +7324,29 @@ void Dblqh::continueAfterLogAbortWriteLab(Signal* signal) cleanUp(signal); }//Dblqh::continueAfterLogAbortWriteLab() +void +Dblqh::sendTCKEYREF(Signal* signal, Uint32 ref, Uint32 routeRef, Uint32 cnt) +{ + const Uint32 nodeId = refToNode(ref); + const bool connectedToNode = getNodeInfo(nodeId).m_connected; + + if (likely(connectedToNode)) + { + jam(); + sendSignal(ref, GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB); + } + else + { + jam(); + memmove(signal->theData + 3, signal->theData, 4*TcKeyRef::SignalLength); + signal->theData[0] = ZRETRY_TCKEYREF; + signal->theData[1] = cnt + 1; + signal->theData[2] = ref; + sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100, + TcKeyRef::SignalLength + 3); + } +} + /* ########################################################################## * ####### MODULE TO HANDLE TC FAILURE ####### * diff --git a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index 6091b8f1aee..6fd6075bd99 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -945,7 +945,8 @@ public: NF_CHECK_SCAN = 0x2, NF_CHECK_TRANSACTION = 0x4, NF_CHECK_DROP_TAB = 0x8, - NF_NODE_FAIL_BITS = 0xF // All bits... + NF_NODE_FAIL_BITS = 0xF, // All bits... + NF_STARTED = 0x10 }; Uint32 m_nf_bits; NdbNodeBitmask m_lqh_trans_conf; @@ -1323,6 +1324,7 @@ private: void execCOMMITCONF(Signal* signal); void execABORTCONF(Signal* signal); void execNODE_FAILREP(Signal* signal); + void execNODE_START_REP(Signal* signal); void execINCL_NODEREQ(Signal* signal); void execTIME_SIGNAL(Signal* signal); void execAPI_FAILREQ(Signal* signal); diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index 8dee75398ed..b5702f0a539 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -279,7 +279,8 @@ Dbtc::Dbtc(Block_context& ctx): addRecSignal(GSN_WAIT_DROP_TAB_CONF, &Dbtc::execWAIT_DROP_TAB_CONF); addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ); - + addRecSignal(GSN_NODE_START_REP, &Dbtc::execNODE_START_REP, true); + cacheRecord = 0; apiConnectRecord = 0; tcConnectRecord = 0; diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 1fa23f06f6a..2b543b445b7 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -3051,7 +3051,28 @@ void Dbtc::tckeyreq050Lab(Signal* signal) }//if }//for } - }//if + + if (regTcPtr->tcNodedata[0] != getOwnNodeId()) + { + jam(); + for (Uint32 i = 0; i < tnoOfBackup + 1; i++) + { + HostRecordPtr hostPtr; + hostPtr.i = regTcPtr->tcNodedata[i]; + ptrCheckGuard(hostPtr, chostFilesize, hostRecord); + if (hostPtr.p->m_nf_bits & HostRecord::NF_STARTED) + { + jam(); + if (i != 0) + { + jam(); + regTcPtr->tcNodedata[0] = hostPtr.i; + } + break; + } + } + }//if + } jam(); regTcPtr->lastReplicaNo = 0; regTcPtr->noOfNodes = 1; @@ -7009,6 +7030,19 @@ void Dbtc::execNODE_FAILREP(Signal* signal) }//Dbtc::execNODE_FAILREP() void +Dbtc::execNODE_START_REP(Signal* signal) +{ + Uint32 nodeId = signal->theData[0]; + hostptr.i = nodeId; + ptrCheckGuard(hostptr, chostFilesize, hostRecord); + if (hostptr.p->m_nf_bits == 0) + { + jam(); + hostptr.p->m_nf_bits |= HostRecord::NF_STARTED; + } +} + +void Dbtc::checkNodeFailComplete(Signal* signal, Uint32 failedNodeId, Uint32 bit) diff --git a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index e19e43f6d47..07ee55fce20 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -172,6 +172,7 @@ inline const Uint32* ALIGN_WORD(const void* ptr) #define ZTRY_TO_UPDATE_ERROR 888 #define ZCALL_ERROR 890 #define ZTEMPORARY_RESOURCE_FAILURE 891 +#define ZUNSUPPORTED_BRANCH 892 #define ZSTORED_SEIZE_ATTRINBUFREC_ERROR 873 // Part of Scan diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp index 76f4c215618..31573f17079 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp @@ -320,6 +320,10 @@ int Dbtup::TUPKEY_abort(Signal* signal, int error_type) ndbrequire(false); }//if break; + case 40: + ljam(); + terrorCode = ZUNSUPPORTED_BRANCH; + break; default: ndbrequire(false); break; diff --git a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp index 3118164badd..f36d522005d 100644 --- a/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp +++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp @@ -2248,6 +2248,11 @@ int Dbtup::interpreterNextLab(Signal* signal, // NULL==NULL and NULL<not-NULL res1 = r1_null && r2_null ? 0 : r1_null ? -1 : 1; } else { + jam(); + if (unlikely(sqlType.m_cmp == 0)) + { + return TUPKEY_abort(signal, 40); + } res1 = (*sqlType.m_cmp)(cs, s1, attrLen, s2, argLen, true); } } else { @@ -2255,6 +2260,11 @@ int Dbtup::interpreterNextLab(Signal* signal, // NULL like NULL is true (has no practical use) res1 = r1_null && r2_null ? 0 : -1; } else { + jam(); + if (unlikely(sqlType.m_like == 0)) + { + return TUPKEY_abort(signal, 40); + } res1 = (*sqlType.m_like)(cs, s1, attrLen, s2, argLen); } } diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp index 4e01038d343..1de47197867 100644 --- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -921,15 +921,6 @@ SimulatedBlock::execCONTINUE_FRAGMENTED(Signal * signal){ void SimulatedBlock::execNODE_START_REP(Signal* signal) { - // common stuff for all blocks - - // block specific stuff by virtual method override (default empty) - exec_node_start_rep(signal); -} - -void -SimulatedBlock::exec_node_start_rep(Signal* signal) -{ } void diff --git a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp index 3e90b20705e..c782f3fbec8 100644 --- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -446,7 +446,6 @@ private: void execCONTINUE_FRAGMENTED(Signal* signal); void execAPI_START_REP(Signal* signal); void execNODE_START_REP(Signal* signal); - virtual void exec_node_start_rep(Signal* signal); Uint32 c_fragmentIdCounter; ArrayPool<FragmentInfo> c_fragmentInfoPool; diff --git a/storage/ndb/src/ndbapi/ndberror.c b/storage/ndb/src/ndbapi/ndberror.c index 083830e8b44..45559847b5e 100644 --- a/storage/ndb/src/ndbapi/ndberror.c +++ b/storage/ndb/src/ndbapi/ndberror.c @@ -297,6 +297,7 @@ ErrorBundle ErrorCodes[] = { { 885, DMEC, AE, "Stack underflow in interpreter" }, { 886, DMEC, AE, "More than 65535 instructions executed in interpreter" }, { 897, DMEC, AE, "Update attempt of primary key via ndbcluster internal api (if this occurs via the MySQL server it is a bug, please report)" }, + { 892, DMEC, AE, "Unsupported type in scan filter" }, { 4256, DMEC, AE, "Must call Ndb::init() before this function" }, { 4257, DMEC, AE, "Tried to read too much - too many getValue calls" }, |