• Staale Smedseng's avatar
    Bug #47905 stored procedures with conditional statements not · c1a6dc50
    Staale Smedseng authored
    being logged to slow query log
    
    The problem is that the execution time for a multi-statement
    stored procedure as a whole may not be accurate, and thus not
    be entered into the slow query log even if the total time
    exceeds long_query_time. The reason for this is that
    THD::utime_after_lock used for time calculation may be reset
    at the start of each new statement, possibly leaving the total
    SP execution equal to the time spent executing the last
    statement in the SP.
    
    This patch stores the utime on start of SP execution, and
    restores it on exit of SP execution. A test is added.
    c1a6dc50
sp_head.cc 104 KB