Commit ad85a10a authored by pekka@mysql.com's avatar pekka@mysql.com

ndb: wl-2066. remove ACC storage. dead code not yet removed

parent 4ff14f6c
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
#include <pc.hpp> #include <pc.hpp>
#include <SimulatedBlock.hpp> #include <SimulatedBlock.hpp>
// primary key is stored in TUP
#include <Dbtup.hpp>
#ifdef DBACC_C #ifdef DBACC_C
// Debug Macros // Debug Macros
#define dbgWord32(ptr, ind, val) #define dbgWord32(ptr, ind, val)
...@@ -661,9 +664,10 @@ struct Fragmentrec { ...@@ -661,9 +664,10 @@ struct Fragmentrec {
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// elementLength: Length of element in bucket and overflow pages // elementLength: Length of element in bucket and overflow pages
// keyLength: Length of key (== 0 if long key or variable key length) // keyLength: Length of key (== 0 if long key or variable key length)
// wl-2066 always Length of key
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
Uint8 elementLength; Uint8 elementLength;
Uint8 keyLength; Uint16 keyLength;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// This flag is used to avoid sending a big number of expand or shrink signals // This flag is used to avoid sending a big number of expand or shrink signals
...@@ -783,6 +787,7 @@ struct Operationrec { ...@@ -783,6 +787,7 @@ struct Operationrec {
Uint8 dirtyRead; Uint8 dirtyRead;
Uint8 commitDeleteCheckFlag; Uint8 commitDeleteCheckFlag;
Uint8 isAccLockReq; Uint8 isAccLockReq;
Uint8 isUndoLogReq;
Uint32 nextOpList; Uint32 nextOpList;
}; /* p2c: size = 168 bytes */ }; /* p2c: size = 168 bytes */
...@@ -914,6 +919,9 @@ public: ...@@ -914,6 +919,9 @@ public:
Dbacc(const class Configuration &); Dbacc(const class Configuration &);
virtual ~Dbacc(); virtual ~Dbacc();
// pointer to TUP instance in this thread
Dbtup* c_tup;
private: private:
BLOCK_DEFINES(Dbacc); BLOCK_DEFINES(Dbacc);
...@@ -1075,6 +1083,7 @@ private: ...@@ -1075,6 +1083,7 @@ private:
void storeLongKeys(Signal* signal); void storeLongKeys(Signal* signal);
void storeLongKeysAtPos(Signal* signal); void storeLongKeysAtPos(Signal* signal);
void reorgLongPage(Signal* signal); void reorgLongPage(Signal* signal);
void readTablePk(Uint32 localkey1);
void getElement(Signal* signal); void getElement(Signal* signal);
void searchLongKey(Signal* signal); void searchLongKey(Signal* signal);
void getdirindex(Signal* signal); void getdirindex(Signal* signal);
...@@ -1562,7 +1571,10 @@ private: ...@@ -1562,7 +1571,10 @@ private:
Uint32 cexcPrevpageindex; Uint32 cexcPrevpageindex;
Uint32 cexcPrevforward; Uint32 cexcPrevforward;
Uint32 clocalkey[32]; Uint32 clocalkey[32];
union {
Uint32 ckeys[2048]; Uint32 ckeys[2048];
Uint64 ckeys_align;
};
Uint32 c_errorInsert3000_TableId; Uint32 c_errorInsert3000_TableId;
Uint32 cSrUndoRecords[5]; Uint32 cSrUndoRecords[5];
......
...@@ -133,7 +133,8 @@ void Dbacc::initRecords() ...@@ -133,7 +133,8 @@ void Dbacc::initRecords()
}//Dbacc::initRecords() }//Dbacc::initRecords()
Dbacc::Dbacc(const class Configuration & conf): Dbacc::Dbacc(const class Configuration & conf):
SimulatedBlock(DBACC, conf) SimulatedBlock(DBACC, conf),
c_tup(0)
{ {
Uint32 log_page_size= 0; Uint32 log_page_size= 0;
BLOCK_CONSTRUCTOR(Dbacc); BLOCK_CONSTRUCTOR(Dbacc);
......
This diff is collapsed.
...@@ -3,6 +3,8 @@ noinst_LIBRARIES = libdbacc.a ...@@ -3,6 +3,8 @@ noinst_LIBRARIES = libdbacc.a
libdbacc_a_SOURCES = DbaccInit.cpp DbaccMain.cpp libdbacc_a_SOURCES = DbaccInit.cpp DbaccMain.cpp
INCLUDES_LOC = -I$(top_srcdir)/ndb/src/kernel/blocks/dbtup
include $(top_srcdir)/ndb/config/common.mk.am include $(top_srcdir)/ndb/config/common.mk.am
include $(top_srcdir)/ndb/config/type_kernel.mk.am include $(top_srcdir)/ndb/config/type_kernel.mk.am
......
...@@ -4104,7 +4104,7 @@ Dbdict::execADD_FRAGREQ(Signal* signal) { ...@@ -4104,7 +4104,7 @@ Dbdict::execADD_FRAGREQ(Signal* signal) {
req->noOfPagesToPreAllocate = 0; req->noOfPagesToPreAllocate = 0;
req->schemaVersion = tabPtr.p->tableVersion; req->schemaVersion = tabPtr.p->tableVersion;
Uint32 keyLen = tabPtr.p->tupKeyLength; Uint32 keyLen = tabPtr.p->tupKeyLength;
req->keyLength = keyLen > 8 ? 0 : keyLen; // Put this into ACC instead req->keyLength = keyLen; // wl-2066 no more "long keys"
req->nextLCP = lcpNo; req->nextLCP = lcpNo;
req->noOfKeyAttr = tabPtr.p->noOfPrimkey; req->noOfKeyAttr = tabPtr.p->noOfPrimkey;
......
...@@ -1020,6 +1020,13 @@ public: ...@@ -1020,6 +1020,13 @@ public:
*/ */
int tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* dataOut); int tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* dataOut);
/*
* ACC reads primary key without headers into an array of words. At
* this point in ACC deconstruction, ACC still uses logical references
* to fragment and tuple.
*/
int accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIndex, Uint32* dataOut);
/* /*
* TUX checks if tuple is visible to scan. * TUX checks if tuple is visible to scan.
*/ */
......
...@@ -200,8 +200,7 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* data ...@@ -200,8 +200,7 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* data
operPtr.i = RNIL; operPtr.i = RNIL;
operPtr.p = NULL; operPtr.p = NULL;
// do it // do it
int ret = readAttributes(pagePtr.p, pageOffset, attrIds, int ret = readAttributes(pagePtr.p, pageOffset, attrIds, numAttrs, dataOut, ZNIL, true);
numAttrs, dataOut, ZNIL, true);
// restore globals // restore globals
tabptr = tabptr_old; tabptr = tabptr_old;
fragptr = fragptr_old; fragptr = fragptr_old;
...@@ -229,6 +228,27 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* data ...@@ -229,6 +228,27 @@ Dbtup::tuxReadPk(Uint32 fragPtrI, Uint32 pageId, Uint32 pageOffset, Uint32* data
return ret; return ret;
} }
int
Dbtup::accReadPk(Uint32 tableId, Uint32 fragId, Uint32 fragPageId, Uint32 pageIndex, Uint32* dataOut)
{
ljamEntry();
// get table
TablerecPtr tablePtr;
tablePtr.i = tableId;
ptrCheckGuard(tablePtr, cnoOfTablerec, tablerec);
// get fragment
FragrecordPtr fragPtr;
getFragmentrec(fragPtr, fragId, tablePtr.p);
// get real page id and tuple offset
PagePtr pagePtr;
Uint32 pageId = getRealpid(fragPtr.p, fragPageId);
ndbrequire((pageIndex & 0x1) == 0);
Uint32 pageOffset = ZPAGE_HEADER_SIZE + (pageIndex >> 1) * tablePtr.p->tupheadsize;
// use TUX routine - optimize later
int ret = tuxReadPk(fragPtr.i, pageId, pageOffset, dataOut);
return ret;
}
bool bool
Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 tupAddr, Uint32 tupVersion, Uint32 transId1, Uint32 transId2, Uint32 savePointId) Dbtup::tuxQueryTh(Uint32 fragPtrI, Uint32 tupAddr, Uint32 tupVersion, Uint32 transId1, Uint32 transId2, Uint32 savePointId)
{ {
......
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