Commit 5c419ee2 authored by unknown's avatar unknown

Merge perch.ndb.mysql.com:/home/jonas/src/51-telco-gca

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb


storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
  Auto merged
parents db350aa1 6962973e
......@@ -44,6 +44,8 @@ class FsOpenReq {
friend class Restore;
friend class Dblqh;
friend class Dbtup;
/**
* For printing
*/
......
......@@ -1053,6 +1053,8 @@ ArrayPool<TupTriggerData> c_triggerPool;
struct {
Uint32 tabUserPtr;
Uint32 tabUserRef;
Uint32 m_lcpno;
Uint32 m_fragPtrI;
} m_dropTable;
State tableStatus;
};
......@@ -1614,6 +1616,11 @@ private:
void execACCKEYREF(Signal* signal);
void execACC_ABORTCONF(Signal* signal);
// Drop table
void execFSREMOVEREF(Signal*);
void execFSREMOVECONF(Signal*);
//------------------------------------------------------------------
//------------------------------------------------------------------
// Methods to handle execution of TUPKEYREQ + ATTRINFO.
......@@ -2505,7 +2512,9 @@ private:
void drop_fragment_free_extent_log_buffer_callback(Signal*, Uint32, Uint32);
void drop_fragment_unmap_pages(Signal*, TablerecPtr, FragrecordPtr, Uint32);
void drop_fragment_unmap_page_callback(Signal* signal, Uint32, Uint32);
void drop_fragment_fsremove(Signal*, TablerecPtr, FragrecordPtr);
void drop_fragment_fsremove_done(Signal*, TablerecPtr, FragrecordPtr);
// Initialisation
void initData();
void initRecords();
......
......@@ -99,6 +99,10 @@ Dbtup::Dbtup(Block_context& ctx, Pgman* pgman)
addRecSignal(GSN_ACCKEYREF, &Dbtup::execACCKEYREF);
addRecSignal(GSN_ACC_ABORTCONF, &Dbtup::execACC_ABORTCONF);
// Drop table
addRecSignal(GSN_FSREMOVEREF, &Dbtup::execFSREMOVEREF, true);
addRecSignal(GSN_FSREMOVECONF, &Dbtup::execFSREMOVECONF, true);
attrbufrec = 0;
fragoperrec = 0;
fragrecord = 0;
......
......@@ -21,6 +21,7 @@
#include <ndb_limits.h>
#include <pc.hpp>
#include <signaldata/TupFrag.hpp>
#include <signaldata/FsRef.hpp>
#include <signaldata/FsConf.hpp>
#include <signaldata/FsRemoveReq.hpp>
#include <signaldata/DropTab.hpp>
......@@ -1283,6 +1284,24 @@ Dbtup::drop_fragment_free_var_pages(Signal* signal)
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
return;
}
/**
* Remove LCP's for fragment
*/
tabPtr.p->m_dropTable.m_lcpno = 0;
tabPtr.p->m_dropTable.m_fragPtrI = fragPtr.i;
drop_fragment_fsremove(signal, tabPtr, fragPtr);
}
void
Dbtup::drop_fragment_fsremove_done(Signal* signal,
TablerecPtr tabPtr,
FragrecordPtr fragPtr)
{
/**
* LCP's removed...
* now continue with "next"
*/
Uint32 logfile_group_id = fragPtr.p->m_logfile_group_id ;
releaseFragPages(fragPtr.p);
Uint32 i;
......@@ -1302,6 +1321,74 @@ Dbtup::drop_fragment_free_var_pages(Signal* signal)
return;
}
// Remove LCP
void
Dbtup::drop_fragment_fsremove(Signal* signal,
TablerecPtr tabPtr,
FragrecordPtr fragPtr)
{
FsRemoveReq* req = (FsRemoveReq*)signal->getDataPtrSend();
req->userReference = reference();
req->userPointer = tabPtr.i;
req->directory = 0;
req->ownDirectory = 0;
Uint32 lcpno = tabPtr.p->m_dropTable.m_lcpno;
Uint32 fragId = fragPtr.p->fragmentId;
Uint32 tableId = fragPtr.p->fragTableId;
FsOpenReq::setVersion(req->fileNumber, 5);
FsOpenReq::setSuffix(req->fileNumber, FsOpenReq::S_DATA);
FsOpenReq::v5_setLcpNo(req->fileNumber, lcpno);
FsOpenReq::v5_setTableId(req->fileNumber, tableId);
FsOpenReq::v5_setFragmentId(req->fileNumber, fragId);
sendSignal(NDBFS_REF, GSN_FSREMOVEREQ, signal,
FsRemoveReq::SignalLength, JBB);
}
void
Dbtup::execFSREMOVEREF(Signal* signal)
{
jamEntry();
FsRef* ref = (FsRef*)signal->getDataPtr();
Uint32 userPointer = ref->userPointer;
FsConf* conf = (FsConf*)signal->getDataPtrSend();
conf->userPointer = userPointer;
execFSREMOVECONF(signal);
}
void
Dbtup::execFSREMOVECONF(Signal* signal)
{
jamEntry();
FsConf* conf = (FsConf*)signal->getDataPtrSend();
TablerecPtr tabPtr;
FragrecordPtr fragPtr;
tabPtr.i = conf->userPointer;
ptrCheckGuard(tabPtr, cnoOfTablerec, tablerec);
ndbrequire(tabPtr.p->tableStatus == DROPPING);
fragPtr.i = tabPtr.p->m_dropTable.m_fragPtrI;
ptrCheckGuard(fragPtr, cnoOfFragrec, fragrecord);
tabPtr.p->m_dropTable.m_lcpno++;
if (tabPtr.p->m_dropTable.m_lcpno < 3)
{
jam();
drop_fragment_fsremove(signal, tabPtr, fragPtr);
}
else
{
jam();
drop_fragment_fsremove_done(signal, tabPtr, fragPtr);
}
}
// End remove LCP
void
Dbtup::start_restore_lcp(Uint32 tableId, Uint32 fragId)
{
......
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