diff options
author | Rohit Kalhans <rohit.kalhans@oracle.com> | 2012-07-10 22:02:25 +0530 |
---|---|---|
committer | Rohit Kalhans <rohit.kalhans@oracle.com> | 2012-07-10 22:02:25 +0530 |
commit | 6fe6288d837a1a3d6a78db9a230e009d039464ab (patch) | |
tree | 7ff7c9a7d3e4c6b53d25aee42e3a2b58cc0f9323 /sql | |
parent | 3a71ab0805f2e8cb46872d10b98d8355d15ddcb8 (diff) | |
download | mariadb-git-6fe6288d837a1a3d6a78db9a230e009d039464ab.tar.gz |
bug#11759333:
follow-up patch for the failure on pb2 windows build
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_class.cc | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index c118030e7b4..8931d67dd25 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4814,8 +4814,7 @@ show_query_type(THD::enum_binlog_query_type qtype) //number of limit unsafe warnings after which the suppression will be activated #define LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT 50 -static struct timeval limit_unsafe_suppression_start_time; -static struct timezone limit_unsafe_suppression_start_time_zone; +static ulonglong limit_unsafe_suppression_start_time= 0; static bool unsafe_warning_suppression_is_activated= false; static int limit_unsafe_warning_count= 0; @@ -4827,8 +4826,7 @@ static void reset_binlog_unsafe_suppression() DBUG_ENTER("reset_binlog_unsafe_suppression"); unsafe_warning_suppression_is_activated= false; limit_unsafe_warning_count= 0; - gettimeofday(&limit_unsafe_suppression_start_time, - &limit_unsafe_suppression_start_time_zone); + limit_unsafe_suppression_start_time= my_getsystime()/10000000; DBUG_VOID_RETURN; } @@ -4860,8 +4858,7 @@ static void print_unsafe_warning_to_log(int unsafe_type, char* buf, */ static void do_unsafe_limit_checkout(char* buf, int unsafe_type, char* query) { - struct timeval now; - struct timezone tz_now; + ulonglong now= 0; DBUG_ENTER("do_unsafe_limit_checkout"); DBUG_ASSERT(unsafe_type == LEX::BINLOG_STMT_UNSAFE_LIMIT); limit_unsafe_warning_count++; @@ -4870,10 +4867,9 @@ static void do_unsafe_limit_checkout(char* buf, int unsafe_type, char* query) If this is the first time this function is called with log warning enabled, the monitoring the unsafe warnings should start. */ - if (limit_unsafe_suppression_start_time.tv_sec == 0) + if (limit_unsafe_suppression_start_time == 0) { - gettimeofday(&limit_unsafe_suppression_start_time, - &limit_unsafe_suppression_start_time_zone); + limit_unsafe_suppression_start_time= my_getsystime()/10000000; print_unsafe_warning_to_log(unsafe_type, buf, query); } else @@ -4884,7 +4880,7 @@ static void do_unsafe_limit_checkout(char* buf, int unsafe_type, char* query) if (limit_unsafe_warning_count >= LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT) { - gettimeofday (&now, &tz_now); + now= my_getsystime()/10000000; if (!unsafe_warning_suppression_is_activated) { /* @@ -4893,7 +4889,7 @@ static void do_unsafe_limit_checkout(char* buf, int unsafe_type, char* query) less than LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT we activate the suppression. */ - if ((now.tv_sec-limit_unsafe_suppression_start_time.tv_sec) <= + if ((now-limit_unsafe_suppression_start_time) <= LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT) { unsafe_warning_suppression_is_activated= true; @@ -4905,8 +4901,7 @@ unsafety warning suppression has been activated.")); /* there is no flooding till now, therefore we restart the monitoring */ - gettimeofday(&limit_unsafe_suppression_start_time, - &limit_unsafe_suppression_start_time_zone); + limit_unsafe_suppression_start_time= my_getsystime()/10000000; limit_unsafe_warning_count= 0; } } @@ -4919,15 +4914,14 @@ unsafety warning suppression has been activated.")); during the last %d seconds in the error log", limit_unsafe_warning_count, (int) - (now.tv_sec - - limit_unsafe_suppression_start_time.tv_sec)); + (now-limit_unsafe_suppression_start_time)); print_unsafe_warning_to_log(unsafe_type, buf, query); /* DEACTIVATION: We got LIMIT_UNSAFE_WARNING_ACTIVATION_THRESHOLD_COUNT warnings in more than LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT, the suppression should be deactivated. */ - if ((now.tv_sec - limit_unsafe_suppression_start_time.tv_sec) > + if ((now - limit_unsafe_suppression_start_time) > LIMIT_UNSAFE_WARNING_ACTIVATION_TIMEOUT) { reset_binlog_unsafe_suppression(); |