19 #include <signaldata/TcKeyReq.hpp>
39 theFirstATTRINFO(NULL),
40 theCurrentATTRINFO(NULL),
41 theTotalCurrAI_Len(0),
51 theFirstSubroutine(NULL),
52 theLastSubroutine(NULL),
54 theNoOfSubroutines(0),
59 theTotalNrOfKeyWordInSignal(8),
62 theOperationType(NotDefined),
64 theMagicNumber(0xFE11D0),
66 m_tcReqGSN(GSN_TCKEYREQ),
67 m_keyInfoGSN(GSN_KEYINFO),
68 m_attrInfoGSN(GSN_ATTRINFO),
71 m_noErrorPropagation(false),
73 m_blob_lock_upgraded(false)
75 theReceiver.init(NdbReceiver::NDB_OPERATION,
false,
this);
84 NdbOperation::~NdbOperation( )
94 NdbOperation::setErrorCode(
int anErrorCode)
const
100 pnonConstThis->theError.
code = anErrorCode;
101 theNdbCon->theErrorLine = theErrorLine;
102 theNdbCon->theErrorOperation = pnonConstThis;
104 theNdbCon->setOperationErrorCode(anErrorCode);
114 NdbOperation::setErrorCodeAbort(
int anErrorCode)
const
120 pnonConstThis->theError.
code = anErrorCode;
121 theNdbCon->theErrorLine = theErrorLine;
122 theNdbCon->theErrorOperation = pnonConstThis;
124 theNdbCon->setOperationErrorCodeAbort(anErrorCode);
142 m_currentTable = m_accessTable = tab;
144 theNdbCon = myConnection;
145 for (Uint32
i=0;
i<NDB_MAX_NO_OF_ATTRIBUTES_IN_KEY;
i++)
146 for (
int j=0; j<3; j++)
147 theTupleKeyDefined[
i][j] = 0;
149 theFirstATTRINFO = NULL;
150 theCurrentATTRINFO = NULL;
151 theLastKEYINFO = NULL;
157 theTotalCurrAI_Len = 0;
158 theAI_LenInCurrAI = 0;
159 theStartIndicator = 0;
160 theCommitIndicator = 0;
161 theSimpleIndicator = 0;
162 theDirtyIndicator = 0;
163 theInterpretIndicator = 0;
164 theDistrKeyIndicator_ = 0;
166 theTotalNrOfKeyWordInSignal = 8;
167 theMagicNumber = 0xABCDEF01;
168 m_attribute_record= NULL;
171 m_noErrorPropagation =
false;
173 m_flags |= OF_NO_DISK;
174 m_interpreted_code = NULL;
175 m_extraSetValues = NULL;
176 m_numExtraSetValues = 0;
178 tSignal = theNdb->getSignal();
185 theTCREQ->setSignal(m_tcReqGSN, refToBlock(theNdbCon->m_tcRef));
187 theAI_LenInCurrAI = 20;
189 tcKeyReq->scanInfo = 0;
190 theKEYINFOptr = &tcKeyReq->keyInfo[0];
191 theATTRINFOptr = &tcKeyReq->attrInfo[0];
192 if (theReceiver.init(NdbReceiver::NDB_OPERATION, useRec,
this))
199 if (theNdb->theImpl->get_ndbapi_config_parameters().m_default_queue_option)
200 m_flags |= OF_QUEUEABLE;
212 NdbOperation::release()
218 postExecuteRelease();
221 while (tBlob != NULL)
224 tBlob = tBlob->theNext;
225 theNdb->releaseNdbBlob(tSaveBlob);
228 theReceiver.release();
230 theLockHandle = NULL;
231 m_blob_lock_upgraded =
false;
235 NdbOperation::postExecuteRelease()
248 tSignal = theRequest;
249 while (tSignal != NULL)
251 tSaveSignal = tSignal;
252 tSignal = tSignal->next();
253 theNdb->releaseSignal(tSaveSignal);
256 theLastKEYINFO = NULL;
261 if (theFirstATTRINFO)
263 theNdb->releaseSignals(1, theFirstATTRINFO, theCurrentATTRINFO);
266 tSignal = theFirstATTRINFO;
267 while (tSignal != NULL)
269 tSaveSignal = tSignal;
270 tSignal = tSignal->next();
271 theNdb->releaseSignal(tSaveSignal);
274 theFirstATTRINFO = NULL;
275 theCurrentATTRINFO = NULL;
277 if (theInterpretIndicator == 1)
279 tBranch = theFirstBranch;
280 while (tBranch != NULL)
282 tSaveBranch = tBranch;
283 tBranch = tBranch->theNext;
284 theNdb->releaseNdbBranch(tSaveBranch);
286 tLabel = theFirstLabel;
287 while (tLabel != NULL)
290 tLabel = tLabel->theNext;
291 theNdb->releaseNdbLabel(tSaveLabel);
293 tCall = theFirstCall;
294 while (tCall != NULL)
297 tCall = tCall->theNext;
298 theNdb->releaseNdbCall(tSaveCall);
300 tSubroutine = theFirstSubroutine;
301 while (tSubroutine != NULL)
303 tSaveSubroutine = tSubroutine;
304 tSubroutine = tSubroutine->theNext;
305 theNdb->releaseNdbSubroutine(tSaveSubroutine);
313 return getValue_impl(m_currentTable->getColumn(anAttrName), aValue);
319 return getValue_impl(m_currentTable->getColumn(anAttrId), aValue);
325 if (theStatus != UseNdbRecord)
326 return getValue_impl(&NdbColumnImpl::getImpl(*col), aValue);
328 setErrorCodeAbort(4508);
336 const NdbColumnImpl* col = m_accessTable->getColumn(anAttrName);
344 return equal_impl(col, aValuePassed);
351 const NdbColumnImpl* col = m_accessTable->getColumn(anAttrId);
359 return equal_impl(col, aValuePassed);
366 const NdbColumnImpl* col = m_currentTable->getColumn(anAttrName);
382 const NdbColumnImpl* col = m_currentTable->getColumn(anAttrId);
400 const NdbColumnImpl* col = m_currentTable->getColumn(anAttrName);
418 const NdbColumnImpl* col = m_currentTable->getColumn(anAttrId);
433 const NdbColumnImpl* col = m_currentTable->getColumn(anAttrName);
448 const NdbColumnImpl* col = m_currentTable->getColumn(anAttrId);
464 return incValue(m_currentTable->getColumn(anAttrName), aValue);
470 return incValue(m_currentTable->getColumn(anAttrName), aValue);
476 return incValue(m_currentTable->getColumn(anAttrId), aValue);
482 return incValue(m_currentTable->getColumn(anAttrId), aValue);
488 return subValue(m_currentTable->getColumn(anAttrName), aValue);
494 return subValue(m_currentTable->getColumn(anAttrName), aValue);
500 return subValue(m_currentTable->getColumn(anAttrId), aValue);
506 return subValue(m_currentTable->getColumn(anAttrId), aValue);
512 return read_attr(m_currentTable->getColumn(anAttrName), RegDest);
518 return read_attr(m_currentTable->getColumn(anAttrId), RegDest);
524 return write_attr(m_currentTable->getColumn(anAttrName), RegDest);
530 return write_attr(m_currentTable->getColumn(anAttrId), RegDest);
536 return m_currentTable->m_externalName.
c_str();
542 return m_currentTable;
552 NdbOperation::getLockHandleImpl()
554 assert(! theLockHandle);
556 if (unlikely(theNdb->getMinDbNodeVersion() <
557 NDBD_UNLOCK_OP_SUPPORTED))
569 theLockHandle = theNdbCon->getLockHandle();
579 assert(theLockHandle->m_state == NdbLockHandle::ALLOCATED);
580 assert(! theLockHandle->isLockRefValid());
592 NdbOperation::getLockHandle()
594 if (likely (! m_blob_lock_upgraded))
596 if (theLockHandle == NULL)
598 int rc = getLockHandleImpl();
601 return theLockHandle;
609 return theLockHandle;
622 NdbOperation::getLockHandle()
const
625 return theLockHandle;