Commit b689f487 authored by unknown's avatar unknown

Fix of a nasty bug, small but hard to find

Some small printout fixes


ndb/include/kernel/signaldata/ScanFrag.hpp:
  Mixed up Hexadecimal and decimal notation, cost me 5 hours of
  debugging to find, grrr..
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Fixed some declaration so that new bigger info fits in variables
ndb/test/ndbapi/testScanPerf.cpp:
  Fix for printing int's instead of Uint64 which for some reason
  caused problems on my Mac.
  Also print performance in each loop.
parent 9b3d5b9c
...@@ -321,7 +321,7 @@ KeyInfo20::getScanNo(Uint32 scanInfo){ ...@@ -321,7 +321,7 @@ KeyInfo20::getScanNo(Uint32 scanInfo){
inline inline
Uint32 Uint32
KeyInfo20::getScanOp(Uint32 scanInfo){ KeyInfo20::getScanOp(Uint32 scanInfo){
return (scanInfo >> 8) & 0x1023; return (scanInfo >> 8) & 0x3FF;
} }
#endif #endif
...@@ -927,17 +927,22 @@ public: ...@@ -927,17 +927,22 @@ public:
UintR distributionGroup; UintR distributionGroup;
UintR nextCacheRec; UintR nextCacheRec;
UintR distributionKeySize; UintR distributionKeySize;
Uint16 scanNode; Uint32 scanInfo;
unsigned scanTakeOverInd : 1;
unsigned scanInfo : 15; // 12 bits used currently
//--------------------------------------------------- //---------------------------------------------------
// Third and fourth 16 byte cache line in second 64 // Third 16 byte cache line in second 64
// byte cache line. Not used currently. // byte cache line. Diverse use.
//--------------------------------------------------- //---------------------------------------------------
Uint32 scanNode;
Uint32 scanTakeOverInd;
UintR firstKeybuf; /* POINTER THE LINKED LIST OF KEY BUFFERS */ UintR firstKeybuf; /* POINTER THE LINKED LIST OF KEY BUFFERS */
UintR lastKeybuf; /* VARIABLE POINTING TO THE LAST KEY BUFFER */ UintR lastKeybuf; /* VARIABLE POINTING TO THE LAST KEY BUFFER */
UintR packedCacheVar[6];
//---------------------------------------------------
// Fourth 16 byte cache line in second 64
// byte cache line. Not used currently.
//---------------------------------------------------
UintR packedCacheVar[4];
}; };
typedef Ptr<CacheRecord> CacheRecordPtr; typedef Ptr<CacheRecord> CacheRecordPtr;
......
...@@ -196,7 +196,6 @@ int ...@@ -196,7 +196,6 @@ int
clear_table(){ clear_table(){
if(!g_paramters[P_LOAD].value) if(!g_paramters[P_LOAD].value)
return 0; return 0;
int rows = g_paramters[P_ROWS].value; int rows = g_paramters[P_ROWS].value;
UtilTransactions utilTrans(* g_table); UtilTransactions utilTrans(* g_table);
...@@ -215,8 +214,8 @@ void err(NdbError e){ ...@@ -215,8 +214,8 @@ void err(NdbError e){
int int
run_scan(){ run_scan(){
int iter = g_paramters[P_LOOPS].value; int iter = g_paramters[P_LOOPS].value;
Uint64 start1; NDB_TICKS start1, stop;
Uint64 sum1 = 0; int sum_time= 0;
Uint32 tot = g_paramters[P_ROWS].value; Uint32 tot = g_paramters[P_ROWS].value;
...@@ -357,12 +356,15 @@ run_scan(){ ...@@ -357,12 +356,15 @@ run_scan(){
pTrans->close(); pTrans->close();
Uint64 stop = NdbTick_CurrentMillisecond(); stop = NdbTick_CurrentMillisecond();
start1 = (stop - start1); int time_passed= (int)(stop - start1);
sum1 += start1; g_err.println("Time: %d ms = %u rows/sec", time_passed,
(1000*tot)/time_passed);
sum_time+= time_passed;
} }
sum1 /= iter; sum_time= sum_time / iter;
g_err.println("Avg time: %Ldms = %d rows/sec", sum1, (1000*tot)/sum1); g_err.println("Avg time: %d ms = %u rows/sec", sum_time,
(1000*tot)/sum_time);
return 0; return 0;
} }
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