ndb - bug#14935 - post-review

parent 15783e44
......@@ -254,6 +254,8 @@ inline const Uint32* ALIGN_WORD(const void* ptr)
#define ZSTORED_PROCEDURE_FREE 0xffff
#define ZMIN_PAGE_LIMIT_TUP_COMMITREQ 2
#define ZSKIP_TUX_TRIGGERS 0x1 // flag for TUP_ABORTREQ
#endif
class Dbtup: public SimulatedBlock {
......@@ -2155,8 +2157,6 @@ private:
//------------------------------------------------------------------
//------------------------------------------------------------------
void tupkeyErrorLab(Signal* signal);
// need flag to skip TUX indexes
void do_tup_abortreq(Signal*, Uint32 flags);
//------------------------------------------------------------------
......
......@@ -63,6 +63,7 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf)
*/
void Dbtup::execTUP_ABORTREQ(Signal* signal)
{
ljamEntry();
do_tup_abortreq(signal, 0);
}
......@@ -72,7 +73,6 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
FragrecordPtr regFragPtr;
TablerecPtr regTabPtr;
ljamEntry();
regOperPtr.i = signal->theData[0];
c_operation_pool.getPtr(regOperPtr);
TransState trans_state= get_trans_state(regOperPtr.p);
......@@ -97,7 +97,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
{
ljam();
if (!regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0)
(flags & ZSKIP_TUX_TRIGGERS) == 0)
executeTuxAbortTriggers(signal,
regOperPtr.p,
regFragPtr.p,
......@@ -110,7 +110,7 @@ void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
c_operation_pool.getPtr(loopOpPtr);
if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED &&
!regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0) {
(flags & ZSKIP_TUX_TRIGGERS) == 0) {
ljam();
executeTuxAbortTriggers(signal,
loopOpPtr.p,
......
......@@ -748,11 +748,19 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regTabPtr) != 0) {
jam();
/*
* undo the change before tupkeyErrorLab resets the op
* assume no timeslicing can occur even with diskdata
* TUP insert succeeded but add of TUX entries failed. All
* TUX changes have been rolled back at this point.
*
* We will abort via tupkeyErrorLab() as usual. This routine
* however resets the operation to ZREAD. The TUP_ABORTREQ
* arriving later cannot then undo the insert.
*
* Therefore we call TUP_ABORTREQ already now. Diskdata etc
* should be in memory and timeslicing cannot occur. We must
* skip TUX abort triggers since TUX is already aborted.
*/
signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1);
do_tup_abortreq(signal, ZSKIP_TUX_TRIGGERS);
tupkeyErrorLab(signal);
return;
}
......@@ -782,10 +790,10 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regTabPtr) != 0) {
jam();
/*
* see insert case
* See insert case.
*/
signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1);
do_tup_abortreq(signal, ZSKIP_TUX_TRIGGERS);
tupkeyErrorLab(signal);
return;
}
......
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