Commit 4b2cde28 authored by unknown's avatar unknown

ndb - bug#14935 fix


storage/ndb/src/kernel/blocks/ERROR_codes.txt:
  if TUX update fails, need to abort op on tuple (5.1 specific)
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  if TUX update fails, need to abort op on tuple (5.1 specific)
storage/ndb/src/kernel/blocks/dbtup/DbtupAbort.cpp:
  if TUX update fails, need to abort op on tuple (5.1 specific)
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  if TUX update fails, need to abort op on tuple (5.1 specific)
storage/ndb/src/kernel/blocks/dbtup/DbtupTrigger.cpp:
  if TUX update fails, need to abort op on tuple (5.1 specific)
parent 9038b72c
......@@ -2,7 +2,7 @@ Next QMGR 1
Next NDBCNTR 1000
Next NDBFS 2000
Next DBACC 3002
Next DBTUP 4013
Next DBTUP 4024
Next DBLQH 5043
Next DBDICT 6007
Next DBDIH 7177
......@@ -484,3 +484,6 @@ Dbtup:
4019 - handleInsert - Alloc rowid error
4020 - handleInsert - Size change error
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:
//------------------------------------------------------------------
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.
......
......@@ -62,6 +62,11 @@ void Dbtup::freeAttrinbufrec(Uint32 anAttrBuf)
* Abort abort this operation and all after (nextActiveOp's)
*/
void Dbtup::execTUP_ABORTREQ(Signal* signal)
{
do_tup_abortreq(signal, 0);
}
void Dbtup::do_tup_abortreq(Signal* signal, Uint32 flags)
{
OperationrecPtr regOperPtr;
FragrecordPtr regFragPtr;
......@@ -91,7 +96,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
if (get_tuple_state(regOperPtr.p) == TUPLE_PREPARED)
{
ljam();
if (!regTabPtr.p->tuxCustomTriggers.isEmpty())
if (!regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0)
executeTuxAbortTriggers(signal,
regOperPtr.p,
regFragPtr.p,
......@@ -103,7 +109,8 @@ void Dbtup::execTUP_ABORTREQ(Signal* signal)
ljam();
c_operation_pool.getPtr(loopOpPtr);
if (get_tuple_state(loopOpPtr.p) != TUPLE_ALREADY_ABORTED &&
!regTabPtr.p->tuxCustomTriggers.isEmpty()) {
!regTabPtr.p->tuxCustomTriggers.isEmpty() &&
(flags & 0x1) == 0) {
ljam();
executeTuxAbortTriggers(signal,
loopOpPtr.p,
......
......@@ -747,6 +747,12 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regFragPtr,
regTabPtr) != 0) {
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);
return;
}
......@@ -775,6 +781,11 @@ void Dbtup::execTUPKEYREQ(Signal* signal)
regFragPtr,
regTabPtr) != 0) {
jam();
/*
* see insert case
*/
signal->theData[0] = operPtr.i;
do_tup_abortreq(signal, 0x1);
tupkeyErrorLab(signal);
return;
}
......
......@@ -1111,6 +1111,12 @@ Dbtup::addTuxEntries(Signal* signal,
Operationrec* regOperPtr,
Tablerec* regTabPtr)
{
if (ERROR_INSERTED(4022)) {
ljam();
CLEAR_ERROR_INSERT_VALUE;
terrorCode = 9999;
return -1;
}
TuxMaintReq* const req = (TuxMaintReq*)signal->getDataPtrSend();
const DLList<TupTriggerData>& triggerList = regTabPtr->tuxCustomTriggers;
TriggerPtr triggerPtr;
......@@ -1120,6 +1126,14 @@ Dbtup::addTuxEntries(Signal* signal,
ljam();
req->indexId = triggerPtr.p->indexId;
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,
signal, TuxMaintReq::SignalLength);
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