List:Commits« Previous MessageNext Message »
From:jani Date:February 18 2008 2:47pm
Subject:bk commit into 5.1 tree (jani:1.2556)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of jani.  When jani does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-02-18 16:47:00+02:00, jani@stripped +4 -0
  Fixed a previous patch.

  BitKeeper/etc/ignore@stripped, 2008-02-18 16:45:46+02:00, jani@stripped +1 -0
    added libmysqld/sql_profile.cc

  client/mysqltest.c@stripped, 2008-02-18 16:46:59+02:00, jani@stripped +1 -1
    Use my_micro_time() instead of my_getsystime() for
    faster execution.

  include/config-win.h@stripped, 2008-02-18 16:46:59+02:00, jani@stripped +3 -1
    Moved a definition into a header file.

  mysys/my_getsystime.c@stripped, 2008-02-18 16:46:59+02:00, jani@stripped +10 -24
    Use GetSystemTimeAsFileTime() instead of QueryPerformanceCounter()
    for faster execution.

diff -Nrup a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore
--- a/BitKeeper/etc/ignore	2008-02-08 12:50:21 +02:00
+++ b/BitKeeper/etc/ignore	2008-02-18 16:45:46 +02:00
@@ -3012,3 +3012,4 @@ win/vs8cache.txt
 ylwrap
 zlib/*.ds?
 zlib/*.vcproj
+libmysqld/sql_profile.cc
diff -Nrup a/client/mysqltest.c b/client/mysqltest.c
--- a/client/mysqltest.c	2008-02-12 11:44:55 +02:00
+++ b/client/mysqltest.c	2008-02-18 16:46:59 +02:00
@@ -7330,7 +7330,7 @@ void timer_output(void)
 
 ulonglong timer_now(void)
 {
-  return my_getsystime() / 10000;
+  return my_micro_time() / 1000;
 }
 
 
diff -Nrup a/include/config-win.h b/include/config-win.h
--- a/include/config-win.h	2007-10-31 22:43:44 +02:00
+++ b/include/config-win.h	2008-02-18 16:46:59 +02:00
@@ -257,8 +257,10 @@ inline double ulonglong2double(ulonglong
 #define tell(A) _telli64(A)
 #endif
 
-
 #define STACK_DIRECTION -1
+
+/* Difference between GetSystemTimeAsFileTime() and now() */
+#define OFFSET_TO_EPOCH ULL(116444736000000000)
 
 /* Optimized store functions for Intel x86 */
 
diff -Nrup a/mysys/my_getsystime.c b/mysys/my_getsystime.c
--- a/mysys/my_getsystime.c	2007-11-08 13:25:23 +02:00
+++ b/mysys/my_getsystime.c	2008-02-18 16:46:59 +02:00
@@ -41,7 +41,7 @@ ulonglong my_getsystime()
   {
     QueryPerformanceCounter(&t_cnt);
     return ((t_cnt.QuadPart / query_performance_frequency * 10000000) +
-            (t_cnt.QuadPart % query_performance_frequency * 10000000 /
+            ((t_cnt.QuadPart % query_performance_frequency) * 10000000 /
              query_performance_frequency) + query_performance_offset);
   }
   return 0;
@@ -108,21 +108,14 @@ time_t my_time(myf flags __attribute__((
 
 ulonglong my_micro_time()
 {
-  ulonglong newtime;
 #if defined(__WIN__)
-  if (query_performance_frequency)
-  {
-    QueryPerformanceCounter((LARGE_INTEGER*) &newtime);
-    return ((newtime / query_performance_frequency * 10000000) +
-            (newtime % query_performance_frequency * 10000000 /
-             query_performance_frequency));
-  }
-  else
-    newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec */
-  return newtime;
+  ulonglong newtime;
+  GetSystemTimeAsFileTime((FILETIME*)&newtime);
+  return (newtime/10);
 #elif defined(HAVE_GETHRTIME)
   return gethrtime()/1000;
 #else
+  ulonglong newtime;
   struct timeval t;
   /*
     The following loop is here because gettimeofday may fail on some systems
@@ -161,19 +154,11 @@ ulonglong my_micro_time()
 
 ulonglong my_micro_time_and_time(time_t *time_arg)
 {
-  ulonglong newtime;
 #if defined(__WIN__)
-  if (query_performance_frequency)
-  {
-    QueryPerformanceCounter((LARGE_INTEGER*) &newtime);
-    return ((newtime / query_performance_frequency * 10000000) +
-            (newtime % query_performance_frequency * 10000000 /
-             query_performance_frequency));
-  }
-  else
-    newtime= (GetTickCount() * 1000); /* GetTickCount only returns millisec. */
-  (void) time(time_arg);
-  return newtime;
+  ulonglong newtime;
+  GetSystemTimeAsFileTime((FILETIME*)&newtime);
+  *time_arg= (newtime-OFFSET_TO_EPOCH)/10000000;
+  return (newtime/10);
 #elif defined(HAVE_GETHRTIME)
   /*
     Solaris has a very slow time() call. We optimize this by using the very
@@ -194,6 +179,7 @@ ulonglong my_micro_time_and_time(time_t 
   pthread_mutex_unlock(&THR_LOCK_time);
   return cur_gethrtime/1000;
 #else
+  ulonglong newtime;
   struct timeval t;
   /*
     The following loop is here because gettimeofday may fail on some systems
Thread
bk commit into 5.1 tree (jani:1.2556)jani18 Feb