summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/perfschema/r/misc_global_status.result
blob: 1863dde61031766a3bd7a98995a7d2e10b27a2cd (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
CREATE USER user1@localhost;
CREATE USER user2@localhost;
CREATE USER user3@localhost;
grant ALL on *.* to user1@localhost;
grant ALL on *.* to user2@localhost;
grant ALL on *.* to user3@localhost;
TRUNCATE TABLE performance_schema.accounts;
FLUSH PRIVILEGES;
CREATE TABLE test.t_range(a int, b int, PRIMARY KEY(a));
INSERT INTO test.t_range values (1, 1), (2,2), (3, 3), (4, 4), (5, 5);
INSERT INTO test.t_range values (6, 6), (7,7), (8, 8), (9, 9), (10, 10);
FLUSH STATUS;
SELECT * from test.t_range where (a >= 3) AND (a <= 5);
a	b
3	3
4	4
5	5
SELECT * from performance_schema.session_status
WHERE VARIABLE_NAME = 'Select_range';
VARIABLE_NAME	VARIABLE_VALUE
Select_range	1
VARIABLE_NAME	DELTA
Select_range	1
connect con1, localhost, user1,,;
SELECT * from test.t_range where (a >= 3) AND (a <= 5);
a	b
3	3
4	4
5	5
SELECT * from performance_schema.session_status
WHERE VARIABLE_NAME = 'Select_range';
VARIABLE_NAME	VARIABLE_VALUE
Select_range	1
VARIABLE_NAME	DELTA
Select_range	2
connect con2, localhost, user2,,;
SELECT * from test.t_range where (a >= 3) AND (a <= 5);
a	b
3	3
4	4
5	5
SELECT * from test.t_range where (a >= 4) AND (a <= 6);
a	b
4	4
5	5
6	6
SELECT * from performance_schema.session_status
WHERE VARIABLE_NAME = 'Select_range';
VARIABLE_NAME	VARIABLE_VALUE
Select_range	2
VARIABLE_NAME	DELTA
Select_range	4
connect con3, localhost, user3,,;
SELECT * from test.t_range where (a >= 3) AND (a <= 5);
a	b
3	3
4	4
5	5
SELECT * from test.t_range where (a >= 4) AND (a <= 6);
a	b
4	4
5	5
6	6
SELECT * from test.t_range where (a >= 5) AND (a <= 7);
a	b
5	5
6	6
7	7
SELECT * from performance_schema.session_status
WHERE VARIABLE_NAME = 'Select_range';
VARIABLE_NAME	VARIABLE_VALUE
Select_range	3
VARIABLE_NAME	DELTA
Select_range	7
connection default;
VARIABLE_NAME	DELTA
Select_range	7
SELECT `USER`, `HOST`, VARIABLE_NAME, VARIABLE_VALUE
FROM performance_schema.status_by_account WHERE VARIABLE_NAME = 'Select_range'
  AND `USER` LIKE 'user%'
  ORDER BY `USER`;
USER	HOST	VARIABLE_NAME	VARIABLE_VALUE
user1	localhost	Select_range	1
user2	localhost	Select_range	2
user3	localhost	Select_range	3
disconnect con1;
disconnect con2;
VARIABLE_NAME	DELTA
Select_range	7
TRUNCATE TABLE performance_schema.accounts;
VARIABLE_NAME	DELTA
Select_range	7
disconnect con3;
VARIABLE_NAME	DELTA
Select_range	7
TRUNCATE TABLE performance_schema.accounts;
VARIABLE_NAME	DELTA
Select_range	7
DROP TABLE test.t_range;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
DROP USER user1@localhost;
DROP USER user2@localhost;
DROP USER user3@localhost;
FLUSH PRIVILEGES;