Debian Codegraph @

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

raw
1 # Tests for PERFORMANCE_SCHEMA table io
2 # Reveal that in case of statements using more than one base table
3 # both show up in a correct way.
4
5 # Setup
6
7 --source include/not_embedded.inc
8 --source include/have_perfschema.inc
9
10 --disable_warnings
11 drop schema if exists test1;
12 drop table if exists test.t1;
13 --enable_warnings
14
15 create schema test1;
16 let $engine_type= myisam;
17 eval create table test.t1 (col1 bigint, col2 varchar(30)) engine = $engine_type;
18 insert into test.t1 values(1,'One');
19 create table test1.t2 like test.t1;
20 # Make sure the proper engine is used
21 show create table test.t1;
22 show create table test1.t2;
23
24 --source ../include/table_io_setup_helper.inc
25 let $schema_to_dump= 'test','test1';
26
27 # Start event recording
28 update performance_schema.setup_consumers set enabled = 'YES';
29
30 --disable_ps2_protocol
31 # INSERT ... SELECT ...
32 insert into test1.t2 select * from test.t1;
33 insert into marker set a = 1;
34 # JOIN
35 select * from test.t1 natural join test1.t2;
36 insert into marker set a = 1;
37 # CORRELATED SUBQUERY
38 select * from test.t1 where col2 = (select col2 from test1.t2 where test.t1.col1 = test1.t2.col1);
39 insert into marker set a = 1;
40 # UPDATE
41 update test.t1 AS a natural join test1.t2 AS b SET a.col2 = 'updated' , b.col2 = 'updated';
42 insert into marker set a = 1;
43 # DELETE
44 delete from test.t1, test1.t2 using test.t1 inner join test1.t2
45 where test.t1.col1 = test1.t2.col1;
46 --enable_ps2_protocol
47
48 # Stop event recording + pull results
49 --source ../include/table_io_result_helper.inc
50
51 # Cleanup
52 drop table test.t1;
53 drop schema test1;
54 --source ../include/table_io_cleanup_helper.inc
55