Commit 998260ae authored by unknown's avatar unknown

Fix compilation on Windows broken with the push of bug#16420.

Fix three compilation warnings.


sql/event_data_objects.cc:
  Fix compilation warnings.
sql/event_queue.cc:
  Fix compilation warning: reimplement event_queue_element_compare_q()
  properly.
  
  Use set_timespec() to initialize struct timespec.
parent 354e15f0
...@@ -1293,7 +1293,7 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next, ...@@ -1293,7 +1293,7 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next,
time, and this will greatly reduce the effect of the time, and this will greatly reduce the effect of the
optimization. So instead we keep the code simple and clean. optimization. So instead we keep the code simple and clean.
*/ */
interval.month= diff_months - diff_months % months; interval.month= (ulong) (diff_months - diff_months % months);
next_time= add_interval(&local_start, time_zone, next_time= add_interval(&local_start, time_zone,
INTERVAL_MONTH, interval); INTERVAL_MONTH, interval);
if (next_time == 0) if (next_time == 0)
...@@ -1301,7 +1301,7 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next, ...@@ -1301,7 +1301,7 @@ bool get_next_time(const Time_zone *time_zone, my_time_t *next,
if (next_time <= time_now) if (next_time <= time_now)
{ {
interval.month= months; interval.month= (ulong) months;
next_time= add_interval(&local_start, time_zone, next_time= add_interval(&local_start, time_zone,
INTERVAL_MONTH, interval); INTERVAL_MONTH, interval);
if (next_time == 0) if (next_time == 0)
......
...@@ -65,13 +65,10 @@ struct event_queue_param ...@@ -65,13 +65,10 @@ struct event_queue_param
static int static int
event_queue_element_compare_q(void *vptr, byte* a, byte *b) event_queue_element_compare_q(void *vptr, byte* a, byte *b)
{ {
/* my_time_t lhs = ((Event_queue_element *)a)->execute_at;
Note that no overflow is possible here because both values are my_time_t rhs = ((Event_queue_element *)b)->execute_at;
non-negative, and subtraction is done in the signed my_time_t
type. return (lhs < rhs ? -1 : (lhs > rhs ? 1 : 0));
*/
return (((Event_queue_element *)a)->execute_at
- ((Event_queue_element *)b)->execute_at);
} }
...@@ -580,8 +577,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd, ...@@ -580,8 +577,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
time or until signaled. Release LOCK_queue while waiting. time or until signaled. Release LOCK_queue while waiting.
*/ */
struct timespec top_time; struct timespec top_time;
top_time.tv_sec= next_activation_at; set_timespec(top_time, next_activation_at - thd->query_start());
top_time.tv_nsec= 0;
cond_wait(thd, &top_time, queue_wait_msg, SCHED_FUNC, __LINE__); cond_wait(thd, &top_time, queue_wait_msg, SCHED_FUNC, __LINE__);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment