ndb - bug#28276
Fix DeleteRead in multi-operation Dont use setup_read, as it will (correctly) find that tuple is deleted storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp: Fix multi-op DeleteRead storage/ndb/test/ndbapi/testBasic.cpp: Fix multi-op DeleteRead
This commit is contained in:
parent
764e010e8c
commit
a33d5e1755
@ -1491,6 +1491,7 @@ int Dbtup::handleDeleteReq(Signal* signal,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
memcpy(dst, org, regTabPtr->total_rec_size << 2);
|
memcpy(dst, org, regTabPtr->total_rec_size << 2);
|
||||||
|
req_struct->m_tuple_ptr = (Tuple_header*)dst;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1528,8 +1529,9 @@ int Dbtup::handleDeleteReq(Signal* signal,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setup_read(req_struct, regOperPtr, regFragPtr, regTabPtr, disk))
|
if (regTabPtr->need_expand(disk))
|
||||||
{
|
prepare_read(req_struct, regTabPtr, disk);
|
||||||
|
|
||||||
Uint32 RlogSize;
|
Uint32 RlogSize;
|
||||||
int ret= handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
|
int ret= handleReadReq(signal, regOperPtr, regTabPtr, req_struct);
|
||||||
if (ret == 0 && (RlogSize= req_struct->log_size))
|
if (ret == 0 && (RlogSize= req_struct->log_size))
|
||||||
@ -1538,7 +1540,6 @@ int Dbtup::handleDeleteReq(Signal* signal,
|
|||||||
sendLogAttrinfo(signal, RlogSize, regOperPtr);
|
sendLogAttrinfo(signal, RlogSize, regOperPtr);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
|
|
||||||
error:
|
error:
|
||||||
tupkeyErrorLab(signal);
|
tupkeyErrorLab(signal);
|
||||||
|
@ -1290,17 +1290,7 @@ runDeleteRead(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
NdbTransaction* pTrans = pNdb->startTransaction();
|
NdbTransaction* pTrans = pNdb->startTransaction();
|
||||||
NdbOperation* pOp = pTrans->getNdbOperation(tab->getName());
|
NdbOperation* pOp = pTrans->getNdbOperation(tab->getName());
|
||||||
pOp->deleteTuple();
|
pOp->deleteTuple();
|
||||||
for(a = 0; a<tab->getNoOfColumns(); a++)
|
tmp.equalForRow(pOp, loops);
|
||||||
{
|
|
||||||
if (tab->getColumn(a)->getPrimaryKey() == true)
|
|
||||||
{
|
|
||||||
if(tmp.equalForAttr(pOp, a, 0) != 0)
|
|
||||||
{
|
|
||||||
ERR(pTrans->getNdbError());
|
|
||||||
return NDBT_FAILED;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define attributes to read
|
// Define attributes to read
|
||||||
for(a = 0; a<tab->getNoOfColumns(); a++)
|
for(a = 0; a<tab->getNoOfColumns(); a++)
|
||||||
@ -1313,6 +1303,30 @@ runDeleteRead(NDBT_Context* ctx, NDBT_Step* step){
|
|||||||
|
|
||||||
pTrans->execute(Commit);
|
pTrans->execute(Commit);
|
||||||
pTrans->close();
|
pTrans->close();
|
||||||
|
|
||||||
|
pTrans = pNdb->startTransaction();
|
||||||
|
pOp = pTrans->getNdbOperation(tab->getName());
|
||||||
|
pOp->insertTuple();
|
||||||
|
tmp.setValues(pOp, loops, 0);
|
||||||
|
|
||||||
|
pOp = pTrans->getNdbOperation(tab->getName());
|
||||||
|
pOp->deleteTuple();
|
||||||
|
tmp.equalForRow(pOp, loops);
|
||||||
|
for(a = 0; a<tab->getNoOfColumns(); a++)
|
||||||
|
{
|
||||||
|
if((row.attributeStore(a) = pOp->getValue(tab->getColumn(a)->getName())) == 0)
|
||||||
|
{
|
||||||
|
ERR(pTrans->getNdbError());
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pTrans->execute(Commit) != 0)
|
||||||
|
{
|
||||||
|
ERR(pTrans->getNdbError());
|
||||||
|
return NDBT_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
|
pTrans->close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return NDBT_OK;
|
return NDBT_OK;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user