MDEV-12005: GET_LOCK: Fractional part of timeout is ignored

In order to include the fractional part, convert lock_wait_timeout
(in secs) to nanoseconds before calculating the absolute time for
timeout.
This commit is contained in:
Nirbhay Choubey 2017-02-07 13:54:46 -05:00
parent 5c7111cb7c
commit 6da2adfaa2

View file

@ -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;