Debian Codegraph @

mysql-test/suite/perfschema/include/table_io_setup_helper.inc

raw
1 # Performance schema test template
2
3 # How to use this script in a test case
4 # =====================================
5 #
6 # The general table io test template is as follows
7 #
8 # --source ../include/table_io_setup_helper.inc
9 # ... more setup scripts as needed ...
10 # update performance_schema.setup_consumers set enabled='YES';
11 # ... test payload here ...
12 # ... optionally, add this insert between statements
13 # ... to make the final output more readable
14 # insert into test.marker set a=1;
15 # ... more test payload here ...
16 # ... optionaly, add the following line (by default, only "test" is dumped) ...
17 # let $schema_to_dump="db1", "db2", "db3";
18 # --source ../include/table_io_result_helper.inc
19 # Optional: Repeat several times
20 # update performance_schema.setup_consumers set enabled='YES';
21 # ... test payload here ...
22 # --source ../include/table_io_result_helper.inc
23 # ... cleanup
24 # --source ../include/table_io_cleanup_helper.inc
25 #
26 # (end of template)
27
28 # Setup
29
30 --disable_warnings
31 drop table if exists test.marker;
32 --enable_warnings
33
34 # To be used in the test payload,
35 # insert into marker makes the test output easier to read,
36 # to separate table io events between statements.
37 create table test.marker(a int);
38
39 update performance_schema.setup_consumers set enabled='NO';
40
41 update performance_schema.setup_instruments set enabled='NO';
42 update performance_schema.setup_instruments set enabled='YES'
43 where name like "wait/io/table/%";
44
45 truncate table performance_schema.events_waits_history_long;
46
47 # Reset lost counters to a known state
48 flush status;
49
50 # Make sure there is room to instrument tables from this test.
51 flush tables;
52
53 # By default, dump table io only for test.
54 # A test can overide this
55 let $schema_to_dump="test";
56