mirror of
https://github.com/MariaDB/server.git
synced 2025-01-17 12:32:27 +01:00
ndb - bug#28724 for blobs, op flag to not set error on trans (fix, recommit)
storage/ndb/include/ndbapi/NdbOperation.hpp: add NdbOperation option m_noErrorPropagation. If AO_IgnoreError and it are set then operation error does not set error code on transaction. Private, and used by NdbBlob.cpp only. storage/ndb/src/ndbapi/NdbBlob.cpp: add NdbOperation option m_noErrorPropagation. If AO_IgnoreError and it are set then operation error does not set error code on transaction. Private, and used by NdbBlob.cpp only. storage/ndb/src/ndbapi/NdbOperation.cpp: add NdbOperation option m_noErrorPropagation. If AO_IgnoreError and it are set then operation error does not set error code on transaction. Private, and used by NdbBlob.cpp only.
This commit is contained in:
parent
ab4c64b49d
commit
9e692d86f8
3 changed files with 16 additions and 2 deletions
|
@ -1042,6 +1042,13 @@ protected:
|
||||||
*/
|
*/
|
||||||
Int8 m_abortOption;
|
Int8 m_abortOption;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* For blob impl, option to not propagate error to trans level.
|
||||||
|
* Could be AO_IgnoreError variant if we want it public.
|
||||||
|
* Ignored unless AO_IgnoreError is also set.
|
||||||
|
*/
|
||||||
|
Int8 m_noErrorPropagation;
|
||||||
|
|
||||||
friend struct Ndb_free_list_t<NdbOperation>;
|
friend struct Ndb_free_list_t<NdbOperation>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1261,6 +1261,7 @@ NdbBlob::deletePartsUnknown(Uint32 part)
|
||||||
DBUG_RETURN(-1);
|
DBUG_RETURN(-1);
|
||||||
}
|
}
|
||||||
tOp->m_abortOption= NdbOperation::AO_IgnoreError;
|
tOp->m_abortOption= NdbOperation::AO_IgnoreError;
|
||||||
|
tOp->m_noErrorPropagation = true;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
DBUG_PRINT("info", ("bat=%u", bat));
|
DBUG_PRINT("info", ("bat=%u", bat));
|
||||||
|
@ -1597,6 +1598,7 @@ NdbBlob::preExecute(NdbTransaction::ExecType anExecType, bool& batch)
|
||||||
}
|
}
|
||||||
if (isWriteOp()) {
|
if (isWriteOp()) {
|
||||||
tOp->m_abortOption = NdbOperation::AO_IgnoreError;
|
tOp->m_abortOption = NdbOperation::AO_IgnoreError;
|
||||||
|
tOp->m_noErrorPropagation = true;
|
||||||
}
|
}
|
||||||
theHeadInlineReadOp = tOp;
|
theHeadInlineReadOp = tOp;
|
||||||
// execute immediately
|
// execute immediately
|
||||||
|
@ -1643,6 +1645,7 @@ NdbBlob::preExecute(NdbTransaction::ExecType anExecType, bool& batch)
|
||||||
}
|
}
|
||||||
if (isWriteOp()) {
|
if (isWriteOp()) {
|
||||||
tOp->m_abortOption = NdbOperation::AO_IgnoreError;
|
tOp->m_abortOption = NdbOperation::AO_IgnoreError;
|
||||||
|
tOp->m_noErrorPropagation = true;
|
||||||
}
|
}
|
||||||
theHeadInlineReadOp = tOp;
|
theHeadInlineReadOp = tOp;
|
||||||
// execute immediately
|
// execute immediately
|
||||||
|
|
|
@ -76,7 +76,8 @@ NdbOperation::NdbOperation(Ndb* aNdb, NdbOperation::Type aType) :
|
||||||
m_keyInfoGSN(GSN_KEYINFO),
|
m_keyInfoGSN(GSN_KEYINFO),
|
||||||
m_attrInfoGSN(GSN_ATTRINFO),
|
m_attrInfoGSN(GSN_ATTRINFO),
|
||||||
theBlobList(NULL),
|
theBlobList(NULL),
|
||||||
m_abortOption(-1)
|
m_abortOption(-1),
|
||||||
|
m_noErrorPropagation(false)
|
||||||
{
|
{
|
||||||
theReceiver.init(NdbReceiver::NDB_OPERATION, this);
|
theReceiver.init(NdbReceiver::NDB_OPERATION, this);
|
||||||
theError.code = 0;
|
theError.code = 0;
|
||||||
|
@ -101,7 +102,8 @@ NdbOperation::setErrorCode(int anErrorCode)
|
||||||
theError.code = anErrorCode;
|
theError.code = anErrorCode;
|
||||||
theNdbCon->theErrorLine = theErrorLine;
|
theNdbCon->theErrorLine = theErrorLine;
|
||||||
theNdbCon->theErrorOperation = this;
|
theNdbCon->theErrorOperation = this;
|
||||||
theNdbCon->setOperationErrorCode(anErrorCode);
|
if (!(m_abortOption == AO_IgnoreError && m_noErrorPropagation))
|
||||||
|
theNdbCon->setOperationErrorCode(anErrorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -116,6 +118,7 @@ NdbOperation::setErrorCodeAbort(int anErrorCode)
|
||||||
theError.code = anErrorCode;
|
theError.code = anErrorCode;
|
||||||
theNdbCon->theErrorLine = theErrorLine;
|
theNdbCon->theErrorLine = theErrorLine;
|
||||||
theNdbCon->theErrorOperation = this;
|
theNdbCon->theErrorOperation = this;
|
||||||
|
// ignore m_noErrorPropagation
|
||||||
theNdbCon->setOperationErrorCodeAbort(anErrorCode);
|
theNdbCon->setOperationErrorCodeAbort(anErrorCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,6 +164,7 @@ NdbOperation::init(const NdbTableImpl* tab, NdbTransaction* myConnection){
|
||||||
theMagicNumber = 0xABCDEF01;
|
theMagicNumber = 0xABCDEF01;
|
||||||
theBlobList = NULL;
|
theBlobList = NULL;
|
||||||
m_abortOption = -1;
|
m_abortOption = -1;
|
||||||
|
m_noErrorPropagation = false;
|
||||||
m_no_disk_flag = 1;
|
m_no_disk_flag = 1;
|
||||||
|
|
||||||
tSignal = theNdb->getSignal();
|
tSignal = theNdb->getSignal();
|
||||||
|
|
Loading…
Reference in a new issue