File: idx_compare_mutex_instances.result

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (221 lines) | stat: -rw-r--r-- 5,820 bytes parent folder | download
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
TABLE: "mutex_instances"
INDEXES: PK (OBJECT_INSTANCE_BEGIN), KEY (NAME), KEY (LOCKED_BY_THREAD_ID)

===== SETUP =====
## Connection Default
## Disable events from the default connection

## Create user1, user2, user3
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;

## Setup test connection 1
## Setup test connection 2
## Setup test connection 3

## Default connection

## Create data tables
CREATE TABLE test.t1(a INT, b INT, c INT, d INT DEFAULT 0, PRIMARY KEY(a), INDEX index_b(b), INDEX index_cb(c, b));
CREATE TABLE test.t2 LIKE test.t1;
CREATE TABLE test.t3 LIKE test.t1;

## Generate event data from 3 connections
## Connection 1
## Connection 2
## Connection 3
## Connection 2
## Create prepared statements on connection 2
PREPARE st1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
PREPARE st3 FROM 'INSERT INTO test.t1 SELECT * FROM test.t1 WHERE a<=?';
PREPARE st4 FROM '(SELECT a FROM test.t1) UNION (SELECT a+10 FROM test.t1) ORDER BY RAND()*0+a';
## Create stored procedure connection 2
CREATE PROCEDURE SampleProc1()
BEGIN
SET @table = 'test.t1';
SET @s = CONCAT('SELECT * FROM ', @table);
PREPARE st2 FROM @s;
END|

Call SampleProc1() to prepare a statement
CALL SampleProc1();
## Connection default

## Use Connection 2 for default target thread id

## Create index_test() procedure

## Test OBJECT_INSTANCE_BEGIN

===== BEGIN TEST =====
========
SELECT * FROM performance_schema.mutex_instances WHERE object_instance_begin is null

OK: Handler_read_key

OK: Result set: Empty  Expected: Empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE object_instance_begin is not null

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE object_instance_begin = @object_instance_begin

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE object_instance_begin != @object_instance_begin

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE object_instance_begin = '9999999999'

OK: Handler_read_key

OK: Result set: Empty  Expected: Empty

OK: Extra rows: 0  Missing rows: 0

## Test NAME

===== BEGIN TEST =====
========
SELECT * FROM performance_schema.mutex_instances WHERE NAME is null

OK: Handler_read_key

OK: Result set: Empty  Expected: Empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE NAME is not null

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE NAME = 'wait/synch/mutex/sql/MDL_wait::LOCK_wait_status'

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE NAME != 'wait/synch/mutex/sql/MDL_wait::LOCK_wait_status'

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE NAME = 'impossible'

OK: Handler_read_key

OK: Result set: Empty  Expected: Empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE NAME != 'impossible' ORDER BY NAME DESC

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0

## Test LOCKED_BY_THREAD_ID

===== BEGIN TEST =====
========
SELECT * FROM performance_schema.mutex_instances WHERE LOCKED_BY_THREAD_ID is null

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE LOCKED_BY_THREAD_ID is not null

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE LOCKED_BY_THREAD_ID = @target_id

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE LOCKED_BY_THREAD_ID = @target_id ORDER BY LOCKED_BY_THREAD_ID

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE LOCKED_BY_THREAD_ID = @target_id ORDER BY LOCKED_BY_THREAD_ID DESC

OK: Handler_read_key

OK: Result set: Non-empty  Expected: Non-empty

OK: Extra rows: 0  Missing rows: 0
========
SELECT * FROM performance_schema.mutex_instances WHERE LOCKED_BY_THREAD_ID = 9999999 ORDER BY LOCKED_BY_THREAD_ID

OK: Handler_read_key

OK: Result set: Empty  Expected: Empty

OK: Extra rows: 0  Missing rows: 0
UNLOCK TABLES;
UNLOCK TABLES;

===== CLEAN UP =====
## Default connection
DEALLOCATE PREPARE st1;
DEALLOCATE PREPARE st2;
DEALLOCATE PREPARE st3;
DEALLOCATE PREPARE st4;
DROP PROCEDURE SampleProc1;
DROP PROCEDURE index_test;
DROP TABLE IF EXISTS test.indexes_off;
DROP TABLE IF EXISTS test.indexes_on;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
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;
UPDATE performance_schema.threads SET INSTRUMENTED = 'YES';