Commit 97c6ff7b authored by unknown's avatar unknown

ndb - wl#2972 injector cleanup accessed blob event ops via Ndb => crash


storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  hide blob event ops under main op
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
  hide blob event ops under main op
parent 567a31e3
...@@ -337,14 +337,16 @@ NdbEventOperationImpl::getBlobHandle(const NdbColumnImpl *tAttrInfo, int n) ...@@ -337,14 +337,16 @@ NdbEventOperationImpl::getBlobHandle(const NdbColumnImpl *tAttrInfo, int n)
break; break;
} }
tLastBlopOp = tBlobOp; tLastBlopOp = tBlobOp;
tBlobOp = tBlobOp->theNextBlobOp; tBlobOp = tBlobOp->m_next;
} }
DBUG_PRINT("info", ("%s op %s", tBlobOp ? " reuse" : " create", bename)); DBUG_PRINT("info", ("%s op %s", tBlobOp ? " reuse" : " create", bename));
// create blob event op if not found // create blob event op if not found
if (tBlobOp == NULL) { if (tBlobOp == NULL) {
NdbEventOperation* tmp = m_ndb->createEventOperation(bename); // to hide blob op it is linked under main op, not under m_ndb
NdbEventOperation* tmp =
m_ndb->theEventBuffer->createEventOperation(bename, m_error);
if (tmp == NULL) if (tmp == NULL)
DBUG_RETURN(NULL); DBUG_RETURN(NULL);
tBlobOp = &tmp->m_impl; tBlobOp = &tmp->m_impl;
...@@ -357,8 +359,8 @@ NdbEventOperationImpl::getBlobHandle(const NdbColumnImpl *tAttrInfo, int n) ...@@ -357,8 +359,8 @@ NdbEventOperationImpl::getBlobHandle(const NdbColumnImpl *tAttrInfo, int n)
if (tLastBlopOp == NULL) if (tLastBlopOp == NULL)
theBlobOpList = tBlobOp; theBlobOpList = tBlobOp;
else else
tLastBlopOp->theNextBlobOp = tBlobOp; tLastBlopOp->m_next = tBlobOp;
tBlobOp->theNextBlobOp = NULL; tBlobOp->m_next = NULL;
} }
} }
...@@ -484,7 +486,7 @@ NdbEventOperationImpl::execute_nolock() ...@@ -484,7 +486,7 @@ NdbEventOperationImpl::execute_nolock()
r = blob_op->execute_nolock(); r = blob_op->execute_nolock();
if (r != 0) if (r != 0)
break; break;
blob_op = blob_op->theNextBlobOp; blob_op = blob_op->m_next;
} }
} }
if (r == 0) if (r == 0)
...@@ -2017,12 +2019,15 @@ NdbEventBuffer::dropEventOperation(NdbEventOperation* tOp) ...@@ -2017,12 +2019,15 @@ NdbEventBuffer::dropEventOperation(NdbEventOperation* tOp)
m_dropped_ev_op->m_prev= op; m_dropped_ev_op->m_prev= op;
m_dropped_ev_op= op; m_dropped_ev_op= op;
// drop blob ops // stop blob event ops
while (op->theBlobOpList != NULL) if (op->theMainOp == NULL)
{ {
NdbEventOperationImpl* tBlobOp = op->theBlobOpList; NdbEventOperationImpl* tBlobOp = op->theBlobOpList;
op->theBlobOpList = op->theBlobOpList->theNextBlobOp; while (tBlobOp != NULL)
(void)m_ndb->dropEventOperation(tBlobOp); {
tBlobOp->stop();
tBlobOp = tBlobOp->m_next;
}
} }
// ToDo, take care of these to be deleted at the // ToDo, take care of these to be deleted at the
......
...@@ -223,11 +223,8 @@ public: ...@@ -223,11 +223,8 @@ public:
NdbRecAttr *theCurrentDataAttrs[2]; NdbRecAttr *theCurrentDataAttrs[2];
NdbBlob* theBlobList; NdbBlob* theBlobList;
union { NdbEventOperationImpl* theBlobOpList; // in main op, list of blob ops
NdbEventOperationImpl* theBlobOpList; NdbEventOperationImpl* theMainOp; // in blob op, the main op
NdbEventOperationImpl* theNextBlobOp;
};
NdbEventOperationImpl* theMainOp; // blob op pointer to main op
NdbEventOperation::State m_state; /* note connection to mi_type */ NdbEventOperation::State m_state; /* note connection to mi_type */
Uint32 mi_type; /* should be == 0 if m_state != EO_EXECUTING Uint32 mi_type; /* should be == 0 if m_state != EO_EXECUTING
......
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