|
|||||||||||
|
bk commit into 5.1 tree (monty:1.2558)
From: <monty(at)mysql.com>
Date: Mon Jul 30 2007 - 16:50:01 EDT
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 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
--- 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)
{
--- 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
-#include "mysys_priv.h"
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 */
-
- 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)
newtime/= (query_performance_frequency * 1000000);
}
while (gettimeofday(&t, NULL) != 0)
return newtime;
/*
SYNOPSIS
to measure the time of a query (for the slow query log) IMPLEMENTATION
+ 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 */
+
newtime/= (query_performance_frequency * 1000000);
}
- 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);
+ 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
{}
return newtime;
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 @@
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)
{
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 @@ -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.
-#include <tap.h>
#include - -#include
uint get_rand_bit(uint bitsize)
int i;
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
int32 a32,b32,c32;
diag("N CPUs: %d", my_getncpus());
-- MySQL Code Commits Mailing List For list archives: http://lists.mysql.com/commits To unsubscribe: http://lists.mysql.com/commits?unsub=lists@pantek.comReceived 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 |
||||||||||
|
|||||||||||