Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

bk commit into 5.1 tree (monty:1.2558)

From: <monty(at)mysql.com>
Date: Mon Jul 30 2007 - 16:50:01 EDT


Below is the list of changes that have just been committed into a local 5.1 repository of monty. When monty 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@1.2558, 2007-07-30 23:49:56+03:00, monty@mysql.com +8 -0   Fixed compiler warnings, errors and link errors   Fixed new bug on Solaris with gethrtime()

  BUILD/compile-solaris-sparc-debug@1.7, 2007-07-30 23:49:51+03:00, monty@mysql.com +1 -1     Remove old cpu options

  libmysql/libmysql.c@1.287, 2007-07-30 23:49:51+03:00, monty@mysql.com +1 -1     Fixed compiler warning

  mysys/my_getsystime.c@1.9, 2007-07-30 23:49:51+03:00, monty@mysql.com +40 -27     Moved fast time calculation to my_micro_time_and_time()     Fixed bug in previous push related to HAVE_GETHRTIME

  mysys/my_static.c@1.24, 2007-07-30 23:49:51+03:00, monty@mysql.com +0 -2     Cleanup

  sql/item_xmlfunc.cc@1.32, 2007-07-30 23:49:51+03:00, monty@mysql.com +2 -2     Fixed compiler warning

  unittest/mysys/base64-t.c@1.9, 2007-07-30 23:49:51+03:00, monty@mysql.com +2 -0     Fixed link error

Do you need help?X

  unittest/mysys/bitmap-t.c@1.6, 2007-07-30 23:49:51+03:00, monty@mysql.com +5 -4     Fixed link error

  unittest/mysys/my_atomic-t.c@1.11, 2007-07-30 23:49:51+03:00, monty@mysql.com +2 -1     Fixed link error

diff -Nrup a/BUILD/compile-solaris-sparc-debug b/BUILD/compile-solaris-sparc-debug

--- a/BUILD/compile-solaris-sparc-debug	2007-02-23 13:13:46 +02:00
+++ b/BUILD/compile-solaris-sparc-debug	2007-07-30 23:49:51 +03:00

@@ -6,6 +6,6 @@ make -k clean || true

 path=`dirname $0`
 . "$path/autorun.sh"   

-CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wid-clash-51 -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug +CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug  

 make -j 4
diff -Nrup a/libmysql/libmysql.c b/libmysql/libmysql.c

--- a/libmysql/libmysql.c	2007-07-21 13:36:28 +03:00
+++ b/libmysql/libmysql.c	2007-07-30 23:49:51 +03:00

@@ -215,7 +215,7 @@ void STDCALL mysql_server_end()
 }  

 static MYSQL_PARAMETERS mysql_internal_parameters= -{&max_allowed_packet, &net_buffer_length}; +{&max_allowed_packet, &net_buffer_length, 0};  

 MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void)  {
diff -Nrup a/mysys/my_getsystime.c b/mysys/my_getsystime.c

--- a/mysys/my_getsystime.c	2007-07-30 11:33:42 +03:00
+++ b/mysys/my_getsystime.c	2007-07-30 23:49:51 +03:00

@@ -17,11 +17,13 @@

 /* thus to get the current time we should use the system function

    with the highest possible resolution */  

+#include "mysys_priv.h"
+#include "my_static.h"
+
 #ifdef __NETWARE__

 #include <nks/time.h>
 #endif  
Do you need more help?X

-#include "mysys_priv.h"
 ulonglong my_getsystime()
 {
 #ifdef HAVE_CLOCK_GETTIME
@@ -38,8 +40,7 @@ ulonglong my_getsystime()

             t_cnt.QuadPart % query_performance_frequency * 10000000/
             query_performance_frequency+query_performance_offset);
   }
- gettimeofday(&tv,NULL);
- return (ulonglong)tv.tv_sec*10000000+(ulonglong)tv.tv_usec*10; + return 0;
 #elif defined(__NETWARE__)
   NXTime_t tm;
   NXGetTime(NX_SINCE_1970, NX_NSECONDS, &tm);
@@ -62,26 +63,13 @@ ulonglong my_getsystime()
 

 */  

