MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jack andrews Date:April 16 2009 10:30am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jack:2868) Bug#44276
View as plain text  
#At file:///C:/w/repo/70/ based on revid:jack@stripped

 2868 jack andrews	2009-04-16
      bug#44276  NdbTick assert() in Ndbif.cpp

    modified:
      storage/ndb/src/common/portlib/win32/NdbTick.c
=== modified file 'storage/ndb/src/common/portlib/win32/NdbTick.c'
--- a/storage/ndb/src/common/portlib/win32/NdbTick.c	2008-10-02 09:41:59 +0000
+++ b/storage/ndb/src/common/portlib/win32/NdbTick.c	2009-04-16 10:30:49 +0000
@@ -31,11 +31,18 @@ NDB_TICKS NdbTick_CurrentMillisecond(voi
 int
 NdbTick_CurrentMicrosecond(NDB_TICKS * secs, Uint32 * micros)
 {
-  LARGE_INTEGER liCount, liFreq;
-  QueryPerformanceCounter(&liCount);
-  QueryPerformanceFrequency(&liFreq);
-  *secs = liCount.QuadPart / liFreq.QuadPart;
-  liCount.QuadPart -= *secs * liFreq.QuadPart;
-  *micros = (Uint32)((liCount.QuadPart*1000000) / liFreq.QuadPart);
+  ulonglong time, timemicro, micropart, secpart;
+
+  GetSystemTimeAsFileTime((FILETIME*)&time);
+  timemicro = time/10;
+  
+  secpart   = timemicro/1000000;
+  micropart = timemicro%1000000;
+  assert(micropart <= ULONG_MAX);
+  assert(secpart*1000000+micropart == timemicro);
+
+  *micros = (Uint32)micropart;
+  *secs = secpart;
+
   return 0;
 }


Attachment: [text/bzr-bundle] bzr/jack@sun.com-20090416103049-hn283mtm4t2ca7v3.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jack:2868) Bug#44276jack andrews16 Apr