Debian Codegraph @

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

raw
1 ################################################################################
2 # Test case to test functionality in which a plugin/component can add its own
3 # tables in performance schema.
4 #
5 ################################################################################
6
7 --echo #################
8 --echo # INITIAL STATE #
9 --echo #################
10
11 select * from INFORMATION_SCHEMA.tables
12 where TABLE_NAME like "pfs_example_%";
13
14 --error ER_NO_SUCH_TABLE
15 describe performance_schema.pfs_example_continent;
16
17 --error ER_NO_SUCH_TABLE
18 show create table performance_schema.pfs_example_continent;
19
20 --error ER_NO_SUCH_TABLE
21 select * from performance_schema.pfs_example_continent;
22
23 --echo ###########
24 --echo # INSTALL #
25 --echo ###########
26
27 INSTALL COMPONENT "file://component_pfs_example_component_population";
28
29 select TABLE_SCHEMA, TABLE_NAME, ENGINE, VERSION, TABLE_COMMENT
30 from INFORMATION_SCHEMA.tables
31 where TABLE_NAME like "pfs_example_%"
32 order by table_name;
33
34 describe performance_schema.pfs_example_continent;
35
36 show create table performance_schema.pfs_example_continent;
37
38 select * from performance_schema.pfs_example_continent;
39
40 --echo ##############
41 --echo # UN INSTALL #
42 --echo ##############
43
44 UNINSTALL COMPONENT "file://component_pfs_example_component_population";
45
46 select * from INFORMATION_SCHEMA.tables
47 where TABLE_NAME like "pfs_example_%";
48
49 --error ER_NO_SUCH_TABLE
50 describe performance_schema.pfs_example_continent;
51
52 --error ER_NO_SUCH_TABLE
53 show create table performance_schema.pfs_example_continent;
54
55 --error ER_NO_SUCH_TABLE
56 select * from performance_schema.pfs_example_continent;
57
58 --echo ################################
59 --echo # SERVER RESTART, UN INSTALLED #
60 --echo ################################
61
62 --source include/restart_mysqld.inc
63
64 select * from INFORMATION_SCHEMA.tables
65 where TABLE_NAME like "pfs_example_%";
66
67 --error ER_NO_SUCH_TABLE
68 describe performance_schema.pfs_example_continent;
69
70 --error ER_NO_SUCH_TABLE
71 show create table performance_schema.pfs_example_continent;
72
73 --error ER_NO_SUCH_TABLE
74 select * from performance_schema.pfs_example_continent;
75
76 --echo ###########
77 --echo # INSTALL #
78 --echo ###########
79
80 INSTALL COMPONENT "file://component_pfs_example_component_population";
81
82 select TABLE_SCHEMA, TABLE_NAME, ENGINE, VERSION, TABLE_COMMENT
83 from INFORMATION_SCHEMA.tables
84 where TABLE_NAME like "pfs_example_%"
85 order by table_name;
86
87 describe performance_schema.pfs_example_continent;
88
89 show create table performance_schema.pfs_example_continent;
90
91 select * from performance_schema.pfs_example_continent;
92
93 --echo #############################
94 --echo # SERVER RESTART, INSTALLED #
95 --echo #############################
96
97 --source include/restart_mysqld.inc
98
99 select TABLE_SCHEMA, TABLE_NAME, ENGINE, VERSION, TABLE_COMMENT
100 from INFORMATION_SCHEMA.tables
101 where TABLE_NAME like "pfs_example_%"
102 order by table_name;
103
104 describe performance_schema.pfs_example_continent;
105
106 show create table performance_schema.pfs_example_continent;
107
108 select * from performance_schema.pfs_example_continent;
109
110 --echo ##############
111 --echo # UN INSTALL #
112 --echo ##############
113
114 UNINSTALL COMPONENT "file://component_pfs_example_component_population";
115
116 select * from INFORMATION_SCHEMA.tables
117 where TABLE_NAME like "pfs_example_%";
118
119 --error ER_NO_SUCH_TABLE
120 describe performance_schema.pfs_example_continent;
121
122 --error ER_NO_SUCH_TABLE
123 show create table performance_schema.pfs_example_continent;
124
125 --error ER_NO_SUCH_TABLE
126 select * from performance_schema.pfs_example_continent;
127
128 --echo ###########
129 --echo # CLEANUP #
130 --echo ###########
131 let $MYSQLD_DATADIR= `select @@datadir`;
132 cat_file $MYSQLD_DATADIR/pfs_example_component_population.log;
133 remove_file $MYSQLD_DATADIR/pfs_example_component_population.log;