summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2017-02-07 13:54:46 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2017-02-07 13:54:46 -0500
commit6da2adfaa203fd9f76a32fa314b3c14f11ecddc1 (patch)
tree59d7bea1a3e2c3a8678b78c38c04c647e29d7556 /sql/mdl.cc
parent5c7111cb7c9692b8762c9c66ccae4bf9afcdba35 (diff)
downloadmariadb-git-6da2adfaa203fd9f76a32fa314b3c14f11ecddc1.tar.gz
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.
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index d1f4cb7e5c7..56515d42c58 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -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;