Skip to content

Commit 74ac683

Browse files
committed
cleanup: kill test
split it into debug and non-debug tests
1 parent d7d3ad6 commit 74ac683

File tree

4 files changed

+529
-515
lines changed

4 files changed

+529
-515
lines changed

mysql-test/main/kill.result

Lines changed: 4 additions & 223 deletions
Original file line numberDiff line numberDiff line change
@@ -1,233 +1,14 @@
11
set local sql_mode="";
22
set global sql_mode="";
3-
SET DEBUG_SYNC = 'RESET';
4-
DROP TABLE IF EXISTS t1, t2, t3;
5-
DROP FUNCTION IF EXISTS MY_KILL;
6-
CREATE FUNCTION MY_KILL(tid INT) RETURNS INT
7-
BEGIN
8-
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
9-
KILL tid;
10-
RETURN (SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = tid);
11-
END|
12-
connect con1, localhost, root,,;
13-
connect con2, localhost, root,,;
14-
connection con1;
15-
connection con2;
16-
connection con1;
17-
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
18-
SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read';
19-
connection con2;
20-
SET DEBUG_SYNC='now WAIT_FOR con1_read';
21-
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
22-
SET DEBUG_SYNC = 'RESET';
23-
connection con1;
24-
SELECT 1;
25-
Got one of the listed errors
26-
SELECT 1;
27-
1
28-
1
29-
SELECT @id != CONNECTION_ID();
30-
@id != CONNECTION_ID()
31-
1
32-
connection con2;
33-
SELECT 4;
34-
4
35-
4
36-
connection default;
37-
KILL (SELECT COUNT(*) FROM mysql.user);
38-
ERROR 42000: KILL does not support subqueries or stored functions
39-
connection con1;
40-
connection con2;
41-
connection con1;
42-
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
43-
SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill';
44-
connection con2;
45-
SET DEBUG_SYNC= 'now WAIT_FOR con1_read';
46-
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
47-
SET DEBUG_SYNC = 'RESET';
48-
connection con1;
49-
SELECT 1;
50-
Got one of the listed errors
51-
SELECT 1;
52-
1
53-
1
54-
SELECT @id != CONNECTION_ID();
55-
@id != CONNECTION_ID()
56-
1
57-
connection con2;
58-
SELECT 4;
59-
4
60-
4
61-
connection default;
62-
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT);
63-
CREATE TABLE t2 (id INT UNSIGNED NOT NULL);
64-
INSERT INTO t1 VALUES
65-
(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
66-
(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
67-
(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0),
68-
(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0);
69-
INSERT t1 SELECT 0 FROM t1 AS a1, t1 AS a2 LIMIT 4032;
70-
INSERT INTO t2 SELECT id FROM t1;
71-
connection con1;
72-
connection con2;
73-
connection con1;
74-
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
75-
SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync';
76-
SELECT id FROM t1 WHERE id IN
77-
(SELECT DISTINCT a.id FROM t2 a, t2 b, t2 c, t2 d
78-
GROUP BY ACOS(1/a.id), b.id, c.id, d.id
79-
HAVING a.id BETWEEN 10 AND 20);
80-
connection con2;
81-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
82-
KILL @id;
83-
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
84-
connection con1;
85-
Got one of the listed errors
86-
SELECT 1;
87-
1
88-
1
89-
connection default;
90-
SET DEBUG_SYNC = 'RESET';
91-
DROP TABLE t1, t2;
92-
connection con1;
93-
connection con2;
94-
connection con1;
95-
SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync WAIT_FOR kill';
96-
SELECT ACOS(0);
97-
connection con2;
98-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
99-
KILL QUERY @id;
100-
connection con1;
101-
ACOS(0)
102-
1.5707963267948966
103-
SELECT 1;
104-
1
105-
1
106-
SELECT @id = CONNECTION_ID();
107-
@id = CONNECTION_ID()
108-
1
109-
connection default;
110-
SET DEBUG_SYNC = 'RESET';
111-
CREATE TABLE t1 (f1 INT);
112-
CREATE FUNCTION bug27563() RETURNS INT(11)
113-
DETERMINISTIC
114-
BEGIN
115-
DECLARE CONTINUE HANDLER FOR SQLSTATE '70100' SET @a:= 'killed';
116-
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
117-
SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
118-
RETURN 1;
119-
END|
120-
connection con1;
121-
connection con2;
122-
connection con1;
123-
INSERT INTO t1 VALUES (bug27563());
124-
connection con2;
125-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
126-
KILL QUERY @id;
127-
connection con1;
128-
ERROR 70100: Query execution was interrupted
129-
SELECT * FROM t1;
130-
f1
131-
connection default;
132-
SET DEBUG_SYNC = 'RESET';
133-
INSERT INTO t1 VALUES(0);
134-
connection con1;
135-
UPDATE t1 SET f1= bug27563();
136-
connection con2;
137-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
138-
KILL QUERY @id;
139-
connection con1;
140-
ERROR 70100: Query execution was interrupted
141-
SELECT * FROM t1;
142-
f1
143-
0
144-
connection default;
145-
SET DEBUG_SYNC = 'RESET';
146-
INSERT INTO t1 VALUES(1);
147-
connection con1;
148-
DELETE FROM t1 WHERE bug27563() IS NULL;
149-
connection con2;
150-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
151-
KILL QUERY @id;
152-
connection con1;
153-
ERROR 70100: Query execution was interrupted
154-
SELECT * FROM t1;
155-
f1
156-
0
157-
1
158-
connection default;
159-
SET DEBUG_SYNC = 'RESET';
160-
connection con1;
161-
SELECT * FROM t1 WHERE f1= bug27563();
162-
connection con2;
163-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
164-
KILL QUERY @id;
165-
connection con1;
166-
ERROR 70100: Query execution was interrupted
167-
SELECT * FROM t1;
168-
f1
169-
0
170-
1
171-
connection default;
172-
SET DEBUG_SYNC = 'RESET';
173-
DROP FUNCTION bug27563;
174-
CREATE TABLE t2 (f2 INT);
175-
CREATE TRIGGER trg27563 BEFORE INSERT ON t1 FOR EACH ROW
176-
BEGIN
177-
DECLARE CONTINUE HANDLER FOR SQLSTATE '70100' SET @a:= 'killed';
178-
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
179-
INSERT INTO t2 VALUES(0);
180-
SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
181-
INSERT INTO t2 VALUES(1);
182-
END|
183-
connection con1;
184-
INSERT INTO t1 VALUES(2),(3);
185-
connection con2;
186-
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
187-
KILL QUERY @id;
188-
connection con1;
189-
ERROR 70100: Query execution was interrupted
190-
SELECT * FROM t1;
191-
f1
192-
0
193-
1
194-
SELECT * FROM t2;
195-
f2
196-
0
197-
connection default;
198-
SET DEBUG_SYNC = 'RESET';
199-
DROP TABLE t1, t2;
200-
#
201-
# Bug#19723: kill of active connection yields different error code
202-
# depending on platform.
203-
#
204-
connection con1;
205-
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
206-
KILL @id;
207-
ERROR 70100: Connection was killed
208-
connection con2;
209-
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
210-
connection con1;
211-
# ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST,
212-
# depending on the timing of close of the connection socket
213-
SELECT 1;
214-
Got one of the listed errors
215-
SELECT 1;
216-
1
217-
1
218-
SELECT @id != CONNECTION_ID();
219-
@id != CONNECTION_ID()
220-
1
221-
connection default;
222-
SET DEBUG_SYNC = 'RESET';
3+
connect con1, localhost, root;
4+
connect con2, localhost, root;
2235
#
2246
# Additional test for WL#3726 "DDL locking for all metadata objects"
2257
# Check that DDL and DML statements waiting for metadata locks can
2268
# be killed. Note that we don't cover all situations here since it
2279
# can be tricky to write test case for some of them (e.g. REPAIR or
22810
# ALTER and other statements under LOCK TABLES).
22911
#
230-
drop tables if exists t1, t2, t3;
23112
create table t1 (i int primary key);
23213
connect blocker, localhost, root, , ;
23314
connect dml, localhost, root, , ;
@@ -380,9 +161,9 @@ connection default;
380161
ERROR 70100: Query execution was interrupted
381162
disconnect con5;
382163
DROP USER u1@localhost;
383-
SET DEBUG_SYNC = 'RESET';
384-
DROP FUNCTION MY_KILL;
385164
set global sql_mode=default;
165+
disconnect con1;
166+
disconnect con2;
386167
#
387168
# MDEV-17998
388169
# Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed

0 commit comments

Comments
 (0)