Commit d98dee2c authored by Philip Stoev's avatar Philip Stoev

Bug #29971 status.test fails

This test uses SHOW STATUS and the like, which may be unstable in the face
of logging to table, since the CSV handler is actively executing operations
and thus incrementing the counters.

Fixed by disabling logging to table for the duration of the test and restoring
it afterwards. This causes various counters to properly start counting from zero
and never advance due to CSV operations.
parent 403b0834
set @old_concurrent_insert= @@global.concurrent_insert; set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0; set @@global.concurrent_insert= 0;
SET @old_log_output = @@global.log_output;
SET GLOBAL LOG_OUTPUT = 'FILE';
flush status; flush status;
show status like 'Table_lock%'; show status like 'Table_lock%';
Variable_name Value Variable_name Value
Table_locks_immediate 1 Table_locks_immediate 0
Table_locks_waited 0 Table_locks_waited 0
select * from information_schema.session_status where variable_name like 'Table_lock%'; select * from information_schema.session_status where variable_name like 'Table_lock%';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 2 TABLE_LOCKS_IMMEDIATE 0
TABLE_LOCKS_WAITED 0 TABLE_LOCKS_WAITED 0
# Switched to connection: con1 # Switched to connection: con1
set sql_log_bin=0; set sql_log_bin=0;
...@@ -154,7 +156,7 @@ Variable_name Value ...@@ -154,7 +156,7 @@ Variable_name Value
Com_show_status 3 Com_show_status 3
show status like 'hand%write%'; show status like 'hand%write%';
Variable_name Value Variable_name Value
Handler_write 5 Handler_write 0
show status like '%tmp%'; show status like '%tmp%';
Variable_name Value Variable_name Value
Created_tmp_disk_tables 0 Created_tmp_disk_tables 0
...@@ -162,7 +164,7 @@ Created_tmp_files 0 ...@@ -162,7 +164,7 @@ Created_tmp_files 0
Created_tmp_tables 0 Created_tmp_tables 0
show status like 'hand%write%'; show status like 'hand%write%';
Variable_name Value Variable_name Value
Handler_write 7 Handler_write 0
show status like '%tmp%'; show status like '%tmp%';
Variable_name Value Variable_name Value
Created_tmp_disk_tables 0 Created_tmp_disk_tables 0
...@@ -237,3 +239,4 @@ SELECT 9; ...@@ -237,3 +239,4 @@ SELECT 9;
DROP PROCEDURE p1; DROP PROCEDURE p1;
DROP FUNCTION f1; DROP FUNCTION f1;
set @@global.concurrent_insert= @old_concurrent_insert; set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
set @old_concurrent_insert= @@global.concurrent_insert; set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0; set @@global.concurrent_insert= 0;
# Disable logging to table, since this will also cause table locking and unlocking, which will
# show up in SHOW STATUS and may cause sporadic failures
SET @old_log_output = @@global.log_output;
SET GLOBAL LOG_OUTPUT = 'FILE';
# PS causes different statistics # PS causes different statistics
--disable_ps_protocol --disable_ps_protocol
...@@ -350,6 +356,7 @@ DROP FUNCTION f1; ...@@ -350,6 +356,7 @@ DROP FUNCTION f1;
# Restore global concurrent_insert value. Keep in the end of the test file. # Restore global concurrent_insert value. Keep in the end of the test file.
--connection default --connection default
set @@global.concurrent_insert= @old_concurrent_insert; set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
# Wait till we reached the initial number of concurrent sessions # Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc
......
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