mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Applying InnoDB snashot 5.1-ss4699, part 2. Fixes BUG#43309
1) BUG#43309 - Test main.innodb can't be run twice 2) Follow up fix for BUG#43309, adds explanatory comments. Detailed revision comments: r4575 | vasil | 2009-03-30 15:55:31 +0300 (Mon, 30 Mar 2009) | 8 lines 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. r4659 | vasil | 2009-04-06 15:34:51 +0300 (Mon, 06 Apr 2009) | 6 lines branches/5.1: Followup to r4575 and the fix of Bug#43309 Test main.innodb can't be run twice: Add an explanatory comment, as suggested by Patrick Crews in the bug report.
This commit is contained in:
@ -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
|
||||||
|
@ -15,12 +15,25 @@
|
|||||||
|
|
||||||
-- source include/have_innodb.inc
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
#
|
# Save the original values of some variables in order to be able to
|
||||||
# Small basic test with ignore
|
# estimate how much they have changed during the tests. Previously this
|
||||||
#
|
# test assumed that e.g. rows_deleted is 0 here and after deleting 23
|
||||||
|
# rows it expected that rows_deleted will be 23. Now we do not make
|
||||||
|
# assumptions about the values of the variables at the beginning, e.g.
|
||||||
|
# rows_deleted should be 23 + "rows_deleted before the test". This allows
|
||||||
|
# the test to be run multiple times without restarting the mysqld server.
|
||||||
|
# See Bug#43309 Test main.innodb can't be run twice
|
||||||
-- 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
|
||||||
@ -28,6 +41,10 @@ drop table if exists t1,t2,t3,t4;
|
|||||||
drop database if exists mysqltest;
|
drop database if exists mysqltest;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Small basic test with ignore
|
||||||
|
#
|
||||||
|
|
||||||
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
|
create table t1 (id int unsigned not null auto_increment, code tinyint unsigned not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=innodb;
|
||||||
|
|
||||||
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
|
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
|
||||||
@ -1300,18 +1317,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";
|
||||||
|
Reference in New Issue
Block a user