~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2009-08-12 06:25:19 UTC
  • mto: (1114.1.1 innodb-plugin-merge)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090812062519-cij02mrrunvnxblt
Tags: innodb-plugin-1.0.4
InnoDB Plugin 1.0.4

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 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).                             #
11
13
#                                                                     #
12
14
#######################################################################
13
15
 
14
16
-- source include/have_innodb.inc
15
17
 
16
 
#
17
 
# Small basic test with ignore
18
 
#
 
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
-- disable_query_log
 
27
SET @innodb_thread_concurrency_orig = @@innodb_thread_concurrency;
 
28
 
 
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');
 
37
-- enable_query_log
19
38
 
20
39
--disable_warnings
21
40
drop table if exists t1,t2,t3,t4;
22
41
drop database if exists mysqltest;
23
42
--enable_warnings
24
43
 
 
44
#
 
45
# Small basic test with ignore
 
46
#
 
47
 
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;
26
49
 
27
50
insert into t1 (code, name) values (1, 'Tim'), (1, 'Monty'), (2, 'David'), (2, 'Erik'), (3, 'Sasha'), (3, 'Jeremy'), (4, 'Matt');
1294
1317
 
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';
1303
1326
 
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';
1310
1333
 
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;
1319
1344
 
1320
1345
# Test for innodb_thread_concurrency variable
1321
1346
show variables like "innodb_thread_concurrency";
2524
2549
DISCONNECT c1;
2525
2550
CONNECTION default;
2526
2551
 
 
2552
SET GLOBAL innodb_thread_concurrency = @innodb_thread_concurrency_orig;
 
2553
 
 
2554
-- enable_query_log
 
2555
 
2527
2556
#######################################################################
2528
2557
#                                                                     #
2529
2558
# Please, DO NOT TOUCH this file as well as the innodb.result file.   #
2532
2561
# Use innodb_mysql.[test|result] files instead.                       #
2533
2562
#                                                                     #
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).                             #
2537
2568
#                                                                     #
2538
2569
#######################################################################