~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/mysql-test/innodb.test

  • Committer: Brian Aker
  • Date: 2009-01-24 09:43:35 UTC
  • Revision ID: brian@gir-3.local-20090124094335-6qdtvc35gl5fvivz
Adding in an example singe thread scheduler

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
# Use innodb_mysql.[test|result] files instead.                       #
7
7
#                                                                     #
8
8
# If nevertheless you need to make some changes here, please, forward #
9
 
# your commit message                                                 #
10
 
# To: innodb_dev_ww@oracle.com                                        #
11
 
# Cc: dev-innodb@mysql.com                                            #
 
9
# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com     #
12
10
# (otherwise your changes may be erased).                             #
13
11
#                                                                     #
14
12
#######################################################################
15
13
 
16
14
-- source include/have_innodb.inc
17
15
 
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
26
 
SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
27
 
 
28
 
SET @innodb_rows_deleted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_deleted');
29
 
SET @innodb_rows_inserted_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_inserted');
30
 
SET @innodb_rows_updated_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_rows_updated');
31
 
SET @innodb_row_lock_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_waits');
32
 
SET @innodb_row_lock_current_waits_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_current_waits');
33
 
SET @innodb_row_lock_time_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time');
34
 
SET @innodb_row_lock_time_max_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_max');
35
 
SET @innodb_row_lock_time_avg_orig = (SELECT variable_value FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg');
 
16
#
 
17
# Small basic test with ignore
 
18
#
36
19
 
37
20
--disable_warnings
38
21
drop table if exists t1,t2,t3,t4;
39
22
drop database if exists mysqltest;
40
23
--enable_warnings
41
24
 
42
 
#
43
 
# Small basic test with ignore
44
 
#
45
 
 
46
25
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;
47
26
 
48
27
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
1317
1294
 
1318
1295
# Test for testable InnoDB status variables. This test
1319
1296
# uses previous ones(pages_created, rows_deleted, ...).
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';
 
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";
1326
1303
 
1327
1304
# Test for row locks InnoDB status variables.
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';
 
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";
1333
1310
 
1334
1311
# Test for innodb_sync_spin_loops variable
1335
 
SET @innodb_sync_spin_loops_orig = @@innodb_sync_spin_loops;
1336
1312
show variables like "innodb_sync_spin_loops";
1337
1313
set global innodb_sync_spin_loops=1000;
1338
1314
show variables like "innodb_sync_spin_loops";
1340
1316
show variables like "innodb_sync_spin_loops";
1341
1317
set global innodb_sync_spin_loops=20;
1342
1318
show variables like "innodb_sync_spin_loops";
1343
 
set global innodb_sync_spin_loops=@innodb_sync_spin_loops_orig;
1344
1319
 
1345
1320
# Test for innodb_thread_concurrency variable
1346
1321
show variables like "innodb_thread_concurrency";
2549
2524
DISCONNECT c1;
2550
2525
CONNECTION default;
2551
2526
 
2552
 
SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
2553
 
 
2554
 
 
2555
2527
#######################################################################
2556
2528
#                                                                     #
2557
2529
# Please, DO NOT TOUCH this file as well as the innodb.result file.   #
2561
2532
# Use innodb_mysql.[test|result] files instead.                       #
2562
2533
#                                                                     #
2563
2534
# If nevertheless you need to make some changes here, please, forward #
2564
 
# your commit message                                                 #
2565
 
# To: innodb_dev_ww@oracle.com                                        #
2566
 
# Cc: dev-innodb@mysql.com                                            #
 
2535
# your commit message To: dev@innodb.com Cc: dev-innodb@mysql.com     #
2567
2536
# (otherwise your changes may be erased).                             #
2568
2537
#                                                                     #
2569
2538
#######################################################################