Commit 8db8ab33 authored by unknown's avatar unknown

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

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