Debian Codegraph @

mysql-test/suite/perfschema/t/myisam_file_io.test

raw
1 # Tests for PERFORMANCE_SCHEMA
2
3 --source include/not_embedded.inc
4 --source include/have_perfschema.inc
5
6 # Setup
7
8 update performance_schema.setup_instruments set enabled='NO';
9 update performance_schema.setup_instruments set enabled='YES'
10 where name like "wait/io/file/myisam/%";
11
12 update performance_schema.setup_consumers
13 set enabled='YES';
14
15 truncate table performance_schema.events_waits_history_long;
16
17 # Reset lost counters to a known state
18 truncate table performance_schema.events_statements_summary_by_digest;
19 flush global status;
20
21 # Code to test
22
23 --disable_warnings
24 drop table if exists test.no_index_tab;
25 --enable_warnings
26
27 create table test.no_index_tab ( a varchar(255), b int ) engine=myisam;
28 insert into no_index_tab set a = 'foo', b = 1;
29 insert into no_index_tab set a = 'foo', b = 1;
30 insert into no_index_tab set a = 'foo', b = 1;
31
32 # Verification
33 # Note that mi_create.c contains mysql_file_tell() calls in debug only,
34 # so the result are filtered to remove 'tell'.
35 # Note that even after setting other instruments to enabled='NO'
36 # and truncating the events_waits_history_long table,
37 # some events -- that were already started but not completed --
38 # for other instruments could still be added in the history.
39 # To protect against that, an extra where clause
40 # "and event_name like "wait/io/file/myisam/%"
41 # is added to the select to filter out the result.
42
43 select event_name,
44 left(source, locate(":", source)) as short_source,
45 operation, number_of_bytes,
46 substring(object_name, locate("no_index_tab", object_name)) as short_name
47 from performance_schema.events_waits_history_long
48 where operation not like "tell"
49 and event_name like "wait/io/file/myisam/%"
50 having short_name <> ""
51 order by thread_id, event_id;
52
53 # In case of failures, this will tell if file io are lost.
54 show global status like 'performance_schema_%';
55
56 # Cleanup
57
58 update performance_schema.setup_instruments set enabled='YES';
59
60 drop table test.no_index_tab;
61