Commit 9ff93656 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Fix sporadic failure of set_statement mtr test.

On Windows with low precision  (10-16 ms) timer used for timing queries,
the statement "set @@long_query_time=0.01" can log itself a slow if it
spawn more single timer tick.

The fix is to filter this query out  from "SELECT FROM mysql.slow_log"
results
parent 1859caf6
...@@ -1056,7 +1056,7 @@ set statement slow_query_log=default for select @@slow_query_log; ...@@ -1056,7 +1056,7 @@ set statement slow_query_log=default for select @@slow_query_log;
truncate table mysql.slow_log; truncate table mysql.slow_log;
set slow_query_log= 1; set slow_query_log= 1;
set global log_output='TABLE'; set global log_output='TABLE';
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
set @@long_query_time=0.01; set @@long_query_time=0.01;
#should be written #should be written
...@@ -1064,7 +1064,7 @@ select sleep(0.1); ...@@ -1064,7 +1064,7 @@ select sleep(0.1);
sleep(0.1) sleep(0.1)
0 0
set @@long_query_time=@save_long_query_time; set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
select sleep(0.1) select sleep(0.1)
#--- #---
...@@ -1072,7 +1072,7 @@ select sleep(0.1) ...@@ -1072,7 +1072,7 @@ select sleep(0.1)
set statement long_query_time=0.01 for select sleep(0.1); set statement long_query_time=0.01 for select sleep(0.1);
sleep(0.1) sleep(0.1)
0 0
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
select sleep(0.1) select sleep(0.1)
set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1)
...@@ -1083,7 +1083,7 @@ set statement slow_query_log=0 for select sleep(0.1); ...@@ -1083,7 +1083,7 @@ set statement slow_query_log=0 for select sleep(0.1);
sleep(0.1) sleep(0.1)
0 0
set @@long_query_time=@save_long_query_time; set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
select sleep(0.1) select sleep(0.1)
set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1)
...@@ -1092,7 +1092,7 @@ set statement long_query_time=0.01 for select sleep(0.1) ...@@ -1092,7 +1092,7 @@ set statement long_query_time=0.01 for select sleep(0.1)
set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1); set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1);
sleep(0.1) sleep(0.1)
0 0
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
select sleep(0.1) select sleep(0.1)
set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1)
...@@ -1101,7 +1101,7 @@ set statement long_query_time=0.01 for select sleep(0.1) ...@@ -1101,7 +1101,7 @@ set statement long_query_time=0.01 for select sleep(0.1)
set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1); set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1);
sleep(0.1) sleep(0.1)
0 0
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
select sleep(0.1) select sleep(0.1)
set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1)
...@@ -1110,7 +1110,7 @@ set statement long_query_time=0.01 for select sleep(0.1) ...@@ -1110,7 +1110,7 @@ set statement long_query_time=0.01 for select sleep(0.1)
set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1); set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1);
sleep(0.1) sleep(0.1)
0 0
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text sql_text
select sleep(0.1) select sleep(0.1)
set statement long_query_time=0.01 for select sleep(0.1) set statement long_query_time=0.01 for select sleep(0.1)
......
...@@ -1003,34 +1003,34 @@ truncate table mysql.slow_log; ...@@ -1003,34 +1003,34 @@ truncate table mysql.slow_log;
set slow_query_log= 1; set slow_query_log= 1;
set global log_output='TABLE'; set global log_output='TABLE';
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
set @@long_query_time=0.01; set @@long_query_time=0.01;
--echo #should be written --echo #should be written
select sleep(0.1); select sleep(0.1);
set @@long_query_time=@save_long_query_time; set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #--- --echo #---
--echo #should be written --echo #should be written
set statement long_query_time=0.01 for select sleep(0.1); set statement long_query_time=0.01 for select sleep(0.1);
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #--- --echo #---
set @@long_query_time=0.01; set @@long_query_time=0.01;
--echo #should NOT be written --echo #should NOT be written
set statement slow_query_log=0 for select sleep(0.1); set statement slow_query_log=0 for select sleep(0.1);
set @@long_query_time=@save_long_query_time; set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #--- --echo #---
--echo #should NOT be written --echo #should NOT be written
set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1); set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1);
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #--- --echo #---
--echo #should NOT be written --echo #should NOT be written
set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1); set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1);
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #--- --echo #---
--echo #should NOT be written --echo #should NOT be written
set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1); set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1);
select sql_text from mysql.slow_log; select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #--- --echo #---
# #
# log_slow_verbosity is impossible to check because results are not written # log_slow_verbosity is impossible to check because results are not written
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment