Skip to content

Commit

Permalink
stablize main.slow_log_extra
Browse files Browse the repository at this point in the history
Summary:
According to Justin's earlier investigation, some logs might be
written to the default log file because there's a race condition between
log verification and changing configuration back to default.
Verify the slow log in the same connection and before changing the slow log
configuration back to default.

Test Plan: mysqltest.sh --valgrind --repeat ...

Reviewers: over

Reviewed By: over
  • Loading branch information
Rongrong Zhong authored and tianx committed Jan 16, 2015
1 parent 266d4e5 commit 67e765f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions mysql-test/r/slow_log_extra.result
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ i
6
7
8
set global slow_query_log_file = @my_slow_logname;
set global long_query_time=1;
drop table islow;
drop table mslow;
#
# This is a hack to check the log result.
# We strip off time related fields (non-deterministic) ana verify the rest are correct.
Expand All @@ -94,3 +90,7 @@ Rows_sent: 8 Rows_examined: 8 Errno: 0 Killed: 0 Bytes_received: 0 Bytes_sent:
Rows_sent: 8 Rows_examined: 8 Errno: 0 Killed: 0 Bytes_received: 0 Bytes_sent: 113 Read_first: 1 Read_last: 0 Read_key: 1 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 9 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
Rows_sent: 0 Rows_examined: 0 Errno: 0 Killed: 0 Bytes_received: 0 Bytes_sent: 11 Read_first: 0 Read_last: 0 Read_key: 0 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 0 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
Rows_sent: 8 Rows_examined: 8 Errno: 0 Killed: 0 Bytes_received: 0 Bytes_sent: 113 Read_first: 0 Read_last: 0 Read_key: 0 Read_next: 0 Read_prev: 0 Read_rnd: 0 Read_rnd_next: 9 Sort_merge_passes: 0 Sort_range_count: 0 Sort_rows: 0 Sort_scan_count: 0 Created_tmp_disk_tables: 0 Created_tmp_tables: 0
set global long_query_time=1;
set global slow_query_log_file = @my_slow_logname;
drop table islow;
drop table mslow;
14 changes: 7 additions & 7 deletions mysql-test/t/slow_log_extra.test
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ delimiter ;||||

--enable_ps_protocol

connection default;
set global slow_query_log_file = @my_slow_logname;
set global long_query_time=1;
disconnect con;
drop table islow;
drop table mslow;

--echo #
--echo # This is a hack to check the log result.
--echo # We strip off time related fields (non-deterministic) ana verify the rest are correct.
Expand All @@ -86,4 +79,11 @@ foreach $line (@lines) {
}
EOF

connection default;
set global long_query_time=1;
set global slow_query_log_file = @my_slow_logname;
disconnect con;
drop table islow;
drop table mslow;

--exit

0 comments on commit 67e765f

Please sign in to comment.