summaryrefslogtreecommitdiff
path: root/sql/event_queue.cc
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.home>2007-03-16 20:50:37 +0300
committerunknown <kroki/tomash@moonlight.home>2007-03-16 20:50:37 +0300
commit998260ae5abba5dd07c170548b0aa0b7a2713809 (patch)
tree9a537944e57f84b7149549ae8bf95fc6c7fe8d23 /sql/event_queue.cc
parent354e15f0680b0d4a79a38014841fa0675930962f (diff)
downloadmariadb-git-998260ae5abba5dd07c170548b0aa0b7a2713809.tar.gz
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.
Diffstat (limited to 'sql/event_queue.cc')
-rw-r--r--sql/event_queue.cc14
1 files changed, 5 insertions, 9 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index bcfe0a222f1..0efd9bb85d1 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -65,13 +65,10 @@ struct event_queue_param
static int
event_queue_element_compare_q(void *vptr, byte* a, byte *b)
{
- /*
- Note that no overflow is possible here because both values are
- non-negative, and subtraction is done in the signed my_time_t
- type.
- */
- return (((Event_queue_element *)a)->execute_at
- - ((Event_queue_element *)b)->execute_at);
+ my_time_t lhs = ((Event_queue_element *)a)->execute_at;
+ my_time_t rhs = ((Event_queue_element *)b)->execute_at;
+
+ return (lhs < rhs ? -1 : (lhs > rhs ? 1 : 0));
}
@@ -580,8 +577,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
time or until signaled. Release LOCK_queue while waiting.
*/
struct timespec top_time;
- top_time.tv_sec= next_activation_at;
- top_time.tv_nsec= 0;
+ set_timespec(top_time, next_activation_at - thd->query_start());
cond_wait(thd, &top_time, queue_wait_msg, SCHED_FUNC, __LINE__);
continue;