Debian Codegraph @

mysql-test/suite/perfschema/r/idx_compare_ees_by_thread_by_error.result

raw
1 TABLE: "events_errors_summary_by_thread_by_error"
2 INDEXES: PK (THREAD_ID, ERROR_NUMBER)
3
4 ===== SETUP =====
5 ## Connection Default
6 ## Disable events from the default connection
7
8 ## Create user1, user2, user3
9 CREATE USER user1@localhost;
10 CREATE USER user2@localhost;
11 CREATE USER user3@localhost;
12 GRANT ALL ON *.* to 'user1'@localhost;
13 GRANT ALL ON *.* to 'user2'@localhost;
14 GRANT ALL ON *.* to 'user3'@localhost;
15
16 ## Setup test connection 1
17 ## Setup test connection 2
18 ## Setup test connection 3
19
20 ## Default connection
21
22 ## Create data tables
23 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));
24 CREATE TABLE test.t2 LIKE test.t1;
25 CREATE TABLE test.t3 LIKE test.t1;
26
27 ## Generate event data from 3 connections
28 ## Connection 1
29 ## Connection 2
30 ## Connection 3
31 ## Connection 2
32 ## Create prepared statements on connection 2
33 PREPARE st1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse';
34 PREPARE st3 FROM 'INSERT INTO test.t1 SELECT * FROM test.t1 WHERE a<=?';
35 PREPARE st4 FROM '(SELECT a FROM test.t1) UNION (SELECT a+10 FROM test.t1) ORDER BY RAND()*0+a';
36 ## Create stored procedure connection 2
37 CREATE PROCEDURE SampleProc1()
38 BEGIN
39 SET @table = 'test.t1';
40 SET @s = CONCAT('SELECT * FROM ', @table);
41 PREPARE st2 FROM @s;
42 END|
43
44 Call SampleProc1() to prepare a statement
45 CALL SampleProc1();
46 ## Connection default
47
48 ## Use Connection 2 for default target thread id
49
50 ## Create index_test() procedure
51 SET @pfs_columns = "THREAD_ID, ERROR_NUMBER";
52
53 ===== BEGIN TEST =====
54 ========
55 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id is null
56
57 OK: Handler_read_key
58
59 OK: Result set: Empty Expected: Empty
60
61 OK: Extra rows: 0 Missing rows: 0
62 ========
63 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id is not null
64
65 OK: Handler_read_key
66
67 OK: Result set: Non-empty Expected: Non-empty
68
69 OK: Extra rows: 0 Missing rows: 0
70 ========
71 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id = @target_thread_id
72
73 OK: Handler_read_key
74
75 OK: Result set: Non-empty Expected: Non-empty
76
77 OK: Extra rows: 0 Missing rows: 0
78 ========
79 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE error_number != 9999999
80
81 OK: Handler_read_key
82
83 OK: Result set: Non-empty Expected: Non-empty
84
85 OK: Extra rows: 0 Missing rows: 0
86 ========
87 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id = @target_thread_id ORDER BY thread_id
88
89 OK: Handler_read_key
90
91 OK: Result set: Non-empty Expected: Non-empty
92
93 OK: Extra rows: 0 Missing rows: 0
94 ========
95 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id = @target_thread_id ORDER BY thread_id DESC
96
97 OK: Handler_read_key
98
99 OK: Result set: Non-empty Expected: Non-empty
100
101 OK: Extra rows: 0 Missing rows: 0
102 ========
103 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id = @target_thread_id AND error_number is null
104
105 OK: Handler_read_key
106
107 OK: Result set: Non-empty Expected: Non-empty
108
109 OK: Extra rows: 0 Missing rows: 0
110 ========
111 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id = @target_thread_id AND error_number is not null
112
113 OK: Handler_read_key
114
115 OK: Result set: Non-empty Expected: Non-empty
116
117 OK: Extra rows: 0 Missing rows: 0
118 ========
119 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id = @target_thread_id AND error_number = 99999999
120
121 OK: Handler_read_key
122
123 OK: Result set: Empty Expected: Empty
124
125 OK: Extra rows: 0 Missing rows: 0
126 ========
127 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id > @target_thread_id
128
129 OK: Handler_read_key
130
131 OK: Result set: Non-empty Expected: Non-empty
132
133 OK: Extra rows: 0 Missing rows: 0
134 ========
135 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id < @target_thread_id
136
137 OK: Handler_read_key
138
139 OK: Result set: Non-empty Expected: Non-empty
140
141 OK: Extra rows: 0 Missing rows: 0
142 ========
143 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id >= @target_thread_id
144
145 OK: Handler_read_key
146
147 OK: Result set: Non-empty Expected: Non-empty
148
149 OK: Extra rows: 0 Missing rows: 0
150 ========
151 SELECT THREAD_ID, ERROR_NUMBER FROM performance_schema.events_errors_summary_by_thread_by_error WHERE thread_id <= @target_thread_id
152
153 OK: Handler_read_key
154
155 OK: Result set: Non-empty Expected: Non-empty
156
157 OK: Extra rows: 0 Missing rows: 0
158
159 ===== CLEAN UP =====
160 ## Default connection
161 DEALLOCATE PREPARE st1;
162 DEALLOCATE PREPARE st2;
163 DEALLOCATE PREPARE st3;
164 DEALLOCATE PREPARE st4;
165 DROP PROCEDURE SampleProc1;
166 DROP PROCEDURE index_test;
167 DROP TABLE IF EXISTS test.indexes_off;
168 DROP TABLE IF EXISTS test.indexes_on;
169 DROP TABLE test.t1;
170 DROP TABLE test.t2;
171 DROP TABLE test.t3;
172 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
173 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user2@localhost;
174 REVOKE ALL PRIVILEGES, GRANT OPTION FROM user3@localhost;
175 DROP USER user1@localhost;
176 DROP USER user2@localhost;
177 DROP USER user3@localhost;
178 UPDATE performance_schema.threads SET INSTRUMENTED = 'YES';