summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/perfschema/t/dml_file_instances.test
blob: 820700b6a1b98a6dea1f167719a09e091067a3d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Tests for PERFORMANCE_SCHEMA

--source include/not_embedded.inc
--source include/have_perfschema.inc
--source include/have_innodb.inc

--disable_result_log
select * from performance_schema.file_instances limit 1;

select * from performance_schema.file_instances
  where file_name='FOO';
--enable_result_log

--error ER_TABLEACCESS_DENIED_ERROR
insert into performance_schema.file_instances
  set file_name='FOO', event_name='BAR', open_count=12;

--error ER_TABLEACCESS_DENIED_ERROR
update performance_schema.file_instances
  set file_name='FOO';

--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.file_instances
  where event_name like "wait/%";

--error ER_TABLEACCESS_DENIED_ERROR
delete from performance_schema.file_instances;

-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.file_instances READ;
UNLOCK TABLES;

-- error ER_TABLEACCESS_DENIED_ERROR
LOCK TABLES performance_schema.file_instances WRITE;
UNLOCK TABLES;

--echo #
--echo # MDEV-25325 column_comment for performance_schema tables
--echo #
select column_name, column_comment 
from information_schema.columns 
where table_schema='performance_schema' and table_name='file_instances';

--echo ###
--echo ### Bug#26152751: INNODB LEAKS MEMORY, PERFORMANCE_SCHEMA FILE_INSTANCES
--echo ###               #SQL-IB3129987-252773.IBD
--echo ###

CREATE DATABASE db_26152751;
USE db_26152751;

SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

CREATE TABLE t_db_26152751 (a INT) ENGINE=MYISAM;

--sorted_result
--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

RENAME TABLE t_db_26152751 to t_db_26152751_new;

--sorted_result
--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

RENAME TABLE t_db_26152751_new to t_db_26152751;

--sorted_result
--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

ALTER TABLE t_db_26152751 ADD COLUMN b INT;

--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

DROP TABLE t_db_26152751;

SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

CREATE TABLE t_db_26152751 (a INT) ENGINE=INNODB;

--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

RENAME TABLE t_db_26152751 to t_db_26152751_new;

--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

RENAME TABLE t_db_26152751_new to t_db_26152751;

--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

ALTER TABLE t_db_26152751 ADD COLUMN b INT;

--replace_regex /.*\/t_db_26152751/t_db_26152751/
SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

DROP TABLE t_db_26152751;

SELECT FILE_NAME FROM performance_schema.file_instances WHERE FILE_NAME LIKE "%t_db_26152751%" ORDER BY FILE_NAME;

DROP DATABASE db_26152751;


--echo #
--echo # MDEV-25325 column_comment for performance_schema tables
--echo #
select column_name, column_comment 
from information_schema.columns 
where table_schema='performance_schema' and table_name='file_instances';