Staale Smedseng
f4a16558c8
Bug #47905 stored procedures with conditional statements not
...
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.
mysql-test/suite/sys_vars/r/slow_query_log_func.result:
New test results for #47905 .
mysql-test/suite/sys_vars/t/slow_query_log_func.test:
New test case for #47905 .
sql/sp_head.cc:
Save and restore the THD::utime_after_lock on entry and
exit of execute_procedure().
2010-02-11 21:10:13 +01:00
..
2008-12-19 16:03:32 +01:00
2009-03-12 17:55:10 +01:00
2009-02-27 21:43:43 +01:00
2009-03-12 17:55:10 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2009-01-30 15:44:49 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-24 16:20:00 +02:00
2009-03-12 17:55:10 +01:00
2009-01-29 17:59:46 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2009-01-29 17:59:46 +01:00
2009-01-29 17:59:46 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-07-23 16:06:44 +02:00
2008-07-23 16:06:44 +02:00
2008-12-19 16:03:32 +01:00
2009-05-22 01:22:46 +05:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-05-22 01:22:46 +05:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-30 17:59:10 +01:00
2008-07-23 16:06:44 +02:00
2008-07-23 16:06:44 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-07-23 16:06:44 +02:00
2008-07-23 16:06:44 +02:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2008-07-23 16:06:44 +02:00
2009-03-20 18:11:22 +01:00
2008-07-23 16:06:44 +02:00
2009-03-20 18:11:22 +01:00
2008-07-23 16:06:44 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2009-02-16 08:38:15 -03:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-01-29 17:59:46 +01:00
2009-02-27 21:43:43 +01:00
2009-01-29 17:59:46 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-02-27 21:43:43 +01:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-01-22 11:14:16 +01:00
2009-04-03 11:37:48 +02:00
2009-01-29 17:59:46 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2008-12-19 16:03:32 +01:00
2009-05-22 01:22:46 +05:00
2009-03-20 18:11:22 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-03-12 17:55:10 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-01-29 17:59:46 +01:00
2009-01-29 17:59:46 +01:00
2010-02-11 21:10:13 +01:00
2009-01-08 19:13:57 +01:00
2009-01-08 19:13:57 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-05-22 01:22:46 +05:00
2008-12-19 16:03:32 +01:00
2009-05-22 01:22:46 +05:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2009-02-27 21:43:43 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00
2009-03-20 18:11:22 +01:00
2009-04-03 11:37:48 +02:00
2008-12-19 16:03:32 +01:00
2008-12-19 16:03:32 +01:00