Commit 6e783d9f authored by vasil's avatar vasil

branches/5.1:

Fix Bug#43309 Test main.innodb can't be run twice

Make the innodb mysql-test more flexible by inspecting how much a
variable of interest has changed since the start of the test. Do not
assume the variables have zero values at the start of the test.
parent 0a788fe6
...@@ -1736,36 +1736,36 @@ select count(*) from t1 where x = 18446744073709551601; ...@@ -1736,36 +1736,36 @@ select count(*) from t1 where x = 18446744073709551601;
count(*) count(*)
1 1
drop table t1; drop table t1;
show status like "Innodb_buffer_pool_pages_total"; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
Variable_name Value variable_value
Innodb_buffer_pool_pages_total 512 512
show status like "Innodb_page_size"; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
Variable_name Value variable_value
Innodb_page_size 16384 16384
show status like "Innodb_rows_deleted"; SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
Variable_name Value variable_value - @innodb_rows_deleted_orig
Innodb_rows_deleted 71 71
show status like "Innodb_rows_inserted"; SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
Variable_name Value variable_value - @innodb_rows_inserted_orig
Innodb_rows_inserted 1084 1084
show status like "Innodb_rows_updated"; SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
Variable_name Value variable_value - @innodb_rows_updated_orig
Innodb_rows_updated 885 885
show status like "Innodb_row_lock_waits"; SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
Variable_name Value variable_value - @innodb_row_lock_waits_orig
Innodb_row_lock_waits 0 0
show status like "Innodb_row_lock_current_waits"; SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
Variable_name Value variable_value - @innodb_row_lock_current_waits_orig
Innodb_row_lock_current_waits 0 0
show status like "Innodb_row_lock_time"; SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
Variable_name Value variable_value - @innodb_row_lock_time_orig
Innodb_row_lock_time 0 0
show status like "Innodb_row_lock_time_max"; SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
Variable_name Value variable_value - @innodb_row_lock_time_max_orig
Innodb_row_lock_time_max 0 0
show status like "Innodb_row_lock_time_avg"; SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
Variable_name Value variable_value - @innodb_row_lock_time_avg_orig
Innodb_row_lock_time_avg 0 0
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
Variable_name Value Variable_name Value
innodb_sync_spin_loops 20 innodb_sync_spin_loops 20
......
...@@ -21,6 +21,15 @@ ...@@ -21,6 +21,15 @@
-- disable_query_log -- disable_query_log
SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency; SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
-- enable_query_log -- enable_query_log
--disable_warnings --disable_warnings
...@@ -1300,18 +1309,18 @@ drop table t1; ...@@ -1300,18 +1309,18 @@ drop table t1;
# Test for testable InnoDB status variables. This test # Test for testable InnoDB status variables. This test
# uses previous ones(pages_created, rows_deleted, ...). # uses previous ones(pages_created, rows_deleted, ...).
show status like "Innodb_buffer_pool_pages_total"; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
show status like "Innodb_page_size"; SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
show status like "Innodb_rows_deleted"; SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
show status like "Innodb_rows_inserted"; SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
show status like "Innodb_rows_updated"; SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
# Test for row locks InnoDB status variables. # Test for row locks InnoDB status variables.
show status like "Innodb_row_lock_waits"; SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
show status like "Innodb_row_lock_current_waits"; SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
show status like "Innodb_row_lock_time"; SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
show status like "Innodb_row_lock_time_max"; SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
show status like "Innodb_row_lock_time_avg"; SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
# Test for innodb_sync_spin_loops variable # Test for innodb_sync_spin_loops variable
show variables like "innodb_sync_spin_loops"; show variables like "innodb_sync_spin_loops";
......
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