Commit 1c0213eb authored by unknown's avatar unknown

added debug printouts in ndbapi

parent 8f9e1eb5
......@@ -329,7 +329,8 @@ Ndb::startTransaction(Uint32 aPriority, const char * keyData, Uint32 keyLen)
}//if
{
NdbConnection *trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit",("start trans= 0x%x", trans));
DBUG_PRINT("exit",("start trans: 0x%x transid: 0x%llx",
trans, trans->getTransactionId()));
DBUG_RETURN(trans);
}
} else {
......@@ -350,6 +351,8 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
{
DBUG_ENTER("Ndb::hupp");
DBUG_PRINT("enter", ("trans: 0x%x",pBuddyTrans));
Uint32 aPriority = 0;
if (pBuddyTrans == NULL){
DBUG_RETURN(startTransaction());
......@@ -372,6 +375,8 @@ Ndb::hupp(NdbConnection* pBuddyTrans)
}
pCon->setTransactionId(pBuddyTrans->getTransactionId());
pCon->setBuddyConPtr((Uint32)pBuddyTrans->getTC_ConnectPtr());
DBUG_PRINT("exit", ("hupp trans: 0x%x transid: 0x%llx",
pCon, pCon ? pCon->getTransactionId() : 0));
DBUG_RETURN(pCon);
} else {
DBUG_RETURN(NULL);
......@@ -408,7 +413,10 @@ Ndb::startTransactionDGroup(Uint32 aPriority, const char * keyData, int type)
fragmentId = getFragmentId(hashValue);
}//if
Uint32 nodeId = guessPrimaryNode(fragmentId);
return startTransactionLocal(aPriority, nodeId);
NdbConnection* trans= startTransactionLocal(aPriority, nodeId);
DBUG_PRINT("exit", ("start DGroup trans: 0x%x transid: 0x%llx",
trans, trans ? trans->getTransactionId() : 0));
return trans;
} else {
return NULL;
}//if
......@@ -455,7 +463,6 @@ Ndb::startTransactionLocal(Uint32 aPriority, Uint32 nodeId)
abort();
}
#endif
DBUG_PRINT("exit", ("transid= %lld", tConnection->getTransactionId()));
DBUG_RETURN(tConnection);
}//Ndb::startTransactionLocal()
......@@ -469,9 +476,6 @@ void
Ndb::closeTransaction(NdbConnection* aConnection)
{
DBUG_ENTER("Ndb::closeTransaction");
DBUG_PRINT("enter",("close trans= 0x%x, transid= %lld",
aConnection, aConnection->getTransactionId()));
NdbConnection* tCon;
NdbConnection* tPreviousCon;
......@@ -489,6 +493,12 @@ Ndb::closeTransaction(NdbConnection* aConnection)
tCon = theTransactionList;
DBUG_PRINT("info",("close trans: 0x%x transid: 0x%llx",
aConnection, aConnection->getTransactionId()));
DBUG_PRINT("info",("magic number: 0x%x TCConPtr: 0x%x theMyRef: 0x%x 0x%x",
aConnection->theMagicNumber, aConnection->theTCConPtr,
aConnection->theMyRef, getReference()));
if (aConnection == tCon) { // Remove the active connection object
theTransactionList = tCon->next(); // from the transaction list.
} else {
......
......@@ -1691,6 +1691,8 @@ NdbDictInterface::execALTER_TABLE_REF(NdbApiSignal * signal,
int
NdbDictionaryImpl::dropTable(const char * name)
{
DBUG_ENTER("NdbDictionaryImpl::dropTable");
DBUG_PRINT("enter",("name: %s", name));
NdbTableImpl * tab = getTable(name);
if(tab == 0){
return -1;
......@@ -1701,15 +1703,16 @@ NdbDictionaryImpl::dropTable(const char * name)
if (ret == INCOMPATIBLE_VERSION) {
const char * internalTableName = m_ndb.internalizeTableName(name);
DBUG_PRINT("info",("INCOMPATIBLE_VERSION internal_name: %s", internalTableName));
m_localHash.drop(internalTableName);
m_globalHash->lock();
m_globalHash->drop(tab);
m_globalHash->unlock();
return dropTable(name);
DBUG_RETURN(dropTable(name));
}
return ret;
DBUG_RETURN(ret);
}
int
......@@ -1763,6 +1766,7 @@ NdbDictionaryImpl::dropTable(NdbTableImpl & impl)
int
NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t)
{
DBUG_ENTER("NdbDictionaryImpl::dropBlobTables");
for (unsigned i = 0; i < t.m_columns.size(); i++) {
NdbColumnImpl & c = *t.m_columns[i];
if (! c.getBlobType() || c.getPartSize() == 0)
......@@ -1771,11 +1775,13 @@ NdbDictionaryImpl::dropBlobTables(NdbTableImpl & t)
NdbBlob::getBlobTableName(btname, &t, &c);
if (dropTable(btname) != 0) {
if (m_error.code != 709){
return -1;
DBUG_PRINT("exit",("error %u - exiting",m_error.code));
DBUG_RETURN(-1);
}
DBUG_PRINT("info",("error %u - continuing",m_error.code));
}
}
return 0;
DBUG_RETURN(0);
}
int
......
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