Skip to content

Commit

Permalink
MDEV-12005: GET_LOCK: Fractional part of timeout is ignored
Browse files Browse the repository at this point in the history
In order to include the fractional part, convert lock_wait_timeout
(in secs) to nanoseconds before calculating the absolute time for
timeout.
  • Loading branch information
Nirbhay Choubey committed Feb 7, 2017
1 parent 5c7111c commit 6da2adf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/mdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2113,7 +2113,8 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout)
find_deadlock();

struct timespec abs_timeout, abs_shortwait;
set_timespec(abs_timeout, (ulonglong) lock_wait_timeout);
set_timespec_nsec(abs_timeout,
(ulonglong)(lock_wait_timeout * 1000000000ULL));
set_timespec(abs_shortwait, 1);
wait_status= MDL_wait::EMPTY;

Expand Down

0 comments on commit 6da2adf

Please sign in to comment.