Commit 596d010a authored by joreland@mysql.com's avatar joreland@mysql.com

fix for testTransactions -n InsertInsert

- Add sequence to the initial trans id so that create/drop ndb object
  don't generate same transid
parent 8db262f0
...@@ -203,7 +203,7 @@ NdbConnection::restart(){ ...@@ -203,7 +203,7 @@ NdbConnection::restart(){
releaseCompletedOperations(); releaseCompletedOperations();
Uint64 tTransid = theNdb->theFirstTransId; Uint64 tTransid = theNdb->theFirstTransId;
theTransactionId = tTransid; theTransactionId = tTransid;
if((Uint32)tTransid == ((Uint32)~0)){ if ((tTransid & 0xFFFFFFFF) == 0xFFFFFFFF) {
theNdb->theFirstTransId = (tTransid >> 32) << 32; theNdb->theFirstTransId = (tTransid >> 32) << 32;
} else { } else {
theNdb->theFirstTransId = tTransid + 1; theNdb->theFirstTransId = tTransid + 1;
......
...@@ -97,6 +97,7 @@ Ndb::init(int aMaxNoOfTransactions) ...@@ -97,6 +97,7 @@ Ndb::init(int aMaxNoOfTransactions)
} }
theFirstTransId = ((Uint64)theNdbBlockNumber << 52)+((Uint64)theNode << 40); theFirstTransId = ((Uint64)theNdbBlockNumber << 52)+((Uint64)theNode << 40);
theFirstTransId += theFacade->m_open_count;
theFacade->unlock_mutex(); theFacade->unlock_mutex();
......
...@@ -529,6 +529,7 @@ TransporterFacade::TransporterFacade() : ...@@ -529,6 +529,7 @@ TransporterFacade::TransporterFacade() :
theClusterMgr = NULL; theClusterMgr = NULL;
theArbitMgr = NULL; theArbitMgr = NULL;
theStartNodeId = 1; theStartNodeId = 1;
m_open_count = 0;
} }
bool bool
...@@ -683,6 +684,7 @@ TransporterFacade::open(void* objRef, ...@@ -683,6 +684,7 @@ TransporterFacade::open(void* objRef,
ExecuteFunction fun, ExecuteFunction fun,
NodeStatusFunction statusFun) NodeStatusFunction statusFun)
{ {
m_open_count++;
return m_threads.open(objRef, fun, statusFun); return m_threads.open(objRef, fun, statusFun);
} }
......
...@@ -209,6 +209,8 @@ private: ...@@ -209,6 +209,8 @@ private:
} }
} m_threads; } m_threads;
Uint32 m_open_count;
/** /**
* execute function * execute function
*/ */
......
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