Commit 15cfd0fd authored by jonas@perch.ndb.mysql.com's avatar jonas@perch.ndb.mysql.com

Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.1-new-ndb

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb
parents 598a6028 5db64df3
...@@ -35,7 +35,7 @@ class TupCommitReq { ...@@ -35,7 +35,7 @@ class TupCommitReq {
friend bool printTUPCOMMITREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo); friend bool printTUPCOMMITREQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 receiverBlockNo);
public: public:
STATIC_CONST( SignalLength = 3 ); STATIC_CONST( SignalLength = 4 );
private: private:
...@@ -45,6 +45,7 @@ private: ...@@ -45,6 +45,7 @@ private:
Uint32 opPtr; Uint32 opPtr;
Uint32 gci; Uint32 gci;
Uint32 hashValue; Uint32 hashValue;
Uint32 diskpage;
}; };
#endif #endif
...@@ -6379,6 +6379,7 @@ void Dblqh::commitContinueAfterBlockedLab(Signal* signal) ...@@ -6379,6 +6379,7 @@ void Dblqh::commitContinueAfterBlockedLab(Signal* signal)
tupCommitReq->opPtr = sig0; tupCommitReq->opPtr = sig0;
tupCommitReq->gci = regTcPtr.p->gci; tupCommitReq->gci = regTcPtr.p->gci;
tupCommitReq->hashValue = regTcPtr.p->hashValue; tupCommitReq->hashValue = regTcPtr.p->hashValue;
tupCommitReq->diskpage = RNIL;
EXECUTE_DIRECT(tup, GSN_TUP_COMMITREQ, signal, EXECUTE_DIRECT(tup, GSN_TUP_COMMITREQ, signal,
TupCommitReq::SignalLength); TupCommitReq::SignalLength);
......
...@@ -2208,7 +2208,8 @@ private: ...@@ -2208,7 +2208,8 @@ private:
#endif #endif
void checkDetachedTriggers(KeyReqStruct *req_struct, void checkDetachedTriggers(KeyReqStruct *req_struct,
Operationrec* regOperPtr, Operationrec* regOperPtr,
Tablerec* regTablePtr); Tablerec* regTablePtr,
bool disk);
void fireImmediateTriggers(KeyReqStruct *req_struct, void fireImmediateTriggers(KeyReqStruct *req_struct,
DLList<TupTriggerData>& triggerList, DLList<TupTriggerData>& triggerList,
...@@ -2220,7 +2221,8 @@ private: ...@@ -2220,7 +2221,8 @@ private:
void fireDetachedTriggers(KeyReqStruct *req_struct, void fireDetachedTriggers(KeyReqStruct *req_struct,
DLList<TupTriggerData>& triggerList, DLList<TupTriggerData>& triggerList,
Operationrec* regOperPtr); Operationrec* regOperPtr,
bool disk);
void executeTriggers(KeyReqStruct *req_struct, void executeTriggers(KeyReqStruct *req_struct,
DLList<TupTriggerData>& triggerList, DLList<TupTriggerData>& triggerList,
...@@ -2228,7 +2230,8 @@ private: ...@@ -2228,7 +2230,8 @@ private:
void executeTrigger(KeyReqStruct *req_struct, void executeTrigger(KeyReqStruct *req_struct,
TupTriggerData* trigPtr, TupTriggerData* trigPtr,
Operationrec* regOperPtr); Operationrec* regOperPtr,
bool disk = true);
bool readTriggerInfo(TupTriggerData* trigPtr, bool readTriggerInfo(TupTriggerData* trigPtr,
Operationrec* regOperPtr, Operationrec* regOperPtr,
...@@ -2239,7 +2242,8 @@ private: ...@@ -2239,7 +2242,8 @@ private:
Uint32* afterBuffer, Uint32* afterBuffer,
Uint32& noAfterWords, Uint32& noAfterWords,
Uint32* beforeBuffer, Uint32* beforeBuffer,
Uint32& noBeforeWords); Uint32& noBeforeWords,
bool disk);
void sendTrigAttrInfo(Signal* signal, void sendTrigAttrInfo(Signal* signal,
Uint32* data, Uint32* data,
......
...@@ -356,6 +356,7 @@ Dbtup::disk_page_commit_callback(Signal* signal, ...@@ -356,6 +356,7 @@ Dbtup::disk_page_commit_callback(Signal* signal,
tupCommitReq->opPtr= opPtrI; tupCommitReq->opPtr= opPtrI;
tupCommitReq->hashValue= hash_value; tupCommitReq->hashValue= hash_value;
tupCommitReq->gci= gci; tupCommitReq->gci= gci;
tupCommitReq->diskpage = page_id;
regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0; regOperPtr.p->op_struct.m_load_diskpage_on_commit= 0;
regOperPtr.p->m_commit_disk_callback_page= page_id; regOperPtr.p->m_commit_disk_callback_page= page_id;
...@@ -386,14 +387,15 @@ Dbtup::disk_page_log_buffer_callback(Signal* signal, ...@@ -386,14 +387,15 @@ Dbtup::disk_page_log_buffer_callback(Signal* signal,
c_operation_pool.getPtr(regOperPtr, opPtrI); c_operation_pool.getPtr(regOperPtr, opPtrI);
c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci); c_lqh->get_op_info(regOperPtr.p->userpointer, &hash_value, &gci);
Uint32 page= regOperPtr.p->m_commit_disk_callback_page;
TupCommitReq * const tupCommitReq= (TupCommitReq *)signal->getDataPtr(); TupCommitReq * const tupCommitReq= (TupCommitReq *)signal->getDataPtr();
tupCommitReq->opPtr= opPtrI; tupCommitReq->opPtr= opPtrI;
tupCommitReq->hashValue= hash_value; tupCommitReq->hashValue= hash_value;
tupCommitReq->gci= gci; tupCommitReq->gci= gci;
tupCommitReq->diskpage = page;
Uint32 page= regOperPtr.p->m_commit_disk_callback_page;
ndbassert(regOperPtr.p->op_struct.m_load_diskpage_on_commit == 0); ndbassert(regOperPtr.p->op_struct.m_load_diskpage_on_commit == 0);
regOperPtr.p->op_struct.m_wait_log_buffer= 0; regOperPtr.p->op_struct.m_wait_log_buffer= 0;
m_global_page_pool.getPtr(m_pgman.m_ptr, page); m_global_page_pool.getPtr(m_pgman.m_ptr, page);
...@@ -478,6 +480,15 @@ void Dbtup::execTUP_COMMITREQ(Signal* signal) ...@@ -478,6 +480,15 @@ void Dbtup::execTUP_COMMITREQ(Signal* signal)
req_struct.signal= signal; req_struct.signal= signal;
req_struct.hash_value= hash_value; req_struct.hash_value= hash_value;
req_struct.gci= gci; req_struct.gci= gci;
regOperPtr.p->m_commit_disk_callback_page = tupCommitReq->diskpage;
#ifdef VM_TRACE
if (tupCommitReq->diskpage == RNIL)
{
m_pgman.m_ptr.setNull();
req_struct.m_disk_page_ptr.setNull();
}
#endif
ptrCheckGuard(regTabPtr, no_of_tablerec, tablerec); ptrCheckGuard(regTabPtr, no_of_tablerec, tablerec);
...@@ -626,8 +637,10 @@ skip_disk: ...@@ -626,8 +637,10 @@ skip_disk:
/** /**
* Perform "real" commit * Perform "real" commit
*/ */
Uint32 disk = regOperPtr.p->m_commit_disk_callback_page;
set_change_mask_info(&req_struct, regOperPtr.p); set_change_mask_info(&req_struct, regOperPtr.p);
checkDetachedTriggers(&req_struct, regOperPtr.p, regTabPtr.p); checkDetachedTriggers(&req_struct, regOperPtr.p, regTabPtr.p,
disk != RNIL);
if(regOperPtr.p->op_struct.op_type != ZDELETE) if(regOperPtr.p->op_struct.op_type != ZDELETE)
{ {
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "AttributeOffset.hpp" #include "AttributeOffset.hpp"
#include <AttributeHeader.hpp> #include <AttributeHeader.hpp>
#include <Interpreter.hpp> #include <Interpreter.hpp>
#include <signaldata/TupCommit.hpp>
#include <signaldata/TupKey.hpp> #include <signaldata/TupKey.hpp>
#include <signaldata/AttrInfo.hpp> #include <signaldata/AttrInfo.hpp>
#include <NdbSqlUtil.hpp> #include <NdbSqlUtil.hpp>
......
...@@ -457,7 +457,8 @@ void Dbtup::checkDeferredTriggers(Signal* signal, ...@@ -457,7 +457,8 @@ void Dbtup::checkDeferredTriggers(Signal* signal,
/* ---------------------------------------------------------------- */ /* ---------------------------------------------------------------- */
void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct,
Operationrec* regOperPtr, Operationrec* regOperPtr,
Tablerec* regTablePtr) Tablerec* regTablePtr,
bool disk)
{ {
Uint32 save_type = regOperPtr->op_struct.op_type; Uint32 save_type = regOperPtr->op_struct.op_type;
Tuple_header *save_ptr = req_struct->m_tuple_ptr; Tuple_header *save_ptr = req_struct->m_tuple_ptr;
...@@ -503,7 +504,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, ...@@ -503,7 +504,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct,
// If any fired immediate insert trigger then fetch after tuple // If any fired immediate insert trigger then fetch after tuple
fireDetachedTriggers(req_struct, fireDetachedTriggers(req_struct,
regTablePtr->subscriptionInsertTriggers, regTablePtr->subscriptionInsertTriggers,
regOperPtr); regOperPtr, disk);
break; break;
case(ZDELETE): case(ZDELETE):
jam(); jam();
...@@ -517,7 +518,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, ...@@ -517,7 +518,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct,
// FIRETRIGORD with the before tuple // FIRETRIGORD with the before tuple
fireDetachedTriggers(req_struct, fireDetachedTriggers(req_struct,
regTablePtr->subscriptionDeleteTriggers, regTablePtr->subscriptionDeleteTriggers,
regOperPtr); regOperPtr, disk);
break; break;
case(ZUPDATE): case(ZUPDATE):
jam(); jam();
...@@ -531,7 +532,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct, ...@@ -531,7 +532,7 @@ void Dbtup::checkDetachedTriggers(KeyReqStruct *req_struct,
// and send two FIRETRIGORD one with before tuple and one with after tuple // and send two FIRETRIGORD one with before tuple and one with after tuple
fireDetachedTriggers(req_struct, fireDetachedTriggers(req_struct,
regTablePtr->subscriptionUpdateTriggers, regTablePtr->subscriptionUpdateTriggers,
regOperPtr); regOperPtr, disk);
break; break;
default: default:
ndbrequire(false); ndbrequire(false);
...@@ -589,7 +590,8 @@ Dbtup::fireDeferredTriggers(Signal* signal, ...@@ -589,7 +590,8 @@ Dbtup::fireDeferredTriggers(Signal* signal,
void void
Dbtup::fireDetachedTriggers(KeyReqStruct *req_struct, Dbtup::fireDetachedTriggers(KeyReqStruct *req_struct,
DLList<TupTriggerData>& triggerList, DLList<TupTriggerData>& triggerList,
Operationrec* const regOperPtr) Operationrec* const regOperPtr,
bool disk)
{ {
TriggerPtr trigPtr; TriggerPtr trigPtr;
...@@ -610,7 +612,8 @@ Dbtup::fireDetachedTriggers(KeyReqStruct *req_struct, ...@@ -610,7 +612,8 @@ Dbtup::fireDetachedTriggers(KeyReqStruct *req_struct,
jam(); jam();
executeTrigger(req_struct, executeTrigger(req_struct,
trigPtr.p, trigPtr.p,
regOperPtr); regOperPtr,
disk);
} }
triggerList.next(trigPtr); triggerList.next(trigPtr);
} }
...@@ -634,7 +637,8 @@ void Dbtup::executeTriggers(KeyReqStruct *req_struct, ...@@ -634,7 +637,8 @@ void Dbtup::executeTriggers(KeyReqStruct *req_struct,
void Dbtup::executeTrigger(KeyReqStruct *req_struct, void Dbtup::executeTrigger(KeyReqStruct *req_struct,
TupTriggerData* const trigPtr, TupTriggerData* const trigPtr,
Operationrec* const regOperPtr) Operationrec* const regOperPtr,
bool disk)
{ {
/** /**
* The block below does not work together with GREP. * The block below does not work together with GREP.
...@@ -701,7 +705,8 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct, ...@@ -701,7 +705,8 @@ void Dbtup::executeTrigger(KeyReqStruct *req_struct,
afterBuffer, afterBuffer,
noAfterWords, noAfterWords,
beforeBuffer, beforeBuffer,
noBeforeWords)) { noBeforeWords,
disk)) {
jam(); jam();
return; return;
} }
...@@ -804,9 +809,9 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, ...@@ -804,9 +809,9 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr,
Uint32* const afterBuffer, Uint32* const afterBuffer,
Uint32& noAfterWords, Uint32& noAfterWords,
Uint32* const beforeBuffer, Uint32* const beforeBuffer,
Uint32& noBeforeWords) Uint32& noBeforeWords,
bool disk)
{ {
//XXX this will not work with varsize attributes...
noAfterWords = 0; noAfterWords = 0;
noBeforeWords = 0; noBeforeWords = 0;
Uint32 readBuffer[MAX_ATTRIBUTES_IN_TABLE]; Uint32 readBuffer[MAX_ATTRIBUTES_IN_TABLE];
...@@ -839,8 +844,8 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, ...@@ -839,8 +844,8 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr,
c_undo_buffer.get_ptr(&req_struct->prevOpPtr.p->m_copy_tuple_location); c_undo_buffer.get_ptr(&req_struct->prevOpPtr.p->m_copy_tuple_location);
} }
if (regTabPtr->need_expand()) if (regTabPtr->need_expand(disk))
prepare_read(req_struct, regTabPtr, true); prepare_read(req_struct, regTabPtr, disk);
int ret = readAttributes(req_struct, int ret = readAttributes(req_struct,
&tableDescriptor[regTabPtr->readKeyArray].tabDescr, &tableDescriptor[regTabPtr->readKeyArray].tabDescr,
...@@ -935,8 +940,8 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr, ...@@ -935,8 +940,8 @@ bool Dbtup::readTriggerInfo(TupTriggerData* const trigPtr,
req_struct->m_tuple_ptr= (Tuple_header*)ptr; req_struct->m_tuple_ptr= (Tuple_header*)ptr;
} }
if (regTabPtr->need_expand()) // no disk if (regTabPtr->need_expand(disk))
prepare_read(req_struct, regTabPtr, true); prepare_read(req_struct, regTabPtr, disk);
int ret = readAttributes(req_struct, int ret = readAttributes(req_struct,
&readBuffer[0], &readBuffer[0],
......
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