ndb - bug#14935 fix

parent 3d442310
...@@ -2,7 +2,7 @@ Next QMGR 1 ...@@ -2,7 +2,7 @@ Next QMGR 1
Next NDBCNTR 1000 Next NDBCNTR 1000
Next NDBFS 2000 Next NDBFS 2000
Next DBACC 3002 Next DBACC 3002
Next DBTUP 4013 Next DBTUP 4024
Next DBLQH 5043 Next DBLQH 5043
Next DBDICT 6007 Next DBDICT 6007
Next DBDIH 7177 Next DBDIH 7177
...@@ -484,3 +484,6 @@ Dbtup: ...@@ -484,3 +484,6 @@ Dbtup:
4019 - handleInsert - Alloc rowid error 4019 - handleInsert - Alloc rowid error
4020 - handleInsert - Size change error 4020 - handleInsert - Size change error
4021 - handleInsert - Out of disk space 4021 - handleInsert - Out of disk space
4022 - addTuxEntries - fail before add of first entry
4023 - addTuxEntries - fail add of last entry (the entry for last index)
...@@ -2156,6 +2156,9 @@ private: ...@@ -2156,6 +2156,9 @@ private:
//------------------------------------------------------------------ //------------------------------------------------------------------
void tupkeyErrorLab(Signal* signal); void tupkeyErrorLab(Signal* signal);
// need flag to skip TUX indexes
void do_tup_abortreq(Signal*, Uint32 flags);
//------------------------------------------------------------------ //------------------------------------------------------------------
//------------------------------------------------------------------ //------------------------------------------------------------------
// Methods to handle execution of TUP_COMMITREQ + TUP_ABORTREQ. // Methods to handle execution of TUP_COMMITREQ + TUP_ABORTREQ.
......
...@@ -62,6 +62,11 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf) ...@@ -62,6 +62,11 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf)
* Abort abort this operation and all after (nextActiveOp's) * Abort abort this operation and all after (nextActiveOp's)
*/ */
void Dbtup::execTUP_ABORTREQ(Signal* signal) void Dbtup::execTUP_ABORTREQ(Signal* signal)
{
do_tup_abortreq(signal, 0);
}
void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
{ {
OperationrecPtr regOperPtr; OperationrecPtr regOperPtr;
FragrecordPtr regFragPtr; FragrecordPtr regFragPtr;
...@@ -91,7 +96,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal) ...@@ -91,7 +96,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
if (get_tuple_state(regOperPtr.p) == TUPLE_PREPARED) if (get_tuple_state(regOperPtr.p) == TUPLE_PREPARED)
{ {
ljam(); ljam();
if (!regTabPtr.p->tuxCustomTriggers.isEmpty()) if (!regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0)
executeTuxAbortTriggers(signal, executeTuxAbortTriggers(signal,
regOperPtr.p, regOperPtr.p,
regFragPtr.p, regFragPtr.p,
...@@ -103,7 +109,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal) ...@@ -103,7 +109,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
ljam(); ljam();
c_operation_pool.getPtr(loopOpPtr); c_operation_pool.getPtr(loopOpPtr);
if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED && if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED &&
!regTabPtr.p->tuxCustomTriggers.isEmpty()) { !regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0) {
ljam(); ljam();
executeTuxAbortTriggers(signal, executeTuxAbortTriggers(signal,
loopOpPtr.p, loopOpPtr.p,
......
...@@ -747,6 +747,12 @@ void Dbtup::execTUPKEYREQ(Signal* signal) ...@@ -747,6 +747,12 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regFragPtr, regFragPtr,
regTabPtr) != 0) { regTabPtr) != 0) {
jam(); jam();
/*
* undo the change before tupkeyErrorLab resets the op
* assume no timeslicing can occur even with diskdata
*/
signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1);
tupkeyErrorLab(signal); tupkeyErrorLab(signal);
return; return;
} }
...@@ -775,6 +781,11 @@ void Dbtup::execTUPKEYREQ(Signal* signal) ...@@ -775,6 +781,11 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regFragPtr, regFragPtr,
regTabPtr) != 0) { regTabPtr) != 0) {
jam(); jam();
/*
* see insert case
*/
signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1);
tupkeyErrorLab(signal); tupkeyErrorLab(signal);
return; return;
} }
......
...@@ -1111,6 +1111,12 @@ Dbtup::addTuxEntries(Signal* signal, ...@@ -1111,6 +1111,12 @@ Dbtup::addTuxEntries(Signal* signal,
Operationrec* regOperPtr, Operationrec* regOperPtr,
Tablerec* regTabPtr) Tablerec* regTabPtr)
{ {
if (ERROR_INSERTED(4022)) {
ljam();
CLEAR_ERROR_INSERT_VALUE;
terrorCode = 9999;
return -1;
}
TuxMaintReq* const req = (TuxMaintReq*)signal->getDataPtrSend(); TuxMaintReq* const req = (TuxMaintReq*)signal->getDataPtrSend();
const DLList<TupTriggerData>& triggerList = regTabPtr->tuxCustomTriggers; const DLList<TupTriggerData>& triggerList = regTabPtr->tuxCustomTriggers;
TriggerPtr triggerPtr; TriggerPtr triggerPtr;
...@@ -1120,6 +1126,14 @@ Dbtup::addTuxEntries(Signal* signal, ...@@ -1120,6 +1126,14 @@ Dbtup::addTuxEntries(Signal* signal,
ljam(); ljam();
req->indexId = triggerPtr.p->indexId; req->indexId = triggerPtr.p->indexId;
req->errorCode = RNIL; req->errorCode = RNIL;
if (ERROR_INSERTED(4023) &&
! triggerList.hasNext(triggerPtr)) {
ljam();
CLEAR_ERROR_INSERT_VALUE;
terrorCode = 9999;
failPtrI = triggerPtr.i;
goto fail;
}
EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ, EXECUTE_DIRECT(DBTUX, GSN_TUX_MAINT_REQ,
signal, TuxMaintReq::SignalLength); signal, TuxMaintReq::SignalLength);
ljamEntry(); ljamEntry();
......
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