mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
fix for bug #16426, post fixes
This commit is contained in:
parent
e38822d29b
commit
fc6afaaef9
3 changed files with 12 additions and 6 deletions
|
@ -28,6 +28,9 @@ SELECT * FROM slow_event_test;
|
||||||
slo_val val
|
slo_val val
|
||||||
SET GLOBAL event_scheduler=1;
|
SET GLOBAL event_scheduler=1;
|
||||||
"Sleep some more time than the actual event run will take"
|
"Sleep some more time than the actual event run will take"
|
||||||
|
SHOW VARIABLES LIKE 'event_scheduler';
|
||||||
|
Variable_name Value
|
||||||
|
event_scheduler ON
|
||||||
"Check our table. Should see 1 row"
|
"Check our table. Should see 1 row"
|
||||||
SELECT * FROM slow_event_test;
|
SELECT * FROM slow_event_test;
|
||||||
slo_val val
|
slo_val val
|
||||||
|
@ -37,7 +40,8 @@ SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||||
user_host query_time db sql_text
|
user_host query_time db sql_text
|
||||||
"This should go to the slow log"
|
"This should go to the slow log"
|
||||||
SET SESSION long_query_time=10;
|
SET SESSION long_query_time=10;
|
||||||
ALTER EVENT long_event DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5);
|
DROP EVENT long_event;
|
||||||
|
CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5);
|
||||||
"Sleep some more time than the actual event run will take"
|
"Sleep some more time than the actual event run will take"
|
||||||
"Check our table. Should see 2 rows"
|
"Check our table. Should see 2 rows"
|
||||||
SELECT * FROM slow_event_test;
|
SELECT * FROM slow_event_test;
|
||||||
|
@ -48,7 +52,7 @@ slo_val val
|
||||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||||
user_host query_time db sql_text
|
user_host query_time db sql_text
|
||||||
root[root] @ localhost [localhost] 00:00:05 events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5)
|
root[root] @ localhost [localhost] 00:00:05 events_test INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5)
|
||||||
DROP EVENT long_event;
|
DROP EVENT long_event2;
|
||||||
SET GLOBAL long_query_time =@old_global_long_query_time;
|
SET GLOBAL long_query_time =@old_global_long_query_time;
|
||||||
SET SESSION long_query_time =@old_session_long_query_time;
|
SET SESSION long_query_time =@old_session_long_query_time;
|
||||||
TRUNCATE mysql.slow_log;
|
TRUNCATE mysql.slow_log;
|
||||||
|
|
|
@ -40,20 +40,22 @@ SELECT * FROM slow_event_test;
|
||||||
SET GLOBAL event_scheduler=1;
|
SET GLOBAL event_scheduler=1;
|
||||||
--echo "Sleep some more time than the actual event run will take"
|
--echo "Sleep some more time than the actual event run will take"
|
||||||
--sleep 5
|
--sleep 5
|
||||||
|
SHOW VARIABLES LIKE 'event_scheduler';
|
||||||
--echo "Check our table. Should see 1 row"
|
--echo "Check our table. Should see 1 row"
|
||||||
SELECT * FROM slow_event_test;
|
SELECT * FROM slow_event_test;
|
||||||
--echo "Check slow log. Should not see anything because 3 is under the threshold of 4 for GLOBAL, though over SESSION which is 2"
|
--echo "Check slow log. Should not see anything because 3 is under the threshold of 4 for GLOBAL, though over SESSION which is 2"
|
||||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||||
--echo "This should go to the slow log"
|
--echo "This should go to the slow log"
|
||||||
SET SESSION long_query_time=10;
|
SET SESSION long_query_time=10;
|
||||||
ALTER EVENT long_event DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5);
|
DROP EVENT long_event;
|
||||||
|
CREATE EVENT long_event2 ON SCHEDULE EVERY 1 MINUTE DO INSERT INTO slow_event_test SELECT @@long_query_time, SLEEP(5);
|
||||||
--echo "Sleep some more time than the actual event run will take"
|
--echo "Sleep some more time than the actual event run will take"
|
||||||
--sleep 7
|
--sleep 7
|
||||||
--echo "Check our table. Should see 2 rows"
|
--echo "Check our table. Should see 2 rows"
|
||||||
SELECT * FROM slow_event_test;
|
SELECT * FROM slow_event_test;
|
||||||
--echo "Check slow log. Should see 1 row because 5 is over the threshold of 4 for GLOBAL, though under SESSION which is 10"
|
--echo "Check slow log. Should see 1 row because 5 is over the threshold of 4 for GLOBAL, though under SESSION which is 10"
|
||||||
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
SELECT user_host, query_time, db, sql_text FROM mysql.slow_log;
|
||||||
DROP EVENT long_event;
|
DROP EVENT long_event2;
|
||||||
SET GLOBAL long_query_time =@old_global_long_query_time;
|
SET GLOBAL long_query_time =@old_global_long_query_time;
|
||||||
SET SESSION long_query_time =@old_session_long_query_time;
|
SET SESSION long_query_time =@old_session_long_query_time;
|
||||||
TRUNCATE mysql.slow_log;
|
TRUNCATE mysql.slow_log;
|
||||||
|
|
|
@ -1412,7 +1412,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
|
||||||
uint params = m_pcont->context_pvars();
|
uint params = m_pcont->context_pvars();
|
||||||
sp_rcontext *save_spcont, *octx;
|
sp_rcontext *save_spcont, *octx;
|
||||||
sp_rcontext *nctx = NULL;
|
sp_rcontext *nctx = NULL;
|
||||||
bool save_enable_slow_log;
|
bool save_enable_slow_log= false;
|
||||||
DBUG_ENTER("sp_head::execute_procedure");
|
DBUG_ENTER("sp_head::execute_procedure");
|
||||||
DBUG_PRINT("info", ("procedure %s", m_name.str));
|
DBUG_PRINT("info", ("procedure %s", m_name.str));
|
||||||
|
|
||||||
|
@ -1522,7 +1522,7 @@ sp_head::execute_procedure(THD *thd, List<Item> *args)
|
||||||
if (!err_status)
|
if (!err_status)
|
||||||
err_status= execute(thd);
|
err_status= execute(thd);
|
||||||
|
|
||||||
if (thd->enable_slow_log && !(m_flags & LOG_SLOW_STATEMENTS))
|
if (save_enable_slow_log && !(m_flags & LOG_SLOW_STATEMENTS))
|
||||||
thd->enable_slow_log= save_enable_slow_log;
|
thd->enable_slow_log= save_enable_slow_log;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue