Debian Codegraph @

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

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