6
6
# Use innodb_mysql.[test|result] files instead. #
8
8
# If nevertheless you need to make some changes here, please, forward #
9
# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com #
9
# your commit message #
10
# To: innodb_dev_ww@oracle.com #
11
# Cc: dev-innodb@mysql.com #
10
12
# (otherwise your changes may be erased). #
12
14
#######################################################################
14
16
-- source include/have_innodb.inc
17
# Small basic test with ignore
18
# Save the original values of some variables in order to be able to
19
# estimate how much they have changed during the tests. Previously this
20
# test assumed that e.g. rows_deleted is 0 here and after deleting 23
21
# rows it expected that rows_deleted will be 23. Now we do not make
22
# assumptions about the values of the variables at the beginning, e.g.
23
# rows_deleted should be 23 + "rows_deleted before the test". This allows
24
# the test to be run multiple times without restarting the mysqld server.
25
# See Bug#43309 Test main.innodb can't be run twice
27
SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
29
SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
30
SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
31
SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
32
SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
33
SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
34
SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
35
SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
36
SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
21
40
drop table if exists t1,t2,t3,t4;
22
41
drop database if exists mysqltest;
45
# Small basic test with ignore
25
48
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;
27
50
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
1295
1318
# Test for testable InnoDB status variables. This test
1296
1319
# uses previous ones(pages_created, rows_deleted, ...).
1297
--replace_result 512 511
1298
show status like "Innodb_buffer_pool_pages_total";
1299
show status like "Innodb_page_size";
1300
show status like "Innodb_rows_deleted";
1301
show status like "Innodb_rows_inserted";
1302
show status like "Innodb_rows_updated";
1320
--replace_result 8192 8191
1321
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
1322
SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_page_size';
1323
SELECT variable_value - @innodb_rows_deleted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted';
1324
SELECT variable_value - @innodb_rows_inserted_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted';
1325
SELECT variable_value - @innodb_rows_updated_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated';
1304
1327
# Test for row locks InnoDB status variables.
1305
show status like "Innodb_row_lock_waits";
1306
show status like "Innodb_row_lock_current_waits";
1307
show status like "Innodb_row_lock_time";
1308
show status like "Innodb_row_lock_time_max";
1309
show status like "Innodb_row_lock_time_avg";
1328
SELECT variable_value - @innodb_row_lock_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits';
1329
SELECT variable_value - @innodb_row_lock_current_waits_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits';
1330
SELECT variable_value - @innodb_row_lock_time_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time';
1331
SELECT variable_value - @innodb_row_lock_time_max_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
1332
SELECT variable_value - @innodb_row_lock_time_avg_orig FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
1311
1334
# Test for innodb_sync_spin_loops variable
1335
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
1312
1336
show variables like "innodb_sync_spin_loops";
1313
1337
set global innodb_sync_spin_loops=1000;
1314
1338
show variables like "innodb_sync_spin_loops";
1316
1340
show variables like "innodb_sync_spin_loops";
1317
1341
set global innodb_sync_spin_loops=20;
1318
1342
show variables like "innodb_sync_spin_loops";
1343
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
1320
1345
# Test for innodb_thread_concurrency variable
1321
1346
show variables like "innodb_thread_concurrency";
2532
2561
# Use innodb_mysql.[test|result] files instead. #
2534
2563
# If nevertheless you need to make some changes here, please, forward #
2535
# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com #
2564
# your commit message #
2565
# To: innodb_dev_ww@oracle.com #
2566
# Cc: dev-innodb@mysql.com #
2536
2567
# (otherwise your changes may be erased). #
2538
2569
#######################################################################