-#define DELTA_FOR_SECONDS LL(500000000) /* Half a second */ -
 time_t my_time(myf flags __attribute__((unused)))  {
+ time_t t;
 #ifdef HAVE_GETHRTIME

-  static hrtime_t prev_gethrtime= 0;
-  static time_t cur_time= 0;
-
-  hrtime_t cur_gethrtime;
-  pthread_mutex_lock(&THR_LOCK_time);
-  cur_gethrtime= gethrtime();
-  if ((prev_gethrtime - cur_gethrtime) > DELTA_FOR_SECONDS)
-  {
-    cur_time= time(0);
-    prev_gethrtime= cur_gethrtime;
-  }
-  pthread_mutex_unlock(&THR_LOCK_time);
-  return cur_time;

+ (void) my_micro_time_and_time(&t);
+ return t;
 #else
- time_t t;

   /* The following loop is here beacuse time() may fail on some systems */    while ((t= time(0)) == (time_t) -1)
   {
@@ -120,11 +108,12 @@ ulonglong my_micro_time()
 #if defined(__WIN__)
   if (query_performance_frequency)
   {
- QueryPerformanceCounter(&newtime);
+ QueryPerformanceCounter((LARGE_INTEGER*) &newtime);

     newtime/= (query_performance_frequency * 1000000);    }
   else
- newtime= (GetTickCount() * 1000; /* GetTickCount only returns milliseconds */ + newtime= (GetTickCount() * 1000); /* GetTickCount only returns milliseconds */ + return newtime;
 #elif defined(HAVE_GETHRTIME)
   return gethrtime()/1000;
 #else
@@ -133,13 +122,13 @@ ulonglong my_micro_time()

   while (gettimeofday(&t, NULL) != 0)
   {}
   newtime= (ulonglong)t.tv_sec * 1000000 + t.tv_usec; -#endif /* defined(__WIN__) */

   return newtime;
+#endif /* defined(__WIN__) */
 }    

 /*
- Return time in seconds and timer in microseconds + Return time in seconds and timer in microseconds (not different start!)  

Can we help you?X

   SYNOPSIS
     my_micro_time_and_time()
@@ -152,24 +141,48 @@ ulonglong my_micro_time()

     to measure the time of a query (for the slow query log)  

   IMPLEMENTATION
- Same as my_micro_time()

+    Value of time is as in time() call.
+    Value of microtime is same as my_micro_time(), which may be totally unrealated
+    to time()
 
   RETURN
     Value in microseconds from some undefined point in time
 */  

+#define DELTA_FOR_SECONDS LL(500000000) /* Half a second */ +
 ulonglong my_micro_time_and_time(time_t *time_arg)  {
   ulonglong newtime;
 #if defined(__WIN__)
   if (query_performance_frequency)
   {
- QueryPerformanceCounter((LARGE_INTEGER *) &newtime); + QueryPerformanceCounter((LARGE_INTEGER*) &newtime);

     newtime/= (query_performance_frequency * 1000000);    }
   else

-    newtime= (GetTickCount() * 1000; /* GetTickCount only returns milliseconds */
+    newtime= (GetTickCount() * 1000); /* GetTickCount only returns milliseconds */
   (void) time(time_arg);
+  return newtime;
+#elif defined(HAVE_GETHRTIME)
+  /*
+    Solaris has a very slow time() call. We optimize this by using the very fast
+    gethrtime() call and only calling time() every 1/2 second
+  */
+  static hrtime_t prev_gethrtime= 0;
+  static time_t cur_time= 0;
+  hrtime_t cur_gethrtime;
+
+  pthread_mutex_lock(&THR_LOCK_time);
+  cur_gethrtime= gethrtime();
+  if ((cur_gethrtime - prev_gethrtime) > DELTA_FOR_SECONDS)
+  {
+    cur_time= time(0);
Can't find what you're looking for?X
+ prev_gethrtime= cur_gethrtime; + } + *time_arg= cur_time;

+ pthread_mutex_unlock(&THR_LOCK_time); + return cur_gethrtime/1000;
 #else
   struct timeval t;
   /* The following loop is here because gettimeofday may fail on some systems */
@@ -177,8 +190,8 @@ ulonglong my_micro_time_and_time(time_t

   {}
   *time_arg= t.tv_sec;
   newtime= (ulonglong)t.tv_sec * 1000000 + t.tv_usec; -#endif /* defined(__WIN__) */

   return newtime;
+#endif /* defined(__WIN__) */
 }    

diff -Nrup a/mysys/my_static.c b/mysys/my_static.c

--- a/mysys/my_static.c	2007-07-30 11:33:42 +03:00
+++ b/mysys/my_static.c	2007-07-30 23:49:51 +03:00

@@ -18,11 +18,9 @@
Don't know where to look next?X

   a shared library
 */  

-#if !defined(stdin)
 #include "mysys_priv.h"
 #include "my_static.h"
 #include "my_alarm.h"
-#endif
 

 my_bool timed_mutexes= 0;  

diff -Nrup a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc

--- a/sql/item_xmlfunc.cc	2007-07-30 11:33:43 +03:00
+++ b/sql/item_xmlfunc.cc	2007-07-30 23:49:51 +03:00

@@ -2767,9 +2767,9 @@ String *Item_xml_str_func::parse_xml(Str

   if ((rc= my_xml_parse(&p, raw_xml->ptr(), raw_xml->length())) != MY_XML_OK)    {
     char buf[128];
- my_snprintf(buf, sizeof(buf)-1, "parse error at line %d pos %u: %s", + my_snprintf(buf, sizeof(buf)-1, "parse error at line %d pos %lu: %s",

                 my_xml_error_lineno(&p) + 1,
-                my_xml_error_pos(&p) + 1,
+                (ulong) my_xml_error_pos(&p) + 1,
                 my_xml_error_string(&p));
     push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
                         ER_WRONG_VALUE,
diff -Nrup a/unittest/mysys/base64-t.c b/unittest/mysys/base64-t.c
--- a/unittest/mysys/base64-t.c	2007-02-21 19:16:36 +02:00
+++ b/unittest/mysys/base64-t.c	2007-07-30 23:49:51 +03:00

@@ -14,6 +14,7 @@

    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */  

 #include 
+#include 
 #include 
 #include 
 #include 

@@ -26,6 +27,7 @@ main(void)

 {
   int i, cmp;
   size_t j, k, l, dst_len, needed_length; + MY_INIT("base64-t");  

   plan(BASE64_LOOP_COUNT * BASE64_ROWS);  

diff -Nrup a/unittest/mysys/bitmap-t.c b/unittest/mysys/bitmap-t.c

--- a/unittest/mysys/bitmap-t.c	2006-12-23 21:33:31 +02:00
+++ b/unittest/mysys/bitmap-t.c	2007-07-30 23:49:51 +03:00

@@ -18,12 +18,11 @@

    library.
 */  

Confused? Frustrated?X

-#include <tap.h>
-

 #include 
+#include 
 #include 

-
-#include 
+#include 
+#include 
 

 uint get_rand_bit(uint bitsize)
 {
@@ -379,6 +378,8 @@ int main()

   int i;
   int const min_size = 1;
   int const max_size = 1024;
+ MY_INIT("bitmap-t");
+

   plan(max_size - min_size);
   for (i= min_size; i < max_size; i++)
     ok(do_test(i) == 0, "bitmap size %d", i);
diff -Nrup a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c
--- a/unittest/mysys/my_atomic-t.c	2007-03-16 20:43:57 +02:00
+++ b/unittest/mysys/my_atomic-t.c	2007-07-30 23:49:51 +03:00

@@ -14,9 +14,9 @@

    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */  

 #include 
-#include 
 #include 
 #include 
+#include 
 

 int32 a32,b32,c32;
 my_atomic_rwlock_t rwl;
@@ -160,6 +160,7 @@ err:

 int main()
 {
   int err;
+ MY_INIT("my_atomic-t.c");  

   diag("N CPUs: %d", my_getncpus());
   err= my_atomic_initialize();

-- 
MySQL Code Commits Mailing List
For list archives: 
http://lists.mysql.com/commits
To unsubscribe:    
http://lists.mysql.com/commits?unsub=lists@pantek.com
Received on Mon Jul 30 16:50:31 2007

This archive was generated by hypermail 2.1.8 : Thu Aug 09 2007 - 19:19:04 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library