bug#21072 Duplicate key error in NDB references wrong key: Post-review fixes

parent 27c02506
......@@ -5162,7 +5162,6 @@ void Dbtc::execLQHKEYREF(Signal* signal)
TcIndexData* indexData = c_theIndexes.getPtr(currentIndexId);
indexId = indexData->indexId;
regApiPtr->errorData = indexId;
ndbout_c("LQHKEYREF, found index %u", indexId);
const Uint32 opType = regTcPtr->operation;
if (errCode == ZALREADYEXIST)
errCode = terrorCode = ZNOTUNIQUE;
......@@ -5246,7 +5245,6 @@ void Dbtc::execLQHKEYREF(Signal* signal)
jam();
regApiPtr->lqhkeyreqrec--; // Compensate for extra during read
tcKeyRef->connectPtr = indexOp;
ndbout_c("TCKEYREF, sending index %u", indexId);
tcKeyRef->errorData = indexId;
EXECUTE_DIRECT(DBTC, GSN_TCKEYREF, signal, TcKeyRef::SignalLength);
apiConnectptr.i = save;
......@@ -5254,7 +5252,6 @@ void Dbtc::execLQHKEYREF(Signal* signal)
} else {
jam();
tcKeyRef->connectPtr = clientData;
ndbout_c("TCKEYREF, sending index %u", indexId);
tcKeyRef->errorData = indexId;
sendSignal(regApiPtr->ndbapiBlockref,
GSN_TCKEYREF, signal, TcKeyRef::SignalLength, JBB);
......@@ -12234,7 +12231,7 @@ void Dbtc::execTRANSID_AI(Signal* signal)
tcIndxRef->transId[0] = regApiPtr->transid[0];
tcIndxRef->transId[1] = regApiPtr->transid[1];
tcIndxRef->errorCode = 4349;
// tcIndxRef->errorData = ??; Where to find indexId
tcIndxRef->errorData = regApiPtr->errorData;
sendSignal(regApiPtr->ndbapiBlockref, GSN_TCINDXREF, signal,
TcKeyRef::SignalLength, JBB);
return;
......@@ -13030,7 +13027,6 @@ void Dbtc::insertIntoIndexTable(Signal* signal,
}
regApiPtr->currSavePointId = currSavePointId;
ndbout_c("TCKEYREQ, saving index %u", indexData->indexId);
tcConnectptr.p->currentIndexId = indexData->indexId;
// *********** KEYINFO ***********
......
......@@ -1769,7 +1769,6 @@ transactions.
theError.code = aSignal->readData(4);// Override any previous errors
if (aSignal->getLength() == TcRollbackRep::SignalLength)
{
DBUG_PRINT("info", ("Found error data %u", aSignal->readData(5)));
// Signal may contain additional error data
theError.details = (char *) aSignal->readData(5);
}
......
......@@ -543,7 +543,6 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans)
uint error_data= (uint) err.details;
uint dupkey= MAX_KEY;
DBUG_PRINT("info", ("HA_ERR_FOUND_DUPP_KEY, index table %u", error_data));
for (uint i= 0; i < MAX_KEY; i++)
{
if (m_index[i].type == UNIQUE_INDEX ||
......@@ -555,7 +554,6 @@ int ha_ndbcluster::ndb_err(NdbTransaction *trans)
unique_index->getIndexTable() &&
(uint) unique_index->getIndexTable()->getTableId() == error_data)
{
DBUG_PRINT("info", ("Found violated key %u", i));
dupkey= i;
break;
}
......
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