Times::utime_after_lock (lock time) is wrong
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
New
|
Undecided
|
Unassigned |
Bug Description
In Times.cc:
void Times::set_time()
{
_end_timer= _start_timer= boost::
utime_after_lock= (_start_timer - _epoch)
}
void Times::
{
utime_after_lock= (boost:
}
The first assignment to utime_after_lock in set_time() seems wrong because it results in the number of microseconds since epoch when it should be set to zero because this is when query execution begins. Furthermore, the second assignment in set_time_
To fix this and make lock time correct, I propose adding to class Times:
boost:
Then initialize _lock_end_timer in set_time() like the other timers, and in set_time_
There's a further consideration: plugin/
/******
Set the time waited for the lock for the current query. */
UNIV_INTERN
void
thd_set_
/*=====
drizzled:
ulint value) /*!< in: time waited for the lock */
{
if (in_session)
in_
}
I don't know the code well enough to know if there's an interaction between locking/global.cc and that Innobase code. In any case, it's confusing because utime_after_lock is being accessed two different ways; which one is correct? Is one interfering with the other?
If I have understood the code correctly and you agree that this is a problem, I can branch and fix class Times.
All code touching utime_after_lock assumes it's usecs since epoch, except the bit in thd_set_ lock_wait_ time.
I'm not sure why it's doing all those tricks. Init 0 seems fine